mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-28 19:31:58 +00:00
ADDI can take several forms, including:
addi r1, r2, 0 addi r1, <frame index #n>, 0 so we must check for the second parameter being a register for this instruction to be considered a reg-to-reg copy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15244 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8790d47453
commit
3ada3e3f82
@ -40,10 +40,9 @@ bool PowerPCInstrInfo::isMoveInstr(const MachineInstr& MI,
|
|||||||
} else if (oc == PPC32::ADDI) { // addi r1, r2, 0
|
} else if (oc == PPC32::ADDI) { // addi r1, r2, 0
|
||||||
assert(MI.getNumOperands() == 3 &&
|
assert(MI.getNumOperands() == 3 &&
|
||||||
MI.getOperand(0).isRegister() &&
|
MI.getOperand(0).isRegister() &&
|
||||||
MI.getOperand(1).isRegister() &&
|
|
||||||
MI.getOperand(2).isImmediate() &&
|
MI.getOperand(2).isImmediate() &&
|
||||||
"invalid PPC32 ADDI instruction!");
|
"invalid PPC32 ADDI instruction!");
|
||||||
if (MI.getOperand(2).getImmedValue() == 0) {
|
if (MI.getOperand(1).isRegister() && MI.getOperand(2).getImmedValue()==0) {
|
||||||
sourceReg = MI.getOperand(1).getReg();
|
sourceReg = MI.getOperand(1).getReg();
|
||||||
destReg = MI.getOperand(0).getReg();
|
destReg = MI.getOperand(0).getReg();
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user