]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: optimize 386's math.bits.TrailingZeros16
authorBen Shi <powerman1st@163.com>
Wed, 7 Aug 2019 05:20:32 +0000 (05:20 +0000)
committerBen Shi <powerman1st@163.com>
Wed, 28 Aug 2019 02:29:54 +0000 (02:29 +0000)
commit22355d6cd2421f13e560f90e77ca04ef816456da
tree3ed677893926c8f3bbc21e2962d23ac517a31c70
parente1e4c499f0849af4fca353163e4ffabbda6f9089
cmd/compile: optimize 386's math.bits.TrailingZeros16

This CL optimizes math.bits.TrailingZeros16 on 386 with
a pair of BSFL and ORL instrcutions.

The case TrailingZeros16-4 of the benchmark test in
math/bits shows big improvement.
name               old time/op  new time/op  delta
TrailingZeros16-4  1.55ns ± 1%  0.87ns ± 1%  -43.87%  (p=0.000 n=50+49)

Change-Id: Ia899975b0e46f45dcd20223b713ed632bc32740b
Reviewed-on: https://go-review.googlesource.com/c/go/+/189277
Run-TryBot: Ben Shi <powerman1st@163.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/gc/ssa.go
src/cmd/compile/internal/ssa/gen/386.rules
src/cmd/compile/internal/ssa/rewrite386.go
test/codegen/mathbits.go