]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.typeparams] cmd/compile, runtime: do not zero X15 on Plan 9
authorCherry Mui <cherryyz@google.com>
Wed, 19 May 2021 22:13:45 +0000 (18:13 -0400)
committerCherry Mui <cherryyz@google.com>
Thu, 20 May 2021 19:03:48 +0000 (19:03 +0000)
On Plan 9, we cannot use SSE registers in note handlers, so we
don't use X15 for zeroing (MOVOstorezero and DUFFZERO). Do not
zero X15 on Plan 9.

Change-Id: I2b083b01b27965611cb83d19afd66b383dc77846
Reviewed-on: https://go-review.googlesource.com/c/go/+/321329
Trust: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
src/cmd/compile/internal/amd64/ssa.go
src/runtime/asm_amd64.s

index ca5f36e77598c6ff54b6c3288b086f40a9f999d4..7e2dc41928f84df1bd0d81f7e23e7f99ddd427cf 100644 (file)
@@ -1005,14 +1005,18 @@ func ssaGenValue(s *ssagen.State, v *ssa.Value) {
        case ssa.OpAMD64CALLstatic:
                if buildcfg.Experiment.RegabiG && s.ABI == obj.ABI0 && v.Aux.(*ssa.AuxCall).Fn.ABI() == obj.ABIInternal {
                        // zeroing X15 when entering ABIInternal from ABI0
-                       opregreg(s, x86.AXORPS, x86.REG_X15, x86.REG_X15)
+                       if buildcfg.GOOS != "plan9" { // do not use SSE on Plan 9
+                               opregreg(s, x86.AXORPS, x86.REG_X15, x86.REG_X15)
+                       }
                        // set G register from TLS
                        getgFromTLS(s, x86.REG_R14)
                }
                s.Call(v)
                if buildcfg.Experiment.RegabiG && s.ABI == obj.ABIInternal && v.Aux.(*ssa.AuxCall).Fn.ABI() == obj.ABI0 {
                        // zeroing X15 when entering ABIInternal from ABI0
-                       opregreg(s, x86.AXORPS, x86.REG_X15, x86.REG_X15)
+                       if buildcfg.GOOS != "plan9" { // do not use SSE on Plan 9
+                               opregreg(s, x86.AXORPS, x86.REG_X15, x86.REG_X15)
+                       }
                        // set G register from TLS
                        getgFromTLS(s, x86.REG_R14)
                }
@@ -1306,7 +1310,9 @@ func ssaGenBlock(s *ssagen.State, b, next *ssa.Block) {
        case ssa.BlockRetJmp:
                if buildcfg.Experiment.RegabiG && s.ABI == obj.ABI0 && b.Aux.(*obj.LSym).ABI() == obj.ABIInternal {
                        // zeroing X15 when entering ABIInternal from ABI0
-                       opregreg(s, x86.AXORPS, x86.REG_X15, x86.REG_X15)
+                       if buildcfg.GOOS != "plan9" { // do not use SSE on Plan 9
+                               opregreg(s, x86.AXORPS, x86.REG_X15, x86.REG_X15)
+                       }
                        // set G register from TLS
                        getgFromTLS(s, x86.REG_R14)
                }
index 14f29e19647aa2d991cf623592411129ac3da14b..5990ce54c8d12716de148021e9e62a622f932ae8 100644 (file)
@@ -1600,7 +1600,9 @@ TEXT ·sigpanic0<ABIInternal>(SB),NOSPLIT,$0-0
 #ifdef GOEXPERIMENT_regabig
        get_tls(R14)
        MOVQ    g(R14), R14
+#ifndef GOOS_plan9
        XORPS   X15, X15
+#endif
 #endif
        JMP     ·sigpanic<ABIInternal>(SB)