aboutsummaryrefslogtreecommitdiff
path: root/test/codegen/mathbits.go
diff options
context:
space:
mode:
authornimelehin <nimelehin@gmail.com>2021-09-15 10:31:05 +0300
committerKeith Randall <khr@golang.org>2021-10-05 18:32:12 +0000
commit097a82f54d20cb722b8712025caac44c357c1b13 (patch)
treeb3bddc40205a7fb464a366b5fae37914f03a698a /test/codegen/mathbits.go
parent5d946f1892dc4ae3d3220fb0bc4d61cdf6175ee6 (diff)
downloadgo-097a82f54d20cb722b8712025caac44c357c1b13.tar.xz
cmd/compile: don't emit unnecessary amd64 extension checks
In case of amd64 the compiler issues checks if extensions are available on a platform. With GOAMD64 microarchitecture levels provided, some of the checks could be eliminated. Change-Id: If15c178bcae273b2ce7d3673415cb8849292e087 Reviewed-on: https://go-review.googlesource.com/c/go/+/352010 Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Go Bot <gobot@golang.org>
Diffstat (limited to 'test/codegen/mathbits.go')
-rw-r--r--test/codegen/mathbits.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/codegen/mathbits.go b/test/codegen/mathbits.go
index 50527fea04..2d8790c1de 100644
--- a/test/codegen/mathbits.go
+++ b/test/codegen/mathbits.go
@@ -118,8 +118,9 @@ func Len8(n uint8) int {
// bits.OnesCount //
// -------------------- //
-// TODO(register args) Restore a m d 6 4 :.*x86HasPOPCNT when only one ABI is tested.
+// TODO(register args) Restore a m d 6 4 / v 1 :.*x86HasPOPCNT when only one ABI is tested.
func OnesCount(n uint) int {
+ // amd64/v2:-".*x86HasPOPCNT" amd64/v3:-".*x86HasPOPCNT"
// amd64:"POPCNTQ"
// arm64:"VCNT","VUADDLV"
// s390x:"POPCNT"
@@ -130,6 +131,7 @@ func OnesCount(n uint) int {
}
func OnesCount64(n uint64) int {
+ // amd64/v2:-".*x86HasPOPCNT" amd64/v3:-".*x86HasPOPCNT"
// amd64:"POPCNTQ"
// arm64:"VCNT","VUADDLV"
// s390x:"POPCNT"
@@ -140,6 +142,7 @@ func OnesCount64(n uint64) int {
}
func OnesCount32(n uint32) int {
+ // amd64/v2:-".*x86HasPOPCNT" amd64/v3:-".*x86HasPOPCNT"
// amd64:"POPCNTL"
// arm64:"VCNT","VUADDLV"
// s390x:"POPCNT"
@@ -150,6 +153,7 @@ func OnesCount32(n uint32) int {
}
func OnesCount16(n uint16) int {
+ // amd64/v2:-".*x86HasPOPCNT" amd64/v3:-".*x86HasPOPCNT"
// amd64:"POPCNTL"
// arm64:"VCNT","VUADDLV"
// s390x:"POPCNT"