From 0d8dae292a088c3a742f655c1787782abfe7e34c Mon Sep 17 00:00:00 2001 From: Jim Grosbach Date: Wed, 13 Jul 2011 21:17:59 +0000 Subject: [PATCH] Parameterize away the ARM T1Cop class. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135082 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/ARM/ARMInstrFormats.td | 9 ++------- lib/Target/ARM/ARMInstrThumb2.td | 16 ++++++++++------ 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/lib/Target/ARM/ARMInstrFormats.td b/lib/Target/ARM/ARMInstrFormats.td index c4b42bd85c1..45bbcd88cbd 100644 --- a/lib/Target/ARM/ARMInstrFormats.td +++ b/lib/Target/ARM/ARMInstrFormats.td @@ -1173,14 +1173,9 @@ class T2JTI; // Move to/from coprocessor instructions -class T1Cop pattern> +class T2Cop opc, dag oops, dag iops, string asm, list pattern> : T2XI , Requires<[IsThumb2]> { - let Inst{31-28} = 0b1110; -} - -class T2Cop pattern> - : T2XI, Requires<[IsThumb2]> { - let Inst{31-28} = 0b1111; + let Inst{31-28} = opc; } // Two-address instructions diff --git a/lib/Target/ARM/ARMInstrThumb2.td b/lib/Target/ARM/ARMInstrThumb2.td index 83e0b1f61cd..34ab4538b7a 100644 --- a/lib/Target/ARM/ARMInstrThumb2.td +++ b/lib/Target/ARM/ARMInstrThumb2.td @@ -3331,7 +3331,8 @@ def t2MSR : T2SpecialReg<0b111100111000 /* op31-20 */, 0b10 /* op15-14 */, class tMovRCopro pattern> - : T1Cop { let Inst{27-24} = 0b1110; let Inst{20} = direction; @@ -3369,7 +3370,8 @@ def : Pat<(int_arm_mrc imm:$cop, imm:$opc1, imm:$CRn, imm:$CRm, imm:$opc2), class tMovRRCopro pattern = [/* For disassembly only */]> - : T1Cop<(outs), (ins p_imm:$cop, i32imm:$opc1, GPR:$Rt, GPR:$Rt2, c_imm:$CRm), + : T2Cop<0b1110, (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; @@ -3395,7 +3397,8 @@ def tMRRC : tMovRRCopro<"mrrc", 1 /* from coprocessor to ARM core register */>; class t2MovRCopro pattern> - : T2Cop { let Inst{27-24} = 0b1110; let Inst{20} = direction; @@ -3431,7 +3434,8 @@ def : T2v6Pat<(int_arm_mrc2 imm:$cop, imm:$opc1, imm:$CRn, class t2MovRRCopro pattern = [/* For disassembly only */]> - : T2Cop<(outs), (ins p_imm:$cop, i32imm:$opc1, GPR:$Rt, GPR:$Rt2, c_imm:$CRm), + : T2Cop<0b1111, (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; @@ -3461,7 +3465,7 @@ def t2MRRC2 : t2MovRRCopro<"mrrc2", // Other Coprocessor Instructions. // -def tCDP : T1Cop<(outs), (ins p_imm:$cop, i32imm:$opc1, +def tCDP : T2Cop<0b1110, (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, @@ -3484,7 +3488,7 @@ def tCDP : T1Cop<(outs), (ins p_imm:$cop, i32imm:$opc1, let Inst{23-20} = opc1; } -def t2CDP2 : T2Cop<(outs), (ins p_imm:$cop, i32imm:$opc1, +def t2CDP2 : T2Cop<0b1111, (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", [(int_arm_cdp2 imm:$cop, imm:$opc1, imm:$CRd, imm:$CRn,