From 156c830bea6795d57ef9eb9bfe66197413c00fce Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Fri, 15 Mar 2019 08:49:38 +0100 Subject: cmd/compile: eliminate unnecessary type conversions in TrailingZeros(16|8) for arm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 TryBot-Result: Gobot Gobot Reviewed-by: Cherry Zhang --- test/codegen/mathbits.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/codegen/mathbits.go') 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" -- cgit v1.3