diff options
| author | Vikram S. Adve <vadve@cs.uiuc.edu> | 2002-07-10 21:49:38 +0000 |
|---|---|---|
| committer | Vikram S. Adve <vadve@cs.uiuc.edu> | 2002-07-10 21:49:38 +0000 |
| commit | a7f736eeea8cedb2b5a96148ce9174998c5bdb78 (patch) | |
| tree | e22fdb64ae109d8a39136f8790231e18ddba334a | |
| parent | 6a36c8f2b9a7cd02b2892aed2c82c935416e324f (diff) | |
| download | bcm5719-llvm-a7f736eeea8cedb2b5a96148ce9174998c5bdb78.tar.gz bcm5719-llvm-a7f736eeea8cedb2b5a96148ce9174998c5bdb78.zip | |
Added a few more methods for creating instructions.
llvm-svn: 2862
| -rw-r--r-- | llvm/include/llvm/CodeGen/InstrSelectionSupport.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/llvm/include/llvm/CodeGen/InstrSelectionSupport.h b/llvm/include/llvm/CodeGen/InstrSelectionSupport.h index bb88200172e..adfad6bd36c 100644 --- a/llvm/include/llvm/CodeGen/InstrSelectionSupport.h +++ b/llvm/include/llvm/CodeGen/InstrSelectionSupport.h @@ -115,6 +115,18 @@ Create2OperandInstr(MachineOpCode opCode, Value* argVal1, Value* argVal2) } 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) { @@ -137,6 +149,16 @@ Create2OperandInstr_SImmed(MachineOpCode opCode, } 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) { @@ -205,6 +227,17 @@ Create3OperandInstr_SImmed(MachineOpCode opCode, Value* argVal1, } 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) { |

