1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00

Merge the SystemZ subreg_even32 SubRegIndex into subreg_32bit. The SubRegIndices

were overspecified when inheriting sub-subregisters, for instance:

R0Q:subreg_even32 = R0Q:subreg_32bit = R0Q:subreg_even:subreg_32bit.

This meant that composeSubRegIndices(subreg_even, subreg_32bit) was ambiguous.

llvm-svn: 105063
This commit is contained in:
Jakob Stoklund Olesen 2010-05-28 23:48:29 +00:00
parent 849bca1ab6
commit b3539aa611
4 changed files with 9 additions and 11 deletions

View File

@ -124,7 +124,7 @@ void SystemZAsmPrinter::printOperand(const MachineInstr *MI, int OpNum,
unsigned Reg = MO.getReg(); unsigned Reg = MO.getReg();
if (Modifier && strncmp(Modifier, "subreg", 6) == 0) { if (Modifier && strncmp(Modifier, "subreg", 6) == 0) {
if (strncmp(Modifier + 7, "even", 4) == 0) if (strncmp(Modifier + 7, "even", 4) == 0)
Reg = TM.getRegisterInfo()->getSubReg(Reg, SystemZ::subreg_even32); Reg = TM.getRegisterInfo()->getSubReg(Reg, SystemZ::subreg_32bit);
else if (strncmp(Modifier + 7, "odd", 3) == 0) else if (strncmp(Modifier + 7, "odd", 3) == 0)
Reg = TM.getRegisterInfo()->getSubReg(Reg, SystemZ::subreg_odd32); Reg = TM.getRegisterInfo()->getSubReg(Reg, SystemZ::subreg_odd32);
else else

View File

@ -670,7 +670,7 @@ SDNode *SystemZDAGToDAGISel::Select(SDNode *Node) {
// Copy the remainder (even subreg) result, if it is needed. // Copy the remainder (even subreg) result, if it is needed.
if (!SDValue(Node, 1).use_empty()) { if (!SDValue(Node, 1).use_empty()) {
unsigned SubRegIdx = (is32Bit ? unsigned SubRegIdx = (is32Bit ?
SystemZ::subreg_even32 : SystemZ::subreg_even); SystemZ::subreg_32bit : SystemZ::subreg_even);
SDNode *Rem = CurDAG->getMachineNode(TargetOpcode::EXTRACT_SUBREG, SDNode *Rem = CurDAG->getMachineNode(TargetOpcode::EXTRACT_SUBREG,
dl, NVT, dl, NVT,
SDValue(Result, 0), SDValue(Result, 0),
@ -754,7 +754,7 @@ SDNode *SystemZDAGToDAGISel::Select(SDNode *Node) {
// Copy the remainder (even subreg) result, if it is needed. // Copy the remainder (even subreg) result, if it is needed.
if (!SDValue(Node, 1).use_empty()) { if (!SDValue(Node, 1).use_empty()) {
unsigned SubRegIdx = (is32Bit ? unsigned SubRegIdx = (is32Bit ?
SystemZ::subreg_even32 : SystemZ::subreg_even); SystemZ::subreg_32bit : SystemZ::subreg_even);
SDNode *Rem = CurDAG->getMachineNode(TargetOpcode::EXTRACT_SUBREG, SDNode *Rem = CurDAG->getMachineNode(TargetOpcode::EXTRACT_SUBREG,
dl, NVT, dl, NVT,
SDValue(Result, 0), SDValue(Result, 0),

View File

@ -1129,13 +1129,13 @@ def : Pat<(mulhs GR32:$src1, GR32:$src2),
(EXTRACT_SUBREG (MUL64rrP (INSERT_SUBREG (v2i32 (IMPLICIT_DEF)), (EXTRACT_SUBREG (MUL64rrP (INSERT_SUBREG (v2i32 (IMPLICIT_DEF)),
GR32:$src1, subreg_odd32), GR32:$src1, subreg_odd32),
GR32:$src2), GR32:$src2),
subreg_even32)>; subreg_32bit)>;
def : Pat<(mulhu GR32:$src1, GR32:$src2), def : Pat<(mulhu GR32:$src1, GR32:$src2),
(EXTRACT_SUBREG (UMUL64rrP (INSERT_SUBREG (v2i32 (IMPLICIT_DEF)), (EXTRACT_SUBREG (UMUL64rrP (INSERT_SUBREG (v2i32 (IMPLICIT_DEF)),
GR32:$src1, subreg_odd32), GR32:$src1, subreg_odd32),
GR32:$src2), GR32:$src2),
subreg_even32)>; subreg_32bit)>;
def : Pat<(mulhu GR64:$src1, GR64:$src2), def : Pat<(mulhu GR64:$src1, GR64:$src2),
(EXTRACT_SUBREG (UMUL128rrP (INSERT_SUBREG (v2i64 (IMPLICIT_DEF)), (EXTRACT_SUBREG (UMUL128rrP (INSERT_SUBREG (v2i64 (IMPLICIT_DEF)),
GR64:$src1, subreg_odd), GR64:$src1, subreg_odd),

View File

@ -55,7 +55,6 @@ class FPRL<bits<4> num, string n, list<Register> subregs>
let Namespace = "SystemZ" in { let Namespace = "SystemZ" in {
def subreg_32bit : SubRegIndex; def subreg_32bit : SubRegIndex;
def subreg_even32 : SubRegIndex;
def subreg_odd32 : SubRegIndex; def subreg_odd32 : SubRegIndex;
def subreg_even : SubRegIndex; def subreg_even : SubRegIndex;
def subreg_odd : SubRegIndex; def subreg_odd : SubRegIndex;
@ -99,7 +98,7 @@ def R15D : GPR64<15, "r15", [R15W]>, DwarfRegNum<[15]>;
} }
// Register pairs // Register pairs
let SubRegIndices = [subreg_even32, subreg_odd32] in { let SubRegIndices = [subreg_32bit, subreg_odd32] in {
def R0P : GPR64< 0, "r0", [R0W, R1W], [R0D, R1D]>, DwarfRegNum<[0]>; def R0P : GPR64< 0, "r0", [R0W, R1W], [R0D, R1D]>, DwarfRegNum<[0]>;
def R2P : GPR64< 2, "r2", [R2W, R3W], [R2D, R3D]>, DwarfRegNum<[2]>; def R2P : GPR64< 2, "r2", [R2W, R3W], [R2D, R3D]>, DwarfRegNum<[2]>;
def R4P : GPR64< 4, "r4", [R4W, R5W], [R4D, R5D]>, DwarfRegNum<[4]>; def R4P : GPR64< 4, "r4", [R4W, R5W], [R4D, R5D]>, DwarfRegNum<[4]>;
@ -111,8 +110,7 @@ def R14P : GPR64<14, "r14", [R14W, R15W], [R14D, R15D]>, DwarfRegNum<[14]>;
} }
let SubRegIndices = [subreg_even, subreg_odd], let SubRegIndices = [subreg_even, subreg_odd],
CompositeIndices = [(subreg_even32 subreg_even, subreg_32bit), CompositeIndices = [(subreg_odd32 subreg_odd, subreg_32bit)] in {
(subreg_odd32 subreg_odd, subreg_32bit)] in {
def R0Q : GPR128< 0, "r0", [R0D, R1D], [R0P]>, DwarfRegNum<[0]>; def R0Q : GPR128< 0, "r0", [R0D, R1D], [R0P]>, DwarfRegNum<[0]>;
def R2Q : GPR128< 2, "r2", [R2D, R3D], [R2P]>, DwarfRegNum<[2]>; def R2Q : GPR128< 2, "r2", [R2D, R3D], [R2P]>, DwarfRegNum<[2]>;
def R4Q : GPR128< 4, "r4", [R4D, R5D], [R4P]>, DwarfRegNum<[4]>; def R4Q : GPR128< 4, "r4", [R4D, R5D], [R4P]>, DwarfRegNum<[4]>;
@ -355,7 +353,7 @@ def ADDR64 : RegisterClass<"SystemZ", [i64], 64,
def GR64P : RegisterClass<"SystemZ", [v2i32], 64, def GR64P : RegisterClass<"SystemZ", [v2i32], 64,
[R0P, R2P, R4P, R6P, R8P, R10P, R12P, R14P]> [R0P, R2P, R4P, R6P, R8P, R10P, R12P, R14P]>
{ {
let SubRegClasses = [(GR32 subreg_even32, subreg_odd32)]; let SubRegClasses = [(GR32 subreg_32bit, subreg_odd32)];
let MethodProtos = [{ let MethodProtos = [{
iterator allocation_order_begin(const MachineFunction &MF) const; iterator allocation_order_begin(const MachineFunction &MF) const;
iterator allocation_order_end(const MachineFunction &MF) const; iterator allocation_order_end(const MachineFunction &MF) const;
@ -391,7 +389,7 @@ def GR64P : RegisterClass<"SystemZ", [v2i32], 64,
def GR128 : RegisterClass<"SystemZ", [v2i64], 128, def GR128 : RegisterClass<"SystemZ", [v2i64], 128,
[R0Q, R2Q, R4Q, R6Q, R8Q, R10Q, R12Q, R14Q]> [R0Q, R2Q, R4Q, R6Q, R8Q, R10Q, R12Q, R14Q]>
{ {
let SubRegClasses = [(GR32 subreg_even32, subreg_odd32), let SubRegClasses = [(GR32 subreg_32bit, subreg_odd32),
(GR64 subreg_even, subreg_odd)]; (GR64 subreg_even, subreg_odd)];
let MethodProtos = [{ let MethodProtos = [{
iterator allocation_order_begin(const MachineFunction &MF) const; iterator allocation_order_begin(const MachineFunction &MF) const;