Skip to content

Commit 372b0ee

Browse files
author
Bryan C. Mills
committed
Revert "cmd/compile: optimize 386's math.bits.TrailingZeros16"
This reverts CL 189277. Reason for revert: broke 32-bit builders. Updates #33902 Change-Id: Ie5f180d0371a90e5057ed578c334372e5fc3a286 Reviewed-on: https://go-review.googlesource.com/c/go/+/192097 Run-TryBot: Bryan C. Mills <[email protected]> Reviewed-by: Daniel Martí <[email protected]>
1 parent bc92fe8 commit 372b0ee

File tree

4 files changed

+1
-22
lines changed

4 files changed

+1
-22
lines changed

src/cmd/compile/internal/gc/ssa.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3370,7 +3370,7 @@ func init() {
33703370
func(s *state, n *Node, args []*ssa.Value) *ssa.Value {
33713371
return s.newValue1(ssa.OpCtz16, types.Types[TINT], args[0])
33723372
},
3373-
sys.AMD64, sys.ARM, sys.I386, sys.ARM64, sys.Wasm)
3373+
sys.AMD64, sys.ARM, sys.ARM64, sys.Wasm)
33743374
addF("math/bits", "TrailingZeros16",
33753375
func(s *state, n *Node, args []*ssa.Value) *ssa.Value {
33763376
x := s.newValue1(ssa.OpZeroExt16to64, types.Types[TUINT64], args[0])

src/cmd/compile/internal/ssa/gen/386.rules

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@
6666

6767
(Sqrt x) -> (SQRTSD x)
6868

69-
(Ctz16 x) -> (BSFL (ORLconst <typ.UInt32> [0x10000] x))
70-
7169
// Lowering extension
7270
(SignExt8to16 x) -> (MOVBLSX x)
7371
(SignExt8to32 x) -> (MOVBLSX x)

src/cmd/compile/internal/ssa/rewrite386.go

Lines changed: 0 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/codegen/mathbits.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,6 @@ func TrailingZeros32(n uint32) int {
296296

297297
func TrailingZeros16(n uint16) int {
298298
// amd64:"BSFL","BTSL\\t\\$16"
299-
// 386:"BSFL\t"
300299
// arm:"ORR\t\\$65536","CLZ",-"MOVHU\tR"
301300
// arm64:"ORR\t\\$65536","RBITW","CLZW",-"MOVHU\tR",-"RBIT\t",-"CLZ\t"
302301
// s390x:"FLOGR","OR\t\\$65536"

0 commit comments

Comments
 (0)