]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: add missing tail calls flag for linux/loong64
authorGuoqi Chen <chenguoqi@loongson.cn>
Tue, 28 Jun 2022 07:46:00 +0000 (15:46 +0800)
committerWayne Zuo <wdvxdr@golangcn.org>
Sat, 29 Oct 2022 03:14:03 +0000 (03:14 +0000)
Set the value of the variable tailCall to true and prevent
allocating or clobber the linker register.

Change-Id: I4ec19c67056cb99196911aa7c0054be89ab7eb8d
Reviewed-on: https://go-review.googlesource.com/c/go/+/414954
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Wayne Zuo <wdvxdr@golangcn.org>
Reviewed-by: WANG Xuerui <git@xen0n.name>
src/cmd/compile/internal/ssa/_gen/LOONG64Ops.go
src/cmd/compile/internal/ssa/opGen.go

index 2cc0f975a14ed040a69fff65ed8440f90b235fc0..5a84529192cd54569ebef1ef4f4c007d8027aa25 100644 (file)
@@ -270,7 +270,7 @@ func init() {
 
                // 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: "CALLtail", argLength: 1, reg: regInfo{clobbers: callerSave}, aux: "CallOff", clobberFlags: true, call: true},                                                 // tail call static function aux.(*obj.LSym).  arg0=mem, auxint=argsize, returns mem
+               {name: "CALLtail", argLength: 1, reg: regInfo{clobbers: callerSave}, aux: "CallOff", clobberFlags: true, call: true, tailCall: true},                                 // tail call static function aux.(*obj.LSym).  arg0=mem, auxint=argsize, returns mem
                {name: "CALLclosure", argLength: 3, reg: regInfo{inputs: []regMask{gpsp, buildReg("R29"), 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
 
index 9087815d7254784f53b6fa6c06567d0e7c1a4d26..994a0c9464e625614d0fa5e428b00fcb2dd8b538 100644 (file)
@@ -24107,6 +24107,7 @@ var opcodeTable = [...]opInfo{
                argLen:       1,
                clobberFlags: true,
                call:         true,
+               tailCall:     true,
                reg: regInfo{
                        clobbers: 4611686018426339320, // R4 R5 R6 R7 R8 R9 R10 R11 R12 R13 R14 R15 R16 R17 R18 R19 R20 g R23 R24 R25 R26 R27 R28 R29 R31 F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 F13 F14 F15 F16 F17 F18 F19 F20 F21 F22 F23 F24 F25 F26 F27 F28 F29 F30 F31
                },