diff options
author | Austin Clements <austin@google.com> | 2021-03-15 16:48:54 -0400 |
---|---|---|
committer | Austin Clements <austin@google.com> | 2021-03-18 16:51:27 +0000 |
commit | eaa1ddee84cfdfbd47183b03962744fea52624f0 (patch) | |
tree | af4d26ddbbcba94950f64844141f5a9b04a56b2c /src/cmd/compile/internal/amd64 | |
parent | c71acbfe8372099877cdc989b546389b05222600 (diff) | |
download | go-eaa1ddee84cfdfbd47183b03962744fea52624f0.tar.gz go-eaa1ddee84cfdfbd47183b03962744fea52624f0.zip |
all: explode GOEXPERIMENT=regabi into 5 sub-experiments
This separates GOEXPERIMENT=regabi into five sub-experiments:
regabiwrappers, regabig, regabireflect, regabidefer, and regabiargs.
Setting GOEXPERIMENT=regabi now implies the working subset of these
(currently, regabiwrappers, regabig, and regabireflect).
This simplifies testing, helps derisk the register ABI project,
and will also help with performance comparisons.
This replaces the -abiwrap flag to the compiler and linker with
the regabiwrappers experiment.
As part of this, regabiargs now enables registers for all calls
in the compiler. Previously, this was statically disabled in
regabiEnabledForAllCompilation, but now that we can control it
independently, this isn't necessary.
For #40724.
Change-Id: I5171e60cda6789031f2ef034cc2e7c5d62459122
Reviewed-on: https://go-review.googlesource.com/c/go/+/302070
Trust: Austin Clements <austin@google.com>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: David Chase <drchase@google.com>
Diffstat (limited to 'src/cmd/compile/internal/amd64')
-rw-r--r-- | src/cmd/compile/internal/amd64/ggen.go | 4 | ||||
-rw-r--r-- | src/cmd/compile/internal/amd64/ssa.go | 16 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/cmd/compile/internal/amd64/ggen.go b/src/cmd/compile/internal/amd64/ggen.go index 14c3bd1129..259a083f75 100644 --- a/src/cmd/compile/internal/amd64/ggen.go +++ b/src/cmd/compile/internal/amd64/ggen.go @@ -85,7 +85,7 @@ func zerorange(pp *objw.Progs, p *obj.Prog, off, cnt int64, state *uint32) *obj. } p = pp.Append(p, x86.AMOVQ, obj.TYPE_REG, x86.REG_AX, 0, obj.TYPE_MEM, x86.REG_SP, off) } else if !isPlan9 && cnt <= int64(8*types.RegSize) { - if objabi.Regabi_enabled == 0 && *state&x15 == 0 { + if !objabi.Experiment.RegabiG && *state&x15 == 0 { p = pp.Append(p, x86.AXORPS, obj.TYPE_REG, x86.REG_X15, 0, obj.TYPE_REG, x86.REG_X15, 0) *state |= x15 } @@ -98,7 +98,7 @@ func zerorange(pp *objw.Progs, p *obj.Prog, off, cnt int64, state *uint32) *obj. p = pp.Append(p, x86.AMOVUPS, obj.TYPE_REG, x86.REG_X15, 0, obj.TYPE_MEM, x86.REG_SP, off+cnt-int64(16)) } } else if !isPlan9 && (cnt <= int64(128*types.RegSize)) { - if objabi.Regabi_enabled == 0 && *state&x15 == 0 { + if !objabi.Experiment.RegabiG && *state&x15 == 0 { p = pp.Append(p, x86.AXORPS, obj.TYPE_REG, x86.REG_X15, 0, obj.TYPE_REG, x86.REG_X15, 0) *state |= x15 } diff --git a/src/cmd/compile/internal/amd64/ssa.go b/src/cmd/compile/internal/amd64/ssa.go index 3798c37b34..bdd9da77b0 100644 --- a/src/cmd/compile/internal/amd64/ssa.go +++ b/src/cmd/compile/internal/amd64/ssa.go @@ -827,8 +827,8 @@ func ssaGenValue(s *ssagen.State, v *ssa.Value) { if s.ABI != obj.ABIInternal { v.Fatalf("MOVOstorezero can be only used in ABIInternal functions") } - if !(objabi.Regabi_enabled == 1 && base.Flag.ABIWrap) { - // zeroing X15 manually if wrappers are not used + if !objabi.Experiment.RegabiG { + // zero X15 manually opregreg(s, x86.AXORPS, x86.REG_X15, x86.REG_X15) } p := s.Prog(v.Op.Asm()) @@ -921,8 +921,8 @@ func ssaGenValue(s *ssagen.State, v *ssa.Value) { if s.ABI != obj.ABIInternal { v.Fatalf("MOVOconst can be only used in ABIInternal functions") } - if !(objabi.Regabi_enabled == 1 && base.Flag.ABIWrap) { - // zeroing X15 manually if wrappers are not used + if !objabi.Experiment.RegabiG { + // zero X15 manually opregreg(s, x86.AXORPS, x86.REG_X15, x86.REG_X15) } off := duffStart(v.AuxInt) @@ -1004,20 +1004,20 @@ func ssaGenValue(s *ssagen.State, v *ssa.Value) { // Closure pointer is DX. ssagen.CheckLoweredGetClosurePtr(v) case ssa.OpAMD64LoweredGetG: - if objabi.Regabi_enabled == 1 && base.Flag.ABIWrap { + if objabi.Experiment.RegabiG { v.Fatalf("LoweredGetG should not appear in new ABI") } r := v.Reg() getgFromTLS(s, r) case ssa.OpAMD64CALLstatic: - if objabi.Regabi_enabled == 1 && s.ABI == obj.ABI0 && v.Aux.(*ssa.AuxCall).Fn.ABI() == obj.ABIInternal { + if objabi.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) // set G register from TLS getgFromTLS(s, x86.REG_R14) } s.Call(v) - if objabi.Regabi_enabled == 1 && s.ABI == obj.ABIInternal && v.Aux.(*ssa.AuxCall).Fn.ABI() == obj.ABI0 { + if objabi.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) // set G register from TLS @@ -1304,7 +1304,7 @@ func ssaGenBlock(s *ssagen.State, b, next *ssa.Block) { case ssa.BlockRet: s.Prog(obj.ARET) case ssa.BlockRetJmp: - if objabi.Regabi_enabled == 1 && s.ABI == obj.ABI0 && b.Aux.(*obj.LSym).ABI() == obj.ABIInternal { + if objabi.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) // set G register from TLS |