mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 11:42:57 +01:00
Fix predicates for Thumb co-processor instructions.
They're all Thumb2 only, not just some of them. More refactoring cleanup coming. llvm-svn: 135081
This commit is contained in:
parent
db508ece2d
commit
d3b15141b8
@ -922,13 +922,6 @@ class TIx2<bits<5> opcod1, bits<2> opcod2, bit opcod3,
|
||||
let Inst{12} = opcod3;
|
||||
}
|
||||
|
||||
// Move to/from coprocessor instructions
|
||||
class T1Cop<dag oops, dag iops, string asm, list<dag> pattern>
|
||||
: ThumbI<oops, iops, AddrModeNone, Size4Bytes, NoItinerary, asm, "", pattern>,
|
||||
Encoding, Requires<[IsThumb, HasV6]> {
|
||||
let Inst{31-28} = 0b1110;
|
||||
}
|
||||
|
||||
// BR_JT instructions
|
||||
class TJTI<dag oops, dag iops, InstrItinClass itin, string asm,
|
||||
list<dag> pattern>
|
||||
@ -1180,8 +1173,13 @@ class T2JTI<dag oops, dag iops, InstrItinClass itin,
|
||||
: Thumb2XI<oops, iops, AddrModeNone, SizeSpecial, itin, asm, "", pattern>;
|
||||
|
||||
// Move to/from coprocessor instructions
|
||||
class T1Cop<dag oops, dag iops, string asm, list<dag> pattern>
|
||||
: T2XI <oops, iops, NoItinerary, asm, pattern>, Requires<[IsThumb2]> {
|
||||
let Inst{31-28} = 0b1110;
|
||||
}
|
||||
|
||||
class T2Cop<dag oops, dag iops, string asm, list<dag> pattern>
|
||||
: T2XI<oops, iops, NoItinerary, asm, pattern>, Requires<[IsThumb2, HasV6]> {
|
||||
: T2XI<oops, iops, NoItinerary, asm, pattern>, Requires<[IsThumb2]> {
|
||||
let Inst{31-28} = 0b1111;
|
||||
}
|
||||
|
||||
|
@ -1233,100 +1233,6 @@ def tLEApcrelJT : tPseudoInst<(outs tGPR:$Rd),
|
||||
(ins i32imm:$label, nohash_imm:$id, pred:$p),
|
||||
Size2Bytes, IIC_iALUi, []>;
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Move between coprocessor and ARM core register -- for disassembly only
|
||||
//
|
||||
|
||||
class tMovRCopro<string opc, bit direction, dag oops, dag iops,
|
||||
list<dag> pattern>
|
||||
: T1Cop<oops, iops, !strconcat(opc, "\t$cop, $opc1, $Rt, $CRn, $CRm, $opc2"),
|
||||
pattern> {
|
||||
let Inst{27-24} = 0b1110;
|
||||
let Inst{20} = direction;
|
||||
let Inst{4} = 1;
|
||||
|
||||
bits<4> Rt;
|
||||
bits<4> cop;
|
||||
bits<3> opc1;
|
||||
bits<3> opc2;
|
||||
bits<4> CRm;
|
||||
bits<4> CRn;
|
||||
|
||||
let Inst{15-12} = Rt;
|
||||
let Inst{11-8} = cop;
|
||||
let Inst{23-21} = opc1;
|
||||
let Inst{7-5} = opc2;
|
||||
let Inst{3-0} = CRm;
|
||||
let Inst{19-16} = CRn;
|
||||
}
|
||||
|
||||
def tMCR : tMovRCopro<"mcr", 0 /* from ARM core register to coprocessor */,
|
||||
(outs),
|
||||
(ins p_imm:$cop, i32imm:$opc1, GPR:$Rt, c_imm:$CRn,
|
||||
c_imm:$CRm, i32imm:$opc2),
|
||||
[(int_arm_mcr imm:$cop, imm:$opc1, GPR:$Rt, imm:$CRn,
|
||||
imm:$CRm, imm:$opc2)]>;
|
||||
def tMRC : tMovRCopro<"mrc", 1 /* from coprocessor to ARM core register */,
|
||||
(outs GPR:$Rt),
|
||||
(ins p_imm:$cop, i32imm:$opc1, c_imm:$CRn, c_imm:$CRm, i32imm:$opc2),
|
||||
[]>;
|
||||
|
||||
def : Pat<(int_arm_mrc imm:$cop, imm:$opc1, imm:$CRn, imm:$CRm, imm:$opc2),
|
||||
(tMRC imm:$cop, imm:$opc1, imm:$CRn, imm:$CRm, imm:$opc2)>,
|
||||
Requires<[IsThumb, HasV6T2]>;
|
||||
|
||||
class tMovRRCopro<string opc, bit direction,
|
||||
list<dag> pattern = [/* For disassembly only */]>
|
||||
: T1Cop<(outs), (ins p_imm:$cop, i32imm:$opc1, GPR:$Rt, GPR:$Rt2, c_imm:$CRm),
|
||||
!strconcat(opc, "\t$cop, $opc1, $Rt, $Rt2, $CRm"), pattern> {
|
||||
let Inst{27-24} = 0b1100;
|
||||
let Inst{23-21} = 0b010;
|
||||
let Inst{20} = direction;
|
||||
|
||||
bits<4> Rt;
|
||||
bits<4> Rt2;
|
||||
bits<4> cop;
|
||||
bits<4> opc1;
|
||||
bits<4> CRm;
|
||||
|
||||
let Inst{15-12} = Rt;
|
||||
let Inst{19-16} = Rt2;
|
||||
let Inst{11-8} = cop;
|
||||
let Inst{7-4} = opc1;
|
||||
let Inst{3-0} = CRm;
|
||||
}
|
||||
|
||||
def tMCRR : tMovRRCopro<"mcrr", 0 /* from ARM core register to coprocessor */,
|
||||
[(int_arm_mcrr imm:$cop, imm:$opc1, GPR:$Rt, GPR:$Rt2,
|
||||
imm:$CRm)]>;
|
||||
def tMRRC : tMovRRCopro<"mrrc", 1 /* from coprocessor to ARM core register */>;
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Other Coprocessor Instructions. For disassembly only.
|
||||
//
|
||||
def tCDP : T1Cop<(outs), (ins p_imm:$cop, i32imm:$opc1,
|
||||
c_imm:$CRd, c_imm:$CRn, c_imm:$CRm, i32imm:$opc2),
|
||||
"cdp\t$cop, $opc1, $CRd, $CRn, $CRm, $opc2",
|
||||
[(int_arm_cdp imm:$cop, imm:$opc1, imm:$CRd, imm:$CRn,
|
||||
imm:$CRm, imm:$opc2)]> {
|
||||
let Inst{27-24} = 0b1110;
|
||||
|
||||
bits<4> opc1;
|
||||
bits<4> CRn;
|
||||
bits<4> CRd;
|
||||
bits<4> cop;
|
||||
bits<3> opc2;
|
||||
bits<4> CRm;
|
||||
|
||||
let Inst{3-0} = CRm;
|
||||
let Inst{4} = 0;
|
||||
let Inst{7-5} = opc2;
|
||||
let Inst{11-8} = cop;
|
||||
let Inst{15-12} = CRd;
|
||||
let Inst{19-16} = CRn;
|
||||
let Inst{23-20} = opc1;
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// TLS Instructions
|
||||
//
|
||||
|
@ -3326,9 +3326,73 @@ def t2MSR : T2SpecialReg<0b111100111000 /* op31-20 */, 0b10 /* op15-14 */,
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Move between coprocessor and ARM core register -- for disassembly only
|
||||
// Move between coprocessor and ARM core register
|
||||
//
|
||||
|
||||
class tMovRCopro<string opc, bit direction, dag oops, dag iops,
|
||||
list<dag> pattern>
|
||||
: T1Cop<oops, iops, !strconcat(opc, "\t$cop, $opc1, $Rt, $CRn, $CRm, $opc2"),
|
||||
pattern> {
|
||||
let Inst{27-24} = 0b1110;
|
||||
let Inst{20} = direction;
|
||||
let Inst{4} = 1;
|
||||
|
||||
bits<4> Rt;
|
||||
bits<4> cop;
|
||||
bits<3> opc1;
|
||||
bits<3> opc2;
|
||||
bits<4> CRm;
|
||||
bits<4> CRn;
|
||||
|
||||
let Inst{15-12} = Rt;
|
||||
let Inst{11-8} = cop;
|
||||
let Inst{23-21} = opc1;
|
||||
let Inst{7-5} = opc2;
|
||||
let Inst{3-0} = CRm;
|
||||
let Inst{19-16} = CRn;
|
||||
}
|
||||
|
||||
def tMCR : tMovRCopro<"mcr", 0 /* from ARM core register to coprocessor */,
|
||||
(outs),
|
||||
(ins p_imm:$cop, i32imm:$opc1, GPR:$Rt, c_imm:$CRn,
|
||||
c_imm:$CRm, i32imm:$opc2),
|
||||
[(int_arm_mcr imm:$cop, imm:$opc1, GPR:$Rt, imm:$CRn,
|
||||
imm:$CRm, imm:$opc2)]>;
|
||||
def tMRC : tMovRCopro<"mrc", 1 /* from coprocessor to ARM core register */,
|
||||
(outs GPR:$Rt),
|
||||
(ins p_imm:$cop, i32imm:$opc1, c_imm:$CRn, c_imm:$CRm, i32imm:$opc2),
|
||||
[]>;
|
||||
|
||||
def : Pat<(int_arm_mrc imm:$cop, imm:$opc1, imm:$CRn, imm:$CRm, imm:$opc2),
|
||||
(tMRC imm:$cop, imm:$opc1, imm:$CRn, imm:$CRm, imm:$opc2)>,
|
||||
Requires<[IsThumb, HasV6T2]>;
|
||||
|
||||
class tMovRRCopro<string opc, bit direction,
|
||||
list<dag> pattern = [/* For disassembly only */]>
|
||||
: T1Cop<(outs), (ins p_imm:$cop, i32imm:$opc1, GPR:$Rt, GPR:$Rt2, c_imm:$CRm),
|
||||
!strconcat(opc, "\t$cop, $opc1, $Rt, $Rt2, $CRm"), pattern> {
|
||||
let Inst{27-24} = 0b1100;
|
||||
let Inst{23-21} = 0b010;
|
||||
let Inst{20} = direction;
|
||||
|
||||
bits<4> Rt;
|
||||
bits<4> Rt2;
|
||||
bits<4> cop;
|
||||
bits<4> opc1;
|
||||
bits<4> CRm;
|
||||
|
||||
let Inst{15-12} = Rt;
|
||||
let Inst{19-16} = Rt2;
|
||||
let Inst{11-8} = cop;
|
||||
let Inst{7-4} = opc1;
|
||||
let Inst{3-0} = CRm;
|
||||
}
|
||||
|
||||
def tMCRR : tMovRRCopro<"mcrr", 0 /* from ARM core register to coprocessor */,
|
||||
[(int_arm_mcrr imm:$cop, imm:$opc1, GPR:$Rt, GPR:$Rt2,
|
||||
imm:$CRm)]>;
|
||||
def tMRRC : tMovRRCopro<"mrrc", 1 /* from coprocessor to ARM core register */>;
|
||||
|
||||
class t2MovRCopro<string opc, bit direction, dag oops, dag iops,
|
||||
list<dag> pattern>
|
||||
: T2Cop<oops, iops, !strconcat(opc, "\t$cop, $opc1, $Rt, $CRn, $CRm, $opc2"),
|
||||
@ -3394,9 +3458,32 @@ def t2MRRC2 : t2MovRRCopro<"mrrc2",
|
||||
1 /* from coprocessor to ARM core register */>;
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Other Coprocessor Instructions. For disassembly only.
|
||||
// Other Coprocessor Instructions.
|
||||
//
|
||||
|
||||
def tCDP : T1Cop<(outs), (ins p_imm:$cop, i32imm:$opc1,
|
||||
c_imm:$CRd, c_imm:$CRn, c_imm:$CRm, i32imm:$opc2),
|
||||
"cdp\t$cop, $opc1, $CRd, $CRn, $CRm, $opc2",
|
||||
[(int_arm_cdp imm:$cop, imm:$opc1, imm:$CRd, imm:$CRn,
|
||||
imm:$CRm, imm:$opc2)]> {
|
||||
let Inst{27-24} = 0b1110;
|
||||
|
||||
bits<4> opc1;
|
||||
bits<4> CRn;
|
||||
bits<4> CRd;
|
||||
bits<4> cop;
|
||||
bits<3> opc2;
|
||||
bits<4> CRm;
|
||||
|
||||
let Inst{3-0} = CRm;
|
||||
let Inst{4} = 0;
|
||||
let Inst{7-5} = opc2;
|
||||
let Inst{11-8} = cop;
|
||||
let Inst{15-12} = CRd;
|
||||
let Inst{19-16} = CRn;
|
||||
let Inst{23-20} = opc1;
|
||||
}
|
||||
|
||||
def t2CDP2 : T2Cop<(outs), (ins p_imm:$cop, i32imm:$opc1,
|
||||
c_imm:$CRd, c_imm:$CRn, c_imm:$CRm, i32imm:$opc2),
|
||||
"cdp2\t$cop, $opc1, $CRd, $CRn, $CRm, $opc2",
|
||||
|
@ -41,21 +41,6 @@
|
||||
@ CHECK: bkpt #2 @ encoding: [0x02,0xbe]
|
||||
bkpt #2
|
||||
|
||||
@ CHECK: mcr p7, #1, r5, c1, c1, #4 @ encoding: [0x21,0xee,0x91,0x57]
|
||||
mcr p7, #1, r5, c1, c1, #4
|
||||
|
||||
@ CHECK: mrc p14, #0, r1, c1, c2, #4 @ encoding: [0x11,0xee,0x92,0x1e]
|
||||
mrc p14, #0, r1, c1, c2, #4
|
||||
|
||||
@ CHECK: mcrr p7, #1, r5, r4, c1 @ encoding: [0x44,0xec,0x11,0x57]
|
||||
mcrr p7, #1, r5, r4, c1
|
||||
|
||||
@ CHECK: mrrc p7, #1, r5, r4, c1 @ encoding: [0x54,0xec,0x11,0x57]
|
||||
mrrc p7, #1, r5, r4, c1
|
||||
|
||||
@ CHECK: cdp p7, #1, c1, c1, c1, #4 @ encoding: [0x11,0xee,0x81,0x17]
|
||||
cdp p7, #1, c1, c1, c1, #4
|
||||
|
||||
@ CHECK: nop @ encoding: [0x00,0xbf]
|
||||
nop
|
||||
|
||||
|
@ -189,6 +189,18 @@
|
||||
@ CHECK: vmsr fpsid, r0 @ encoding: [0xe0,0xee,0x10,0x0a]
|
||||
vmsr fpsid, r0
|
||||
|
||||
@ CHECK: mcr p7, #1, r5, c1, c1, #4 @ encoding: [0x21,0xee,0x91,0x57]
|
||||
mcr p7, #1, r5, c1, c1, #4
|
||||
|
||||
@ CHECK: mrc p14, #0, r1, c1, c2, #4 @ encoding: [0x11,0xee,0x92,0x1e]
|
||||
mrc p14, #0, r1, c1, c2, #4
|
||||
|
||||
@ CHECK: mcrr p7, #1, r5, r4, c1 @ encoding: [0x44,0xec,0x11,0x57]
|
||||
mcrr p7, #1, r5, r4, c1
|
||||
|
||||
@ CHECK: mrrc p7, #1, r5, r4, c1 @ encoding: [0x54,0xec,0x11,0x57]
|
||||
mrrc p7, #1, r5, r4, c1
|
||||
|
||||
@ CHECK: mcr2 p7, #1, r5, c1, c1, #4 @ encoding: [0x21,0xfe,0x91,0x57]
|
||||
mcr2 p7, #1, r5, c1, c1, #4
|
||||
|
||||
@ -201,6 +213,9 @@
|
||||
@ CHECK: mrrc2 p7, #1, r5, r4, c1 @ encoding: [0x54,0xfc,0x11,0x57]
|
||||
mrrc2 p7, #1, r5, r4, c1
|
||||
|
||||
@ CHECK: cdp p7, #1, c1, c1, c1, #4 @ encoding: [0x11,0xee,0x81,0x17]
|
||||
cdp p7, #1, c1, c1, c1, #4
|
||||
|
||||
@ CHECK: cdp2 p7, #1, c1, c1, c1, #4 @ encoding: [0x11,0xfe,0x81,0x17]
|
||||
cdp2 p7, #1, c1, c1, c1, #4
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user