diff options
author | David Chase <drchase@google.com> | 2021-02-13 10:49:37 -0500 |
---|---|---|
committer | David Chase <drchase@google.com> | 2021-03-03 03:02:39 +0000 |
commit | f2df1e3c34ceb2225d0df5c9ec92d5dc9e9ba919 (patch) | |
tree | 6df5cf70ba9c5dc737d9e32a9db78626cffc6301 /src/cmd/compile/internal/ssa/expand_calls.go | |
parent | 06c72f3627ea749d8579d0d590fd715b2d5e512f (diff) | |
download | go-f2df1e3c34ceb2225d0df5c9ec92d5dc9e9ba919.tar.gz go-f2df1e3c34ceb2225d0df5c9ec92d5dc9e9ba919.zip |
cmd/compile: retrieve Args from registers
in progress; doesn't fully work until they are also passed on
register on the caller side.
For #40724.
Change-Id: I29a6680e60bdbe9d132782530214f2a2b51fb8f6
Reviewed-on: https://go-review.googlesource.com/c/go/+/293394
Trust: David Chase <drchase@google.com>
Run-TryBot: David Chase <drchase@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/cmd/compile/internal/ssa/expand_calls.go')
-rw-r--r-- | src/cmd/compile/internal/ssa/expand_calls.go | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/src/cmd/compile/internal/ssa/expand_calls.go b/src/cmd/compile/internal/ssa/expand_calls.go index 741d59258b..68fb0581f6 100644 --- a/src/cmd/compile/internal/ssa/expand_calls.go +++ b/src/cmd/compile/internal/ssa/expand_calls.go @@ -808,9 +808,9 @@ func (x *expandState) rewriteArgs(v *Value, firstArg int) *Value { } auxI := int64(i - firstArg) aRegs := aux.RegsOfArg(auxI) - aOffset := aux.OffsetOfArg(auxI) aType := aux.TypeOfArg(auxI) if a.Op == OpDereference { + aOffset := aux.OffsetOfArg(auxI) if a.MemoryArg() != m0 { x.f.Fatalf("Op...LECall and OpDereference have mismatched mem, %s and %s", v.LongString(), a.LongString()) } @@ -821,13 +821,16 @@ func (x *expandState) rewriteArgs(v *Value, firstArg int) *Value { // TODO(register args) this will be more complicated with registers in the picture. mem = x.rewriteDereference(v.Block, x.sp, a, mem, aOffset, aux.SizeOfArg(auxI), aType, pos) } else { - if x.debug { - fmt.Printf("storeArg %s, %v, %d\n", a.LongString(), aType, aOffset) - } var rc registerCursor var result *[]*Value + var aOffset int64 if len(aRegs) > 0 { result = &allResults + } else { + aOffset = aux.OffsetOfArg(auxI) + } + if x.debug { + fmt.Printf("storeArg %s, %v, %d\n", a.LongString(), aType, aOffset) } rc.init(aRegs, aux.abiInfo, result) mem = x.storeArgOrLoad(pos, v.Block, x.sp, a, mem, aType, aOffset, 0, rc) @@ -1213,8 +1216,19 @@ func expandCalls(f *Func) { pa.Offset(), frameOff, v.LongString())) } case 1: + r := pa.Registers[0] + i := f.ABISelf.FloatIndexFor(r) + // TODO seems like this has implications for debugging. How does this affect the location? + if i >= 0 { // float PR + v.Op = OpArgFloatReg + } else { + v.Op = OpArgIntReg + i = int64(r) + } + v.AuxInt = i + default: - panic(badVal("Saw unexpeanded OpArg", v)) + panic(badVal("Saw unexpanded OpArg", v)) } case OpStaticLECall: |