Skip to content

Commit 9ee78af

Browse files
committed
cmd/compile: intrinsify math.Sqrt on 386
It seems like all the pieces were already there, it only needed the final plumbing. Before: 0x001b 00027 (test.go:9) MOVSD X0, (SP) 0x0020 00032 (test.go:9) CALL math.Sqrt(SB) 0x0025 00037 (test.go:9) MOVSD 8(SP), X0 After: 0x0018 00024 (test.go:9) SQRTSD X0, X0 name old time/op new time/op delta Sqrt-4 4.60ns ± 2% 0.45ns ± 1% -90.33% (p=0.000 n=10+10) Change-Id: I0f623958e19e726840140bf9b495d3f3a9184b9d Reviewed-on: https://go-review.googlesource.com/96615 Run-TryBot: Alberto Donizetti <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Cherry Zhang <[email protected]>
1 parent f6c6781 commit 9ee78af

File tree

1 file changed

+1
-1
lines changed
  • src/cmd/compile/internal/gc

1 file changed

+1
-1
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -2913,7 +2913,7 @@ func init() {
29132913
func(s *state, n *Node, args []*ssa.Value) *ssa.Value {
29142914
return s.newValue1(ssa.OpSqrt, types.Types[TFLOAT64], args[0])
29152915
},
2916-
sys.AMD64, sys.ARM, sys.ARM64, sys.MIPS, sys.MIPS64, sys.PPC64, sys.S390X)
2916+
sys.I386, sys.AMD64, sys.ARM, sys.ARM64, sys.MIPS, sys.MIPS64, sys.PPC64, sys.S390X)
29172917
addF("math", "Trunc",
29182918
func(s *state, n *Node, args []*ssa.Value) *ssa.Value {
29192919
return s.newValue1(ssa.OpTrunc, types.Types[TFLOAT64], args[0])

0 commit comments

Comments
 (0)