mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-11 10:25:41 +00:00
Thumb MUL assembly parsing for 3-operand form.
Get the source register that isn't tied to the destination register correct, even when the assembly source operand order is backwards. rdar://10428630 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144322 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -3415,13 +3415,15 @@ cvtThumbMultiply(MCInst &Inst, unsigned Opcode,
|
|||||||
}
|
}
|
||||||
((ARMOperand*)Operands[3])->addRegOperands(Inst, 1);
|
((ARMOperand*)Operands[3])->addRegOperands(Inst, 1);
|
||||||
((ARMOperand*)Operands[1])->addCCOutOperands(Inst, 1);
|
((ARMOperand*)Operands[1])->addCCOutOperands(Inst, 1);
|
||||||
((ARMOperand*)Operands[4])->addRegOperands(Inst, 1);
|
// If we have a three-operand form, make sure to set Rn to be the operand
|
||||||
// If we have a three-operand form, use that, else the second source operand
|
// that isn't the same as Rd.
|
||||||
// is just the destination operand again.
|
unsigned RegOp = 4;
|
||||||
if (Operands.size() == 6)
|
if (Operands.size() == 6 &&
|
||||||
((ARMOperand*)Operands[5])->addRegOperands(Inst, 1);
|
((ARMOperand*)Operands[4])->getReg() ==
|
||||||
else
|
((ARMOperand*)Operands[3])->getReg())
|
||||||
Inst.addOperand(Inst.getOperand(0));
|
RegOp = 5;
|
||||||
|
((ARMOperand*)Operands[RegOp])->addRegOperands(Inst, 1);
|
||||||
|
Inst.addOperand(Inst.getOperand(0));
|
||||||
((ARMOperand*)Operands[2])->addCondCodeOperands(Inst, 2);
|
((ARMOperand*)Operands[2])->addCondCodeOperands(Inst, 2);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@@ -372,9 +372,11 @@ _func:
|
|||||||
@ MUL
|
@ MUL
|
||||||
@------------------------------------------------------------------------------
|
@------------------------------------------------------------------------------
|
||||||
muls r1, r2, r1
|
muls r1, r2, r1
|
||||||
|
muls r2, r2, r3
|
||||||
muls r3, r4
|
muls r3, r4
|
||||||
|
|
||||||
@ CHECK: muls r1, r2, r1 @ encoding: [0x51,0x43]
|
@ CHECK: muls r1, r2, r1 @ encoding: [0x51,0x43]
|
||||||
|
@ CHECK: muls r2, r3, r2 @ encoding: [0x5a,0x43]
|
||||||
@ CHECK: muls r3, r4, r3 @ encoding: [0x63,0x43]
|
@ CHECK: muls r3, r4, r3 @ encoding: [0x63,0x43]
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user