From: Cherry Mui Date: Wed, 19 May 2021 22:13:45 +0000 (-0400) Subject: [dev.typeparams] cmd/compile, runtime: do not zero X15 on Plan 9 X-Git-Tag: go1.18beta1~1818^2^2~522 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=02117775d1;p=gostls13.git [dev.typeparams] cmd/compile, runtime: do not zero X15 on Plan 9 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 Run-TryBot: Cherry Mui TryBot-Result: Go Bot Reviewed-by: Than McIntosh --- diff --git a/src/cmd/compile/internal/amd64/ssa.go b/src/cmd/compile/internal/amd64/ssa.go index ca5f36e775..7e2dc41928 100644 --- a/src/cmd/compile/internal/amd64/ssa.go +++ b/src/cmd/compile/internal/amd64/ssa.go @@ -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) } diff --git a/src/runtime/asm_amd64.s b/src/runtime/asm_amd64.s index 14f29e1964..5990ce54c8 100644 --- a/src/runtime/asm_amd64.s +++ b/src/runtime/asm_amd64.s @@ -1600,7 +1600,9 @@ TEXT ·sigpanic0(SB),NOSPLIT,$0-0 #ifdef GOEXPERIMENT_regabig get_tls(R14) MOVQ g(R14), R14 +#ifndef GOOS_plan9 XORPS X15, X15 +#endif #endif JMP ·sigpanic(SB)