]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.typeparams] cmd/compile: update ARM64 CALL* ops for register ABI
authorCherry Mui <cherryyz@google.com>
Sat, 29 May 2021 02:23:00 +0000 (22:23 -0400)
committerCherry Mui <cherryyz@google.com>
Tue, 1 Jun 2021 22:33:00 +0000 (22:33 +0000)
Now they take variable number of args.

Change-Id: I49c8bce9c3a403947eac03e397ae264a8f4fdd2c
Reviewed-on: https://go-review.googlesource.com/c/go/+/323929
Trust: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/ssa/gen/ARM64Ops.go
src/cmd/compile/internal/ssa/opGen.go
src/cmd/compile/internal/ssa/rewriteARM64.go

index a91ece1c9f9e2103dd178bceca5d034b34a8baf2..414c429db65cbc4d9d9f95265d088f831dfe1a68 100644 (file)
@@ -482,9 +482,9 @@ func init() {
                {name: "CSETM", argLength: 1, reg: readflags, asm: "CSETM", aux: "CCop"}, // auxint(flags) ? -1 : 0
 
                // function calls
-               {name: "CALLstatic", argLength: 1, reg: regInfo{clobbers: callerSave}, aux: "CallOff", clobberFlags: true, call: true},                                               // call static function aux.(*obj.LSym).  arg0=mem, auxint=argsize, returns mem
-               {name: "CALLclosure", argLength: 3, reg: regInfo{inputs: []regMask{gpsp, buildReg("R26"), 0}, clobbers: callerSave}, aux: "CallOff", clobberFlags: true, call: true}, // call function via closure.  arg0=codeptr, arg1=closure, arg2=mem, auxint=argsize, returns mem
-               {name: "CALLinter", argLength: 2, reg: regInfo{inputs: []regMask{gp}, clobbers: callerSave}, aux: "CallOff", clobberFlags: true, call: true},                         // call fn by pointer.  arg0=codeptr, arg1=mem, auxint=argsize, returns mem
+               {name: "CALLstatic", argLength: -1, reg: regInfo{clobbers: callerSave}, aux: "CallOff", clobberFlags: true, call: true},                                               // call static function aux.(*obj.LSym).  last arg=mem, auxint=argsize, returns mem
+               {name: "CALLclosure", argLength: -1, reg: regInfo{inputs: []regMask{gpsp, buildReg("R26"), 0}, clobbers: callerSave}, aux: "CallOff", clobberFlags: true, call: true}, // call function via closure.  arg0=codeptr, arg1=closure, last arg=mem, auxint=argsize, returns mem
+               {name: "CALLinter", argLength: -1, reg: regInfo{inputs: []regMask{gp}, clobbers: callerSave}, aux: "CallOff", clobberFlags: true, call: true},                         // call fn by pointer.  arg0=codeptr, last arg=mem, auxint=argsize, returns mem
 
                // pseudo-ops
                {name: "LoweredNilCheck", argLength: 2, reg: regInfo{inputs: []regMask{gpg}}, nilCheck: true, faultOnNilArg0: true}, // panic if arg0 is nil.  arg1=mem.
index cf31dfacf6065224958c2ef36211c93b3d409b0a..df15c2edda49450934b617ae96d7c01753dfca17 100644 (file)
@@ -20664,7 +20664,7 @@ var opcodeTable = [...]opInfo{
        {
                name:         "CALLstatic",
                auxType:      auxCallOff,
-               argLen:       1,
+               argLen:       -1,
                clobberFlags: true,
                call:         true,
                reg: regInfo{
@@ -20674,7 +20674,7 @@ var opcodeTable = [...]opInfo{
        {
                name:         "CALLclosure",
                auxType:      auxCallOff,
-               argLen:       3,
+               argLen:       -1,
                clobberFlags: true,
                call:         true,
                reg: regInfo{
@@ -20688,7 +20688,7 @@ var opcodeTable = [...]opInfo{
        {
                name:         "CALLinter",
                auxType:      auxCallOff,
-               argLen:       2,
+               argLen:       -1,
                clobberFlags: true,
                call:         true,
                reg: regInfo{
index 3cdc4d36cb5a400fbb419aa5b896074bc5243d61..debe5f2c2a6321aee7c4571836c46cb23d31f08f 100644 (file)
@@ -25997,7 +25997,7 @@ func rewriteValueARM64_OpSelectN(v *Value) bool {
                        break
                }
                call := v_0
-               if call.Op != OpARM64CALLstatic {
+               if call.Op != OpARM64CALLstatic || len(call.Args) != 1 {
                        break
                }
                sym := auxToCall(call.Aux)