1
0
mirror of https://github.com/golang/go synced 2024-11-26 16:16:57 -07:00

cmd/compile/internal: add register info for loong64 regABI

Update #40724

Co-authored-by: Xiaolin Zhao <zhaoxiaolin@loongson.cn>
Change-Id: Ifd7d94147b01e4fc83978b53dca2bcc0ad1ac4e3
Reviewed-on: https://go-review.googlesource.com/c/go/+/521779
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: David Chase <drchase@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Meidan Li <limeidan@loongson.cn>
This commit is contained in:
Guoqi Chen 2023-08-15 19:54:51 +08:00 committed by Gopher Robot
parent 4bfed5ce74
commit ebca52eeb7
4 changed files with 8 additions and 4 deletions

View File

@ -144,6 +144,8 @@ func ssaGenValue(s *ssagen.State, v *ssa.Value) {
p.From.Type = obj.TYPE_REG p.From.Type = obj.TYPE_REG
p.From.Reg = r p.From.Reg = r
ssagen.AddrAuto(&p.To, v) ssagen.AddrAuto(&p.To, v)
case ssa.OpArgIntReg, ssa.OpArgFloatReg:
ssagen.CheckArgReg(v)
case ssa.OpLOONG64ADDV, case ssa.OpLOONG64ADDV,
ssa.OpLOONG64SUBV, ssa.OpLOONG64SUBV,
ssa.OpLOONG64AND, ssa.OpLOONG64AND,

View File

@ -476,8 +476,8 @@ func init() {
blocks: blocks, blocks: blocks,
regnames: regNamesLOONG64, regnames: regNamesLOONG64,
// TODO: support register ABI on loong64 // TODO: support register ABI on loong64
ParamIntRegNames: "R4 R5 R6 R7 R8 R9 R10 R11", ParamIntRegNames: "R4 R5 R6 R7 R8 R9 R10 R11 R12 R13 R14 R15 R16 R17 R18 R19",
ParamFloatRegNames: "F0 F1 F2 F3 F4 F5 F6 F7", ParamFloatRegNames: "F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 F13 F14 F15",
gpregmask: gp, gpregmask: gp,
fpregmask: fp, fpregmask: fp,
framepointerreg: -1, // not used framepointerreg: -1, // not used

View File

@ -283,6 +283,8 @@ func NewConfig(arch string, types Types, ctxt *obj.Link, optimize, softfloat boo
c.registers = registersLOONG64[:] c.registers = registersLOONG64[:]
c.gpRegMask = gpRegMaskLOONG64 c.gpRegMask = gpRegMaskLOONG64
c.fpRegMask = fpRegMaskLOONG64 c.fpRegMask = fpRegMaskLOONG64
// c.intParamRegs = paramIntRegLOONG64
// c.floatParamRegs = paramFloatRegLOONG64
c.FPReg = framepointerRegLOONG64 c.FPReg = framepointerRegLOONG64
c.LinkReg = linkRegLOONG64 c.LinkReg = linkRegLOONG64
c.hasGReg = true c.hasGReg = true

View File

@ -40751,8 +40751,8 @@ var registersLOONG64 = [...]Register{
{61, loong64.REG_F31, -1, "F31"}, {61, loong64.REG_F31, -1, "F31"},
{62, 0, -1, "SB"}, {62, 0, -1, "SB"},
} }
var paramIntRegLOONG64 = []int8{3, 4, 5, 6, 7, 8, 9, 10} var paramIntRegLOONG64 = []int8{3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18}
var paramFloatRegLOONG64 = []int8{30, 31, 32, 33, 34, 35, 36, 37} var paramFloatRegLOONG64 = []int8{30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45}
var gpRegMaskLOONG64 = regMask(1071644664) var gpRegMaskLOONG64 = regMask(1071644664)
var fpRegMaskLOONG64 = regMask(4611686017353646080) var fpRegMaskLOONG64 = regMask(4611686017353646080)
var specialRegMaskLOONG64 = regMask(0) var specialRegMaskLOONG64 = regMask(0)