mirror of
https://github.com/golang/go.git
synced 2025-10-19 19:13:18 +00:00
cmd/compile: intrinsify math.Sqrt when compiling "math" itself
Fixes #17354. Change-Id: I0e018c8c3e791fc6cc1925dbbc18c2151ba9a111 Reviewed-on: https://go-review.googlesource.com/30539 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
parent
4f3a641e6e
commit
8aadcc551e
1 changed files with 2 additions and 1 deletions
|
@ -693,7 +693,8 @@ opswitch:
|
||||||
n.Left = walkexpr(n.Left, init)
|
n.Left = walkexpr(n.Left, init)
|
||||||
walkexprlist(n.List.Slice(), init)
|
walkexprlist(n.List.Slice(), init)
|
||||||
|
|
||||||
if n.Left.Op == ONAME && n.Left.Sym.Name == "Sqrt" && n.Left.Sym.Pkg.Path == "math" {
|
if n.Left.Op == ONAME && n.Left.Sym.Name == "Sqrt" &&
|
||||||
|
(n.Left.Sym.Pkg.Path == "math" || n.Left.Sym.Pkg == localpkg && myimportpath == "math") {
|
||||||
if Thearch.LinkArch.InFamily(sys.AMD64, sys.ARM, sys.ARM64, sys.PPC64, sys.S390X) {
|
if Thearch.LinkArch.InFamily(sys.AMD64, sys.ARM, sys.ARM64, sys.PPC64, sys.S390X) {
|
||||||
n.Op = OSQRT
|
n.Op = OSQRT
|
||||||
n.Left = n.List.First()
|
n.Left = n.List.First()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue