mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-13 13:45:16 +00:00
[MC][ARM] Fix number of operands of tMOVSr
Differential revision: https://reviews.llvm.org/D92029
This commit is contained in:
parent
a8de412f51
commit
a6a6d11c7b
@ -10309,11 +10309,14 @@ bool ARMAsmParser::processInstruction(MCInst &Inst,
|
||||
!HasWideQualifier) {
|
||||
// The operands aren't the same for tMOV[S]r... (no cc_out)
|
||||
MCInst TmpInst;
|
||||
TmpInst.setOpcode(Inst.getOperand(4).getReg() ? ARM::tMOVSr : ARM::tMOVr);
|
||||
unsigned Op = Inst.getOperand(4).getReg() ? ARM::tMOVSr : ARM::tMOVr;
|
||||
TmpInst.setOpcode(Op);
|
||||
TmpInst.addOperand(Inst.getOperand(0));
|
||||
TmpInst.addOperand(Inst.getOperand(1));
|
||||
TmpInst.addOperand(Inst.getOperand(2));
|
||||
TmpInst.addOperand(Inst.getOperand(3));
|
||||
if (Op == ARM::tMOVr) {
|
||||
TmpInst.addOperand(Inst.getOperand(2));
|
||||
TmpInst.addOperand(Inst.getOperand(3));
|
||||
}
|
||||
Inst = TmpInst;
|
||||
return true;
|
||||
}
|
||||
|
6
llvm/test/MC/ARM/tMOVSr.s
Normal file
6
llvm/test/MC/ARM/tMOVSr.s
Normal file
@ -0,0 +1,6 @@
|
||||
@ REQUIRES: asserts
|
||||
@ RUN: llvm-mc --triple=thumbv8 --debug %s 2>&1 | FileCheck %s --match-full-lines
|
||||
|
||||
@ CHECK: Changed to: <MCInst #{{[0-9]+}} tMOVSr <MCOperand Reg:{{[0-9]+}}> <MCOperand Reg:{{[0-9]+}}>>
|
||||
.text
|
||||
movs r2, r3
|
Loading…
x
Reference in New Issue
Block a user