mirror of
https://github.com/golang/go.git
synced 2024-09-21 10:28:27 +00:00
[dev.regabi] cmd/asm: define g register on AMD64
Define g register as R14 on AMD64. It is not used now, but will be in later CLs. The name "R14" is still recognized. Change-Id: I9a066b15bf1051113db8c6640605e350cea397b9 Reviewed-on: https://go-review.googlesource.com/c/go/+/289195 Trust: Cherry Zhang <cherryyz@google.com> Reviewed-by: Than McIntosh <thanm@google.com>
This commit is contained in:
parent
e79c2fd428
commit
397a46a10a
@ -109,6 +109,10 @@ func archX86(linkArch *obj.LinkArch) *Arch {
|
||||
register["SB"] = RSB
|
||||
register["FP"] = RFP
|
||||
register["PC"] = RPC
|
||||
if linkArch == &x86.Linkamd64 {
|
||||
// Alias g to R14
|
||||
register["g"] = x86.REGG
|
||||
}
|
||||
// Register prefix not used on this architecture.
|
||||
|
||||
instructions := make(map[string]obj.As)
|
||||
|
@ -259,6 +259,7 @@ var amd64OperandTests = []operandTest{
|
||||
{"R15", "R15"},
|
||||
{"R8", "R8"},
|
||||
{"R9", "R9"},
|
||||
{"g", "R14"},
|
||||
{"SI", "SI"},
|
||||
{"SP", "SP"},
|
||||
{"X0", "X0"},
|
||||
|
@ -263,6 +263,7 @@ const (
|
||||
FREGRET = REG_X0
|
||||
REGSP = REG_SP
|
||||
REGCTXT = REG_DX
|
||||
REGG = REG_R14 // g register in ABIInternal
|
||||
REGEXT = REG_R15 // compiler allocates external registers R15 down
|
||||
FREGMIN = REG_X0 + 5 // first register variable
|
||||
FREGEXT = REG_X0 + 15 // first external register
|
||||
|
Loading…
Reference in New Issue
Block a user