Skip to content

Commit

Permalink
Revert "cmd/compile: optimize 386's math.bits.TrailingZeros16"
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Bryan C. Mills committed Aug 28, 2019
1 parent bc92fe8 commit 372b0ee
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 22 deletions.
2 changes: 1 addition & 1 deletion src/cmd/compile/internal/gc/ssa.go
Original file line number Diff line number Diff line change
Expand Up @@ -3370,7 +3370,7 @@ func init() {
func(s *state, n *Node, args []*ssa.Value) *ssa.Value {
return s.newValue1(ssa.OpCtz16, types.Types[TINT], args[0])
},
sys.AMD64, sys.ARM, sys.I386, sys.ARM64, sys.Wasm)
sys.AMD64, sys.ARM, sys.ARM64, sys.Wasm)
addF("math/bits", "TrailingZeros16",
func(s *state, n *Node, args []*ssa.Value) *ssa.Value {
x := s.newValue1(ssa.OpZeroExt16to64, types.Types[TUINT64], args[0])
Expand Down
2 changes: 0 additions & 2 deletions src/cmd/compile/internal/ssa/gen/386.rules
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@

(Sqrt x) -> (SQRTSD x)

(Ctz16 x) -> (BSFL (ORLconst <typ.UInt32> [0x10000] x))

// Lowering extension
(SignExt8to16 x) -> (MOVBLSX x)
(SignExt8to32 x) -> (MOVBLSX x)
Expand Down
18 changes: 0 additions & 18 deletions src/cmd/compile/internal/ssa/rewrite386.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion test/codegen/mathbits.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,6 @@ func TrailingZeros32(n uint32) int {

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

0 comments on commit 372b0ee

Please sign in to comment.