Skip to content

Commit 258287a

Browse files
hstk30-hwsivan-shani
authored andcommitted
[ARM] Fix MRC cp10 and cp11 warning (llvm#126407)
The MRC format is MRC GPRwithAPSR:$Rt, p_imm:$cop, imm0_7:$opc1, c_imm:$CRn, c_imm:$CRm, 0, pred:$p The $cop is the second operand. Patch for llvm@b7d41a1.
1 parent 23bdd21 commit 258287a

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

llvm/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ static bool getMCRDeprecationInfo(MCInst &MI, const MCSubtargetInfo &STI,
7777
static bool getMRCDeprecationInfo(MCInst &MI, const MCSubtargetInfo &STI,
7878
std::string &Info) {
7979
if (STI.hasFeature(llvm::ARM::HasV7Ops) &&
80-
((MI.getOperand(0).isImm() && MI.getOperand(0).getImm() == 10) ||
81-
(MI.getOperand(0).isImm() && MI.getOperand(0).getImm() == 11))) {
80+
((MI.getOperand(1).isImm() && MI.getOperand(1).getImm() == 10) ||
81+
(MI.getOperand(1).isImm() && MI.getOperand(1).getImm() == 11))) {
8282
Info = "since v7, cp10 and cp11 are reserved for advanced SIMD or floating "
8383
"point instructions";
8484
return true;

llvm/test/MC/ARM/diagnostics.s

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,13 @@
172172

173173
@ p10 and p11 are reserved for NEON
174174
mcr p10, #2, r5, c1, c1, #4
175-
mcrr p11, #8, r5, r4, c1
176-
@ CHECK-WARN: warning: since v7, cp10 and cp11 are reserved for advanced SIMD or floating point instructions
177-
@ CHECK-WARN: warning: since v7, cp10 and cp11 are reserved for advanced SIMD or floating point instructions
175+
mcr p11, #2, r5, c1, c1, #4
176+
mrc p10, #7, r5, c1, c1, #0
177+
mrc p11, #7, r5, c1, c1, #0
178+
@ CHECK-ERROR-V7: warning: since v7, cp10 and cp11 are reserved for advanced SIMD or floating point instructions
179+
@ CHECK-ERROR-V7: warning: since v7, cp10 and cp11 are reserved for advanced SIMD or floating point instructions
180+
@ CHECK-ERROR-V7: warning: since v7, cp10 and cp11 are reserved for advanced SIMD or floating point instructions
181+
@ CHECK-ERROR-V7: warning: since v7, cp10 and cp11 are reserved for advanced SIMD or floating point instructions
178182

179183
@ Out of range immediate for MOV
180184
movw r9, 0x10000

0 commit comments

Comments
 (0)