1
0
mirror of https://github.com/golang/go synced 2024-11-24 05:50:13 -07:00

cmd/asm, cmd/internal/obj/mips: add an alias of RSB on mips64x

Change-Id: I724ce0a48c1aeed14267c049fa415a6fa2fffbcf
Reviewed-on: https://go-review.googlesource.com/19864
Reviewed-by: Minux Ma <minux@golang.org>
This commit is contained in:
Cherry Zhang 2016-04-27 22:17:44 -04:00 committed by Minux Ma
parent a409fb80b0
commit 8dc0444a04
4 changed files with 9 additions and 2 deletions

View File

@ -393,6 +393,9 @@ func archMips64() *Arch {
// Avoid unintentionally clobbering g using R30.
delete(register, "R30")
register["g"] = mips.REG_R30
// Avoid unintentionally clobbering RSB using R28.
delete(register, "R28")
register["RSB"] = mips.REG_R28
registerPrefix := map[string]bool{
"F": true,
"FCR": true,

View File

@ -512,7 +512,6 @@ var mips64OperandTests = []operandTest{
{"R25", "R25"},
{"R26", "R26"},
{"R27", "R27"},
{"R28", "R28"},
{"R29", "R29"},
{"R3", "R3"},
{"R31", "R31"},
@ -525,6 +524,7 @@ var mips64OperandTests = []operandTest{
{"LO", "LO"},
{"a(FP)", "a(FP)"},
{"g", "g"},
{"RSB", "RSB"},
{"ret+8(FP)", "ret+8(FP)"},
{"runtime·abort(SB)", "runtime.abort(SB)"},
{"·AddUint32(SB)", "\"\".AddUint32(SB)"},

View File

@ -187,7 +187,7 @@ const (
REGZERO = REG_R0 /* set to zero */
REGSP = REG_R29
REGSB = REG_R30
REGSB = REG_R28
REGLINK = REG_R31
REGRET = REG_R1
REGARG = -1 /* -1 disables passing the first argument in register */

View File

@ -47,6 +47,10 @@ func Rconv(r int) string {
// Special case.
return "g"
}
if r == REGSB {
// Special case.
return "RSB"
}
if REG_R0 <= r && r <= REG_R31 {
return fmt.Sprintf("R%d", r-REG_R0)
}