mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-20 11:29:24 +00:00
Added a few more methods for creating instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2862 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
cd13e7a5ee
commit
e694366259
@ -114,6 +114,18 @@ Create2OperandInstr(MachineOpCode opCode, Value* argVal1, Value* argVal2)
|
||||
return M;
|
||||
}
|
||||
|
||||
inline MachineInstr*
|
||||
Create2OperandInstr(MachineOpCode opCode,
|
||||
Value* argVal1, MachineOperand::MachineOperandType type1,
|
||||
Value* argVal2, MachineOperand::MachineOperandType type2)
|
||||
{
|
||||
MachineInstr* M = new MachineInstr(opCode);
|
||||
M->SetMachineOperandVal(0, type1, argVal1);
|
||||
M->SetMachineOperandVal(1, type2, argVal2);
|
||||
return M;
|
||||
}
|
||||
|
||||
|
||||
inline MachineInstr*
|
||||
Create2OperandInstr_UImmed(MachineOpCode opCode,
|
||||
unsigned int unextendedImmed, Value* argVal2)
|
||||
@ -136,6 +148,16 @@ Create2OperandInstr_SImmed(MachineOpCode opCode,
|
||||
return M;
|
||||
}
|
||||
|
||||
inline MachineInstr*
|
||||
Create2OperandInstr_Addr(MachineOpCode opCode,
|
||||
Value* label, Value* argVal2)
|
||||
{
|
||||
MachineInstr* M = new MachineInstr(opCode);
|
||||
M->SetMachineOperandVal(0, MachineOperand::MO_PCRelativeDisp, label);
|
||||
M->SetMachineOperandVal(1, MachineOperand::MO_VirtualRegister, argVal2);
|
||||
return M;
|
||||
}
|
||||
|
||||
inline MachineInstr*
|
||||
Create2OperandInstr_Reg(MachineOpCode opCode,
|
||||
Value* argVal1, unsigned int regNum)
|
||||
@ -204,6 +226,17 @@ Create3OperandInstr_SImmed(MachineOpCode opCode, Value* argVal1,
|
||||
return M;
|
||||
}
|
||||
|
||||
inline MachineInstr*
|
||||
Create3OperandInstr_Addr(MachineOpCode opCode, Value* argVal1,
|
||||
Value* label, Value* argVal3)
|
||||
{
|
||||
MachineInstr* M = new MachineInstr(opCode);
|
||||
M->SetMachineOperandVal(0, MachineOperand::MO_VirtualRegister, argVal1);
|
||||
M->SetMachineOperandVal(1, MachineOperand::MO_PCRelativeDisp, label);
|
||||
M->SetMachineOperandVal(2, MachineOperand::MO_VirtualRegister, argVal3);
|
||||
return M;
|
||||
}
|
||||
|
||||
inline MachineInstr*
|
||||
Create3OperandInstr_Reg(MachineOpCode opCode, Value* argVal1,
|
||||
unsigned int regNum, Value* argVal3)
|
||||
|
Loading…
Reference in New Issue
Block a user