// the result should be the PC within f that g will return to.
// See runtime/stubs.go for a more detailed discussion.
{name: "LoweredGetCallerPC", reg: gp01, rematerializeable: true},
- // LoweredGetCallerSP returns the SP of the caller of the current function.
- {name: "LoweredGetCallerSP", reg: gp01, rematerializeable: true},
+ // LoweredGetCallerSP returns the SP of the caller of the current function. arg0=mem
+ {name: "LoweredGetCallerSP", argLength: 1, reg: gp01, rematerializeable: true},
//arg0=ptr,arg1=mem, returns void. Faults if ptr is nil.
{name: "LoweredNilCheck", argLength: 2, reg: regInfo{inputs: []regMask{gpsp}}, clobberFlags: true, nilCheck: true, faultOnNilArg0: true},
// the result should be the PC within f that g will return to.
// See runtime/stubs.go for a more detailed discussion.
{name: "LoweredGetCallerPC", reg: gp01, rematerializeable: true},
- // LoweredGetCallerSP returns the SP of the caller of the current function.
- {name: "LoweredGetCallerSP", reg: gp01, rematerializeable: true},
+ // LoweredGetCallerSP returns the SP of the caller of the current function. arg0=mem
+ {name: "LoweredGetCallerSP", argLength: 1, reg: gp01, rematerializeable: true},
//arg0=ptr,arg1=mem, returns void. Faults if ptr is nil.
{name: "LoweredNilCheck", argLength: 2, reg: regInfo{inputs: []regMask{gpsp}}, clobberFlags: true, nilCheck: true, faultOnNilArg0: true},
// LoweredWB invokes runtime.gcWriteBarrier. arg0=destptr, arg1=srcptr, arg2=mem, aux=runtime.gcWriteBarrier
// use of R26 (arm64.REGCTXT, the closure pointer)
{name: "LoweredGetClosurePtr", reg: regInfo{outputs: []regMask{buildReg("R26")}}, zeroWidth: true},
- // LoweredGetCallerSP returns the SP of the caller of the current function.
- {name: "LoweredGetCallerSP", reg: gp01, rematerializeable: true},
+ // LoweredGetCallerSP returns the SP of the caller of the current function. arg0=mem
+ {name: "LoweredGetCallerSP", argLength: 1, reg: gp01, rematerializeable: true},
// LoweredGetCallerPC evaluates to the PC to which its "caller" will return.
// I.e., if f calls g "calls" getcallerpc,
// use of R7 (arm.REGCTXT, the closure pointer)
{name: "LoweredGetClosurePtr", reg: regInfo{outputs: []regMask{buildReg("R7")}}, zeroWidth: true},
- // LoweredGetCallerSP returns the SP of the caller of the current function.
- {name: "LoweredGetCallerSP", reg: gp01, rematerializeable: true},
+ // LoweredGetCallerSP returns the SP of the caller of the current function. arg0=mem.
+ {name: "LoweredGetCallerSP", argLength: 1, reg: gp01, rematerializeable: true},
// LoweredGetCallerPC evaluates to the PC to which its "caller" will return.
// I.e., if f calls g "calls" getcallerpc,
// use of R22 (loong64.REGCTXT, the closure pointer)
{name: "LoweredGetClosurePtr", reg: regInfo{outputs: []regMask{buildReg("R29")}}, zeroWidth: true},
- // LoweredGetCallerSP returns the SP of the caller of the current function.
- {name: "LoweredGetCallerSP", reg: gp01, rematerializeable: true},
+ // LoweredGetCallerSP returns the SP of the caller of the current function. arg0=mem.
+ {name: "LoweredGetCallerSP", argLength: 1, reg: gp01, rematerializeable: true},
// LoweredGetCallerPC evaluates to the PC to which its "caller" will return.
// I.e., if f calls g "calls" getcallerpc,
// use of R22 (mips.REGCTXT, the closure pointer)
{name: "LoweredGetClosurePtr", reg: regInfo{outputs: []regMask{buildReg("R22")}}, zeroWidth: true},
- // LoweredGetCallerSP returns the SP of the caller of the current function.
- {name: "LoweredGetCallerSP", reg: gp01, rematerializeable: true},
+ // LoweredGetCallerSP returns the SP of the caller of the current function. arg0=mem.
+ {name: "LoweredGetCallerSP", argLength: 1, reg: gp01, rematerializeable: true},
// LoweredGetCallerPC evaluates to the PC to which its "caller" will return.
// I.e., if f calls g "calls" getcallerpc,
// use of R22 (mips.REGCTXT, the closure pointer)
{name: "LoweredGetClosurePtr", reg: regInfo{outputs: []regMask{buildReg("R22")}}, zeroWidth: true},
- // LoweredGetCallerSP returns the SP of the caller of the current function.
- {name: "LoweredGetCallerSP", reg: gp01, rematerializeable: true},
+ // LoweredGetCallerSP returns the SP of the caller of the current function. arg0=mem.
+ {name: "LoweredGetCallerSP", argLength: 1, reg: gp01, rematerializeable: true},
// LoweredGetCallerPC evaluates to the PC to which its "caller" will return.
// I.e., if f calls g "calls" getcallerpc,
// use of the closure pointer.
{name: "LoweredGetClosurePtr", reg: regInfo{outputs: []regMask{ctxt}}, zeroWidth: true},
- // LoweredGetCallerSP returns the SP of the caller of the current function.
- {name: "LoweredGetCallerSP", reg: gp01, rematerializeable: true},
+ // LoweredGetCallerSP returns the SP of the caller of the current function. arg0=mem.
+ {name: "LoweredGetCallerSP", argLength: 1, reg: gp01, rematerializeable: true},
// LoweredGetCallerPC evaluates to the PC to which its "caller" will return.
// I.e., if f calls g "calls" getcallerpc,
{name: "LoweredNilCheck", argLength: 2, faultOnNilArg0: true, nilCheck: true, reg: regInfo{inputs: []regMask{gpspMask}}}, // arg0=ptr,arg1=mem, returns void. Faults if ptr is nil.
{name: "LoweredGetClosurePtr", reg: regInfo{outputs: []regMask{regCtxt}}}, // scheduler ensures only at beginning of entry block
- // LoweredGetCallerSP returns the SP of the caller of the current function.
- {name: "LoweredGetCallerSP", reg: gp01, rematerializeable: true},
+ // LoweredGetCallerSP returns the SP of the caller of the current function. arg0=mem.
+ {name: "LoweredGetCallerSP", argLength: 1, reg: gp01, rematerializeable: true},
// LoweredGetCallerPC evaluates to the PC to which its "caller" will return.
// I.e., if f calls g "calls" getcallerpc,
// use of R12 (the closure pointer)
{name: "LoweredGetClosurePtr", reg: regInfo{outputs: []regMask{buildReg("R12")}}, zeroWidth: true},
// arg0=ptr,arg1=mem, returns void. Faults if ptr is nil.
- // LoweredGetCallerSP returns the SP of the caller of the current function.
- {name: "LoweredGetCallerSP", reg: gp01, rematerializeable: true},
+ // LoweredGetCallerSP returns the SP of the caller of the current function. arg0=mem.
+ {name: "LoweredGetCallerSP", argLength: 1, reg: gp01, rematerializeable: true},
// LoweredGetCallerPC evaluates to the PC to which its "caller" will return.
// I.e., if f calls g "calls" getcallerpc,
// the result should be the PC within f that g will return to.
{name: "LoweredGetClosurePtr", reg: gp01}, // returns wasm.REG_CTXT, the closure pointer
{name: "LoweredGetCallerPC", reg: gp01, rematerializeable: true}, // returns the PC of the caller of the current function
- {name: "LoweredGetCallerSP", reg: gp01, rematerializeable: true}, // returns the SP of the caller of the current function
+ {name: "LoweredGetCallerSP", argLength: 1, reg: gp01, rematerializeable: true}, // returns the SP of the caller of the current function. arg0=mem.
{name: "LoweredNilCheck", argLength: 2, reg: regInfo{inputs: []regMask{gp}}, nilCheck: true, faultOnNilArg0: true}, // panic if arg0 is nil. arg1=mem
{name: "LoweredWB", argLength: 3, reg: regInfo{inputs: []regMask{gp, gp}}, aux: "Sym", symEffect: "None"}, // invokes runtime.gcWriteBarrier. arg0=destptr, arg1=srcptr, arg2=mem, aux=runtime.gcWriteBarrier
{name: "GetG", argLength: 1, zeroWidth: true}, // runtime.getg() (read g pointer). arg0=mem
{name: "GetClosurePtr"}, // get closure pointer from dedicated register
{name: "GetCallerPC"}, // for getcallerpc intrinsic
- {name: "GetCallerSP"}, // for getcallersp intrinsic
+ {name: "GetCallerSP", argLength: 1}, // for getcallersp intrinsic. arg0=mem.
// Indexing operations
{name: "PtrIndex", argLength: 2}, // arg0=ptr, arg1=index. Computes ptr+sizeof(*v.type)*index, where index is extended to ptrwidth type
if v.Op == OpTailLECall {
// For tail call, we unwind the frame before the call so we'll use the caller's
// SP.
- sp = x.f.Entry.NewValue0(src.NoXPos, OpGetCallerSP, x.typs.Uintptr)
+ sp = x.f.Entry.NewValue1(src.NoXPos, OpGetCallerSP, x.typs.Uintptr, mem)
}
for i, a := range v.Args[firstArg : len(v.Args)-1] { // skip leading non-parameter SSA Args and trailing mem SSA Arg.
oldArgs = append(oldArgs, a)
},
{
name: "LoweredGetCallerSP",
- argLen: 0,
+ argLen: 1,
rematerializeable: true,
reg: regInfo{
outputs: []outputInfo{
},
{
name: "LoweredGetCallerSP",
- argLen: 0,
+ argLen: 1,
rematerializeable: true,
reg: regInfo{
outputs: []outputInfo{
},
{
name: "LoweredGetCallerSP",
- argLen: 0,
+ argLen: 1,
rematerializeable: true,
reg: regInfo{
outputs: []outputInfo{
},
{
name: "LoweredGetCallerSP",
- argLen: 0,
+ argLen: 1,
rematerializeable: true,
reg: regInfo{
outputs: []outputInfo{
},
{
name: "LoweredGetCallerSP",
- argLen: 0,
+ argLen: 1,
rematerializeable: true,
reg: regInfo{
outputs: []outputInfo{
},
{
name: "LoweredGetCallerSP",
- argLen: 0,
+ argLen: 1,
rematerializeable: true,
reg: regInfo{
outputs: []outputInfo{
},
{
name: "LoweredGetCallerSP",
- argLen: 0,
+ argLen: 1,
rematerializeable: true,
reg: regInfo{
outputs: []outputInfo{
},
{
name: "LoweredGetCallerSP",
- argLen: 0,
+ argLen: 1,
rematerializeable: true,
reg: regInfo{
outputs: []outputInfo{
},
{
name: "LoweredGetCallerSP",
- argLen: 0,
+ argLen: 1,
rematerializeable: true,
reg: regInfo{
outputs: []outputInfo{
},
{
name: "LoweredGetCallerSP",
- argLen: 0,
+ argLen: 1,
rematerializeable: true,
reg: regInfo{
outputs: []outputInfo{
},
{
name: "LoweredGetCallerSP",
- argLen: 0,
+ argLen: 1,
rematerializeable: true,
reg: regInfo{
outputs: []outputInfo{
},
{
name: "GetCallerSP",
- argLen: 0,
+ argLen: 1,
generic: true,
},
{
case ir.OGETCALLERSP:
n := n.(*ir.CallExpr)
- return s.newValue0(ssa.OpGetCallerSP, n.Type())
+ return s.newValue1(ssa.OpGetCallerSP, n.Type(), s.mem())
case ir.OAPPEND:
return s.append(n.(*ir.CallExpr), false)
add("runtime", "getcallersp",
func(s *state, n *ir.CallExpr, args []*ssa.Value) *ssa.Value {
- return s.newValue0(ssa.OpGetCallerSP, s.f.Config.Types.Uintptr)
+ return s.newValue1(ssa.OpGetCallerSP, s.f.Config.Types.Uintptr, s.mem())
},
all...)