mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-02 22:23:10 +00:00
Move some methods out of MachineInstr into MachineOperand
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28102 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -135,8 +135,8 @@ SparcRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II) const {
|
||||
if (Offset >= -4096 && Offset <= 4095) {
|
||||
// If the offset is small enough to fit in the immediate field, directly
|
||||
// encode it.
|
||||
MI.SetMachineOperandReg(i, SP::I6);
|
||||
MI.SetMachineOperandConst(i+1, MachineOperand::MO_Immediate, Offset);
|
||||
MI.getOperand(i).ChangeToRegister(SP::I6);
|
||||
MI.getOperand(i+1).ChangeToImmediate(Offset);
|
||||
} else {
|
||||
// Otherwise, emit a G1 = SETHI %hi(offset). FIXME: it would be better to
|
||||
// scavenge a register here instead of reserving G1 all of the time.
|
||||
@@ -146,9 +146,8 @@ SparcRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II) const {
|
||||
BuildMI(*MI.getParent(), II, SP::ADDrr, 2,
|
||||
SP::G1).addReg(SP::G1).addReg(SP::I6);
|
||||
// Insert: G1+%lo(offset) into the user.
|
||||
MI.SetMachineOperandReg(i, SP::G1);
|
||||
MI.SetMachineOperandConst(i+1, MachineOperand::MO_Immediate,
|
||||
Offset & ((1 << 10)-1));
|
||||
MI.getOperand(i).ChangeToRegister(SP::G1);
|
||||
MI.getOperand(i+1).ChangeToImmediate(Offset & ((1 << 10)-1));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user