[Sparc] Use HWEncoding instead of unused Num field in Sparc register definitions. Also, correct the definitions of RETL and RET instructions.

llvm-svn: 188738
This commit is contained in:
Venkatraman Govindaraju 2013-08-20 01:26:14 +00:00
parent 0eaf10bc94
commit f625773bca
2 changed files with 9 additions and 12 deletions

View File

@ -286,11 +286,11 @@ let usesCustomInserter = 1, Uses = [FCC] in {
// Section A.3 - Synthetic Instructions, p. 85
// special cases of JMPL:
let isReturn = 1, isTerminator = 1, hasDelaySlot = 1, isBarrier = 1 in {
let rd = O7.Num, rs1 = G0.Num in
let rd = 0, rs1 = 15 in
def RETL: F3_2<2, 0b111000, (outs), (ins i32imm:$val),
"jmp %o7+$val", [(retflag simm13:$val)]>;
let rd = I7.Num, rs1 = G0.Num in
let rd = 0, rs1 = 31 in
def RET: F3_2<2, 0b111000, (outs), (ins i32imm:$val),
"jmp %i7+$val", []>;
}

View File

@ -11,8 +11,8 @@
// Declarations that describe the Sparc register file
//===----------------------------------------------------------------------===//
class SparcReg<string n> : Register<n> {
field bits<5> Num;
class SparcReg<bits<16> Enc, string n> : Register<n> {
let HWEncoding = Enc;
let Namespace = "SP";
}
@ -27,16 +27,13 @@ def sub_odd : SubRegIndex<32, 32>;
// Registers are identified with 5-bit ID numbers.
// Ri - 32-bit integer registers
class Ri<bits<5> num, string n> : SparcReg<n> {
let Num = num;
}
class Ri<bits<16> Enc, string n> : SparcReg<Enc, n>;
// Rf - 32-bit floating-point registers
class Rf<bits<5> num, string n> : SparcReg<n> {
let Num = num;
}
class Rf<bits<16> Enc, string n> : SparcReg<Enc, n>;
// Rd - Slots in the FP register file for 64-bit floating-point values.
class Rd<bits<5> num, string n, list<Register> subregs> : SparcReg<n> {
let Num = num;
class Rd<bits<16> Enc, string n, list<Register> subregs> : SparcReg<Enc, n> {
let SubRegs = subregs;
let SubRegIndices = [sub_even, sub_odd];
let CoveredBySubRegs = 1;