From ecd5813639e305d55ce8c2e3517228e819d5817b Mon Sep 17 00:00:00 2001 From: "Vikram S. Adve" Date: Wed, 14 Nov 2001 18:49:45 +0000 Subject: [PATCH] Don't assume constant operand can only be in position 1! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1308 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp | 4 ++-- lib/Target/SparcV9/InstrSelection/InstrSelectionSupport.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp b/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp index c7d4260087b..853fe0f3108 100644 --- a/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp +++ b/lib/CodeGen/InstrSelection/InstrSelectionSupport.cpp @@ -333,9 +333,9 @@ FixConstantOperandsForInstr(Instruction* vmInstr, int64_t immedValue; MachineOperand::MachineOperandType opType = ChooseRegOrImmed(opValue, minstr->getOpCode(), target, - /*canUseImmed*/ (op == 1), + (target.getInstrInfo().getImmmedConstantPos(minstr->getOpCode()) == (int) op), machineRegNum, immedValue); - + if (opType == MachineOperand::MO_MachineRegister) minstr->SetMachineOperand(op, machineRegNum); else if (opType == MachineOperand::MO_VirtualRegister) diff --git a/lib/Target/SparcV9/InstrSelection/InstrSelectionSupport.cpp b/lib/Target/SparcV9/InstrSelection/InstrSelectionSupport.cpp index c7d4260087b..853fe0f3108 100644 --- a/lib/Target/SparcV9/InstrSelection/InstrSelectionSupport.cpp +++ b/lib/Target/SparcV9/InstrSelection/InstrSelectionSupport.cpp @@ -333,9 +333,9 @@ FixConstantOperandsForInstr(Instruction* vmInstr, int64_t immedValue; MachineOperand::MachineOperandType opType = ChooseRegOrImmed(opValue, minstr->getOpCode(), target, - /*canUseImmed*/ (op == 1), + (target.getInstrInfo().getImmmedConstantPos(minstr->getOpCode()) == (int) op), machineRegNum, immedValue); - + if (opType == MachineOperand::MO_MachineRegister) minstr->SetMachineOperand(op, machineRegNum); else if (opType == MachineOperand::MO_VirtualRegister) -- 2.34.1