summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoey Gouly <joey.gouly@arm.com>2013-09-17 09:54:57 +0000
committerJoey Gouly <joey.gouly@arm.com>2013-09-17 09:54:57 +0000
commitdc0de80f24a83336cb26dcb9ed1fa030142a504d (patch)
tree4f40efd44656748545e0468843631ba148954834 /lib
parent80361492ae7ea9fedbb5a55c72d4aea6a3d600b1 (diff)
downloadllvm-dc0de80f24a83336cb26dcb9ed1fa030142a504d.tar.gz
llvm-dc0de80f24a83336cb26dcb9ed1fa030142a504d.tar.bz2
llvm-dc0de80f24a83336cb26dcb9ed1fa030142a504d.tar.xz
[ARM] Fix the deprecation of MCR encodings that map to CP15{ISB,DSB,DMB}.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190862 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/ARM/ARMInstrThumb2.td3
-rw-r--r--lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp33
2 files changed, 27 insertions, 9 deletions
diff --git a/lib/Target/ARM/ARMInstrThumb2.td b/lib/Target/ARM/ARMInstrThumb2.td
index 83edf16e07..666d980574 100644
--- a/lib/Target/ARM/ARMInstrThumb2.td
+++ b/lib/Target/ARM/ARMInstrThumb2.td
@@ -4007,7 +4007,8 @@ def t2MCR : t2MovRCopro<0b1110, "mcr", 0,
(ins p_imm:$cop, imm0_7:$opc1, GPR:$Rt, c_imm:$CRn,
c_imm:$CRm, imm0_7:$opc2),
[(int_arm_mcr imm:$cop, imm:$opc1, GPR:$Rt, imm:$CRn,
- imm:$CRm, imm:$opc2)]>;
+ imm:$CRm, imm:$opc2)]>,
+ ComplexDeprecationPredicate<"MCR">;
def : t2InstAlias<"mcr${p} $cop, $opc1, $Rt, $CRn, $CRm",
(t2MCR p_imm:$cop, imm0_7:$opc1, GPR:$Rt, c_imm:$CRn,
c_imm:$CRm, 0, pred:$p)>;
diff --git a/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp b/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp
index ea5d7ba5c5..64001b489f 100644
--- a/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp
+++ b/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp
@@ -33,15 +33,32 @@ using namespace llvm;
static bool getMCRDeprecationInfo(MCInst &MI, MCSubtargetInfo &STI,
std::string &Info) {
- // Checks for the deprecated CP15ISB encoding:
- // mcr pX, #0, rX, c7, c5, #4
- if (STI.getFeatureBits() & llvm::ARM::HasV8Ops &&
+ if (STI.getFeatureBits() & llvm::ARM::HasV7Ops &&
+ (MI.getOperand(0).isImm() && MI.getOperand(0).getImm() == 15) &&
(MI.getOperand(1).isImm() && MI.getOperand(1).getImm() == 0) &&
- (MI.getOperand(3).isImm() && MI.getOperand(3).getImm() == 7) &&
- (MI.getOperand(4).isImm() && MI.getOperand(4).getImm() == 5) &&
- (MI.getOperand(5).isImm() && MI.getOperand(5).getImm() == 4)) {
- Info = "deprecated on armv8";
- return true;
+ // Checks for the deprecated CP15ISB encoding:
+ // mcr p15, #0, rX, c7, c5, #4
+ (MI.getOperand(3).isImm() && MI.getOperand(3).getImm() == 7)) {
+ if ((MI.getOperand(5).isImm() && MI.getOperand(5).getImm() == 4)) {
+ if (MI.getOperand(4).isImm() && MI.getOperand(4).getImm() == 5) {
+ Info = "deprecated since v7, use 'isb'";
+ return true;
+ }
+
+ // Checks for the deprecated CP15DSB encoding:
+ // mcr p15, #0, rX, c7, c10, #4
+ if (MI.getOperand(4).isImm() && MI.getOperand(4).getImm() == 10) {
+ Info = "deprecated since v7, use 'dsb'";
+ return true;
+ }
+ }
+ // Checks for the deprecated CP15DMB encoding:
+ // mcr p15, #0, rX, c7, c10, #5
+ if (MI.getOperand(4).isImm() && MI.getOperand(4).getImm() == 10 &&
+ (MI.getOperand(5).isImm() && MI.getOperand(5).getImm() == 5)) {
+ Info = "deprecated since v7, use 'dmb'";
+ return true;
+ }
}
return false;
}