aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/ssa/rewriteMIPS64.go
diff options
context:
space:
mode:
authorAlberto Donizetti <alb.donizetti@gmail.com>2018-02-21 17:48:33 +0100
committerCherry Zhang <cherryyz@google.com>2018-02-21 17:34:02 +0000
commit6aeddb1b5751136d1b2c1e28c4026fb57a832c18 (patch)
treeb7a82e07c16fb75366e9fb99868c0bc40fb0df04 /src/cmd/compile/internal/ssa/rewriteMIPS64.go
parent8993e16932f58b9f1e1838d5d2bbd20e20a92e10 (diff)
downloadgo-6aeddb1b5751136d1b2c1e28c4026fb57a832c18.tar.gz
go-6aeddb1b5751136d1b2c1e28c4026fb57a832c18.zip
cmd/compile: intrinsify math.Sqrt on mips64
Fixes #24006 Change-Id: Ic1438b121fe705f9a6e3ed8340882e9dfd26ecf7 Reviewed-on: https://go-review.googlesource.com/95916 Reviewed-by: Cherry Zhang <cherryyz@google.com> Run-TryBot: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/cmd/compile/internal/ssa/rewriteMIPS64.go')
-rw-r--r--src/cmd/compile/internal/ssa/rewriteMIPS64.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/ssa/rewriteMIPS64.go b/src/cmd/compile/internal/ssa/rewriteMIPS64.go
index da76c992dd..20a84c03d2 100644
--- a/src/cmd/compile/internal/ssa/rewriteMIPS64.go
+++ b/src/cmd/compile/internal/ssa/rewriteMIPS64.go
@@ -551,6 +551,8 @@ func rewriteValueMIPS64(v *Value) bool {
return rewriteValueMIPS64_OpSignExt8to64_0(v)
case OpSlicemask:
return rewriteValueMIPS64_OpSlicemask_0(v)
+ case OpSqrt:
+ return rewriteValueMIPS64_OpSqrt_0(v)
case OpStaticCall:
return rewriteValueMIPS64_OpStaticCall_0(v)
case OpStore:
@@ -9578,6 +9580,17 @@ func rewriteValueMIPS64_OpSlicemask_0(v *Value) bool {
return true
}
}
+func rewriteValueMIPS64_OpSqrt_0(v *Value) bool {
+ // match: (Sqrt x)
+ // cond:
+ // result: (SQRTD x)
+ for {
+ x := v.Args[0]
+ v.reset(OpMIPS64SQRTD)
+ v.AddArg(x)
+ return true
+ }
+}
func rewriteValueMIPS64_OpStaticCall_0(v *Value) bool {
// match: (StaticCall [argwid] {target} mem)
// cond: