We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ca9ec7d commit 93b41b7Copy full SHA for 93b41b7
llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
@@ -3648,9 +3648,9 @@ bool RISCVAsmParser::validateInstruction(MCInst &Inst,
3648
MCRegister Rd2 = Inst.getOperand(1).getReg();
3649
MCRegister Rs1 = Inst.getOperand(2).getReg();
3650
// The encoding with rd1 == rd2 == rs1 is reserved for XTHead load pair.
3651
- if (Rs1 == Rd1 && Rs1 == Rd2) {
+ if (Rs1 == Rd1 || Rs1 == Rd2 || Rd1 == Rd2) {
3652
SMLoc Loc = Operands[1]->getStartLoc();
3653
- return Error(Loc, "rs1, rd1, and rd2 cannot all be the same");
+ return Error(Loc, "rs1, rd1, and rd2 cannot overlap");
3654
}
3655
3656
llvm/test/MC/RISCV/rv32xtheadmempair-invalid.s
@@ -15,6 +15,7 @@ th.lwd a3, a4, (a5), 3, 5 # CHECK: [[@LINE]]:25: error: operand must be consta
15
th.swd t3, t4, (t5), 5, 4 # CHECK: [[@LINE]]:22: error: immediate must be an integer in the range [0, 3]
16
th.swd t3, t4, (t5) # CHECK: [[@LINE]]:1: error: too few operands for instruction
17
th.swd t3, t4, (t5), 3, 5 # CHECK: [[@LINE]]:25: error: operand must be constant 3
18
-th.lwud x6, x6, (x6), 2, 3 # CHECK: [[@LINE]]:9: error: rs1, rd1, and rd2 cannot all be the same
+th.lwd x6, x7, (x7), 2, 3 # CHECK: [[@LINE]]:8: error: rs1, rd1, and rd2 cannot overlap
19
+th.lwud x6, x6, (x6), 2, 3 # CHECK: [[@LINE]]:9: error: rs1, rd1, and rd2 cannot overlap
20
th.ldd t0, t1, (t2), 2, 4 # CHECK: [[@LINE]]:1: error: instruction requires the following: RV64I Base Instruction Set{{$}}
21
th.sdd t0, t1, (t2), 2, 4 # CHECK: [[@LINE]]:1: error: instruction requires the following: RV64I Base Instruction Set{{$}}
0 commit comments