diff options
| author | Tobias Klauser <tklauser@distanz.ch> | 2019-03-15 08:49:38 +0100 |
|---|---|---|
| committer | Tobias Klauser <tobias.klauser@gmail.com> | 2019-03-15 18:37:22 +0000 |
| commit | 156c830bea6795d57ef9eb9bfe66197413c00fce (patch) | |
| tree | db40d5b5fc0b950082f7f849a59daab5d48d662a /test/codegen/mathbits.go | |
| parent | d9db9e32e924a60bbfbb15cc0dd7cfaaf8a62a3b (diff) | |
| download | go-156c830bea6795d57ef9eb9bfe66197413c00fce.tar.xz | |
cmd/compile: eliminate unnecessary type conversions in TrailingZeros(16|8) for arm
This follows CL 156999 which did the same for arm64.
name old time/op new time/op delta
TrailingZeros-4 7.30ns ± 1% 7.30ns ± 0% ~ (p=0.413 n=9+9)
TrailingZeros8-4 8.32ns ± 0% 7.17ns ± 0% -13.77% (p=0.000 n=10+9)
TrailingZeros16-4 8.30ns ± 0% 7.18ns ± 0% -13.50% (p=0.000 n=9+10)
TrailingZeros32-4 6.46ns ± 1% 6.47ns ± 1% ~ (p=0.325 n=10+10)
TrailingZeros64-4 16.3ns ± 0% 16.2ns ± 0% -0.61% (p=0.000 n=7+10)
Change-Id: I7e9e1abf7e30d811aa474d272b2824ec7cbbaa98
Reviewed-on: https://go-review.googlesource.com/c/go/+/167797
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'test/codegen/mathbits.go')
| -rw-r--r-- | test/codegen/mathbits.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/codegen/mathbits.go b/test/codegen/mathbits.go index 9a4051a0ce..3d5f1f64c8 100644 --- a/test/codegen/mathbits.go +++ b/test/codegen/mathbits.go @@ -258,6 +258,7 @@ func RotateLeftVariable32(n uint32, m int) uint32 { func TrailingZeros(n uint) int { // amd64:"BSFQ","MOVL\t\\$64","CMOVQEQ" + // arm:"CLZ" // arm64:"RBIT","CLZ" // s390x:"FLOGR" // ppc64:"ANDN","POPCNTD" @@ -278,6 +279,7 @@ func TrailingZeros64(n uint64) int { func TrailingZeros32(n uint32) int { // amd64:"BTSQ\\t\\$32","BSFQ" + // arm:"CLZ" // arm64:"RBITW","CLZW" // s390x:"FLOGR","MOVWZ" // ppc64:"ANDN","POPCNTW" @@ -288,6 +290,7 @@ func TrailingZeros32(n uint32) int { func TrailingZeros16(n uint16) int { // amd64:"BSFL","BTSL\\t\\$16" + // arm:"ORR\t\\$65536","CLZ",-"MOVHU\tR" // arm64:"ORR\t\\$65536","RBITW","CLZW",-"MOVHU\tR",-"RBIT\t",-"CLZ\t" // s390x:"FLOGR","OR\t\\$65536" // ppc64:"POPCNTD","OR\\t\\$65536" @@ -298,6 +301,7 @@ func TrailingZeros16(n uint16) int { func TrailingZeros8(n uint8) int { // amd64:"BSFL","BTSL\\t\\$8" + // arm:"ORR\t\\$256","CLZ",-"MOVBU\tR" // arm64:"ORR\t\\$256","RBITW","CLZW",-"MOVBU\tR",-"RBIT\t",-"CLZ\t" // s390x:"FLOGR","OR\t\\$256" // wasm:"I64Ctz" |
