Vikram S. Adve | 30764b8 | 2001-10-18 00:01:48 +0000 | [diff] [blame] | 1 | // $Id$ |
| 2 | //*************************************************************************** |
| 3 | // File: |
| 4 | // SparcInstrInfo.cpp |
| 5 | // |
| 6 | // Purpose: |
| 7 | // |
| 8 | // History: |
| 9 | // 10/15/01 - Vikram Adve - Created |
| 10 | //**************************************************************************/ |
| 11 | |
| 12 | |
| 13 | #include "SparcInternals.h" |
| 14 | #include "SparcInstrSelectionSupport.h" |
| 15 | #include "llvm/Target/Sparc.h" |
| 16 | #include "llvm/CodeGen/InstrSelection.h" |
| 17 | #include "llvm/CodeGen/InstrSelectionSupport.h" |
| 18 | #include "llvm/CodeGen/MachineInstr.h" |
Chris Lattner | cb0a120 | 2002-02-03 07:49:49 +0000 | [diff] [blame] | 19 | #include "llvm/CodeGen/MachineCodeForMethod.h" |
Vikram S. Adve | b9c3863 | 2001-11-08 04:57:53 +0000 | [diff] [blame] | 20 | #include "llvm/Method.h" |
Chris Lattner | e9bb2df | 2001-12-03 22:26:30 +0000 | [diff] [blame] | 21 | #include "llvm/ConstantVals.h" |
Vikram S. Adve | b9c3863 | 2001-11-08 04:57:53 +0000 | [diff] [blame] | 22 | #include "llvm/DerivedTypes.h" |
Vikram S. Adve | 30764b8 | 2001-10-18 00:01:48 +0000 | [diff] [blame] | 23 | |
| 24 | |
| 25 | //************************ Internal Functions ******************************/ |
| 26 | |
| 27 | |
| 28 | static inline MachineInstr* |
Vikram S. Adve | cee9d1c | 2001-12-15 00:33:36 +0000 | [diff] [blame] | 29 | CreateIntSetInstruction(int64_t C, Value* dest, |
Chris Lattner | 697954c | 2002-01-20 22:54:45 +0000 | [diff] [blame] | 30 | std::vector<TmpInstruction*>& tempVec) |
Vikram S. Adve | 30764b8 | 2001-10-18 00:01:48 +0000 | [diff] [blame] | 31 | { |
| 32 | MachineInstr* minstr; |
Vikram S. Adve | a2a7094 | 2001-10-28 21:41:46 +0000 | [diff] [blame] | 33 | uint64_t absC = (C >= 0)? C : -C; |
| 34 | if (absC > (unsigned int) ~0) |
| 35 | { // C does not fit in 32 bits |
Chris Lattner | cb0a120 | 2002-02-03 07:49:49 +0000 | [diff] [blame] | 36 | TmpInstruction* tmpReg = new TmpInstruction(Type::IntTy); |
Vikram S. Adve | a2a7094 | 2001-10-28 21:41:46 +0000 | [diff] [blame] | 37 | tempVec.push_back(tmpReg); |
| 38 | |
| 39 | minstr = new MachineInstr(SETX); |
Vikram S. Adve | e76af29 | 2002-03-18 03:09:15 +0000 | [diff] [blame^] | 40 | minstr->SetMachineOperandConst(0, MachineOperand::MO_SignExtendedImmed, C); |
| 41 | minstr->SetMachineOperandVal(1, MachineOperand::MO_VirtualRegister, tmpReg, |
Vikram S. Adve | a2a7094 | 2001-10-28 21:41:46 +0000 | [diff] [blame] | 42 | /*isdef*/ true); |
Vikram S. Adve | e76af29 | 2002-03-18 03:09:15 +0000 | [diff] [blame^] | 43 | minstr->SetMachineOperandVal(2, MachineOperand::MO_VirtualRegister,dest); |
Vikram S. Adve | a2a7094 | 2001-10-28 21:41:46 +0000 | [diff] [blame] | 44 | } |
Vikram S. Adve | cee9d1c | 2001-12-15 00:33:36 +0000 | [diff] [blame] | 45 | else |
Vikram S. Adve | 30764b8 | 2001-10-18 00:01:48 +0000 | [diff] [blame] | 46 | { |
| 47 | minstr = new MachineInstr(SETSW); |
Vikram S. Adve | e76af29 | 2002-03-18 03:09:15 +0000 | [diff] [blame^] | 48 | minstr->SetMachineOperandConst(0, MachineOperand::MO_SignExtendedImmed, C); |
| 49 | minstr->SetMachineOperandVal(1, MachineOperand::MO_VirtualRegister, dest); |
Vikram S. Adve | 30764b8 | 2001-10-18 00:01:48 +0000 | [diff] [blame] | 50 | } |
Vikram S. Adve | cee9d1c | 2001-12-15 00:33:36 +0000 | [diff] [blame] | 51 | |
| 52 | return minstr; |
| 53 | } |
| 54 | |
| 55 | static inline MachineInstr* |
| 56 | CreateUIntSetInstruction(uint64_t C, Value* dest, |
Chris Lattner | 697954c | 2002-01-20 22:54:45 +0000 | [diff] [blame] | 57 | std::vector<TmpInstruction*>& tempVec) |
Vikram S. Adve | cee9d1c | 2001-12-15 00:33:36 +0000 | [diff] [blame] | 58 | { |
| 59 | MachineInstr* minstr; |
| 60 | if (C > (unsigned int) ~0) |
| 61 | { // C does not fit in 32 bits |
Chris Lattner | cb0a120 | 2002-02-03 07:49:49 +0000 | [diff] [blame] | 62 | TmpInstruction *tmpReg = new TmpInstruction(Type::IntTy); |
Vikram S. Adve | cee9d1c | 2001-12-15 00:33:36 +0000 | [diff] [blame] | 63 | tempVec.push_back(tmpReg); |
| 64 | |
| 65 | minstr = new MachineInstr(SETX); |
Vikram S. Adve | e76af29 | 2002-03-18 03:09:15 +0000 | [diff] [blame^] | 66 | minstr->SetMachineOperandConst(0, MachineOperand::MO_SignExtendedImmed, C); |
| 67 | minstr->SetMachineOperandVal(1, MachineOperand::MO_VirtualRegister, tmpReg, |
Vikram S. Adve | cee9d1c | 2001-12-15 00:33:36 +0000 | [diff] [blame] | 68 | /*isdef*/ true); |
Vikram S. Adve | e76af29 | 2002-03-18 03:09:15 +0000 | [diff] [blame^] | 69 | minstr->SetMachineOperandVal(2, MachineOperand::MO_VirtualRegister,dest); |
Vikram S. Adve | cee9d1c | 2001-12-15 00:33:36 +0000 | [diff] [blame] | 70 | } |
Vikram S. Adve | 30764b8 | 2001-10-18 00:01:48 +0000 | [diff] [blame] | 71 | else |
| 72 | { |
| 73 | minstr = new MachineInstr(SETUW); |
Vikram S. Adve | e76af29 | 2002-03-18 03:09:15 +0000 | [diff] [blame^] | 74 | minstr->SetMachineOperandConst(0, MachineOperand::MO_UnextendedImmed, C); |
| 75 | minstr->SetMachineOperandVal(1, MachineOperand::MO_VirtualRegister, dest); |
Vikram S. Adve | 30764b8 | 2001-10-18 00:01:48 +0000 | [diff] [blame] | 76 | } |
| 77 | |
Vikram S. Adve | 30764b8 | 2001-10-18 00:01:48 +0000 | [diff] [blame] | 78 | return minstr; |
| 79 | } |
| 80 | |
| 81 | //************************* External Classes *******************************/ |
| 82 | |
| 83 | //--------------------------------------------------------------------------- |
| 84 | // class UltraSparcInstrInfo |
| 85 | // |
| 86 | // Purpose: |
| 87 | // Information about individual instructions. |
| 88 | // Most information is stored in the SparcMachineInstrDesc array above. |
| 89 | // Other information is computed on demand, and most such functions |
| 90 | // default to member functions in base class MachineInstrInfo. |
| 91 | //--------------------------------------------------------------------------- |
| 92 | |
| 93 | /*ctor*/ |
Vikram S. Adve | b9c3863 | 2001-11-08 04:57:53 +0000 | [diff] [blame] | 94 | UltraSparcInstrInfo::UltraSparcInstrInfo(const TargetMachine& tgt) |
| 95 | : MachineInstrInfo(tgt, SparcMachineInstrDesc, |
Vikram S. Adve | 30764b8 | 2001-10-18 00:01:48 +0000 | [diff] [blame] | 96 | /*descSize = */ NUM_TOTAL_OPCODES, |
| 97 | /*numRealOpCodes = */ NUM_REAL_OPCODES) |
| 98 | { |
| 99 | } |
| 100 | |
Vikram S. Adve | e76af29 | 2002-03-18 03:09:15 +0000 | [diff] [blame^] | 101 | // |
Vikram S. Adve | 30764b8 | 2001-10-18 00:01:48 +0000 | [diff] [blame] | 102 | // Create an instruction sequence to put the constant `val' into |
Chris Lattner | e9bb2df | 2001-12-03 22:26:30 +0000 | [diff] [blame] | 103 | // the virtual register `dest'. `val' may be a Constant or a |
Vikram S. Adve | 30764b8 | 2001-10-18 00:01:48 +0000 | [diff] [blame] | 104 | // GlobalValue, viz., the constant address of a global variable or function. |
| 105 | // The generated instructions are returned in `minstrVec'. |
| 106 | // Any temp. registers (TmpInstruction) created are returned in `tempVec'. |
| 107 | // |
| 108 | void |
Vikram S. Adve | e76af29 | 2002-03-18 03:09:15 +0000 | [diff] [blame^] | 109 | UltraSparcInstrInfo::CreateCodeToLoadConst(Method* method, |
| 110 | Value* val, |
| 111 | Instruction* dest, |
| 112 | std::vector<MachineInstr*>& minstrVec, |
| 113 | std::vector<TmpInstruction*>& tempVec) const |
Vikram S. Adve | 30764b8 | 2001-10-18 00:01:48 +0000 | [diff] [blame] | 114 | { |
| 115 | MachineInstr* minstr; |
| 116 | |
Chris Lattner | e9bb2df | 2001-12-03 22:26:30 +0000 | [diff] [blame] | 117 | assert(isa<Constant>(val) || isa<GlobalValue>(val) && |
Vikram S. Adve | 30764b8 | 2001-10-18 00:01:48 +0000 | [diff] [blame] | 118 | "I only know about constant values and global addresses"); |
| 119 | |
| 120 | // Use a "set" instruction for known constants that can go in an integer reg. |
| 121 | // Use a "load" instruction for all other constants, in particular, |
| 122 | // floating point constants and addresses of globals. |
| 123 | // |
| 124 | const Type* valType = val->getType(); |
| 125 | |
| 126 | if (valType->isIntegral() || valType == Type::BoolTy) |
| 127 | { |
Vikram S. Adve | cee9d1c | 2001-12-15 00:33:36 +0000 | [diff] [blame] | 128 | if (ConstantUInt* uval = dyn_cast<ConstantUInt>(val)) |
| 129 | { |
| 130 | uint64_t C = uval->getValue(); |
| 131 | minstr = CreateUIntSetInstruction(C, dest, tempVec); |
| 132 | } |
| 133 | else |
| 134 | { |
| 135 | bool isValidConstant; |
| 136 | int64_t C = GetConstantValueAsSignedInt(val, isValidConstant); |
| 137 | assert(isValidConstant && "Unrecognized constant"); |
| 138 | minstr = CreateIntSetInstruction(C, dest, tempVec); |
| 139 | } |
Vikram S. Adve | 30764b8 | 2001-10-18 00:01:48 +0000 | [diff] [blame] | 140 | minstrVec.push_back(minstr); |
| 141 | } |
| 142 | else |
| 143 | { |
| 144 | // Make an instruction sequence to load the constant, viz: |
Vikram S. Adve | a2a7094 | 2001-10-28 21:41:46 +0000 | [diff] [blame] | 145 | // SETX <addr-of-constant>, tmpReg, addrReg |
Vikram S. Adve | 30764b8 | 2001-10-18 00:01:48 +0000 | [diff] [blame] | 146 | // LOAD /*addr*/ addrReg, /*offset*/ 0, dest |
Vikram S. Adve | a2a7094 | 2001-10-28 21:41:46 +0000 | [diff] [blame] | 147 | // Only the SETX is needed if `val' is a GlobalValue, i.e,. it is |
Vikram S. Adve | 30764b8 | 2001-10-18 00:01:48 +0000 | [diff] [blame] | 148 | // itself a constant address. Otherwise, both are needed. |
| 149 | |
| 150 | Value* addrVal; |
| 151 | int64_t zeroOffset = 0; // to avoid ambiguity with (Value*) 0 |
| 152 | |
Vikram S. Adve | a2a7094 | 2001-10-28 21:41:46 +0000 | [diff] [blame] | 153 | TmpInstruction* tmpReg = |
Chris Lattner | cb0a120 | 2002-02-03 07:49:49 +0000 | [diff] [blame] | 154 | new TmpInstruction(PointerType::get(val->getType()), val); |
Vikram S. Adve | a2a7094 | 2001-10-28 21:41:46 +0000 | [diff] [blame] | 155 | tempVec.push_back(tmpReg); |
| 156 | |
Chris Lattner | e9bb2df | 2001-12-03 22:26:30 +0000 | [diff] [blame] | 157 | if (isa<Constant>(val)) |
Vikram S. Adve | 30764b8 | 2001-10-18 00:01:48 +0000 | [diff] [blame] | 158 | { |
| 159 | // Create another TmpInstruction for the hidden integer register |
| 160 | TmpInstruction* addrReg = |
Chris Lattner | cb0a120 | 2002-02-03 07:49:49 +0000 | [diff] [blame] | 161 | new TmpInstruction(PointerType::get(val->getType()), val); |
Vikram S. Adve | 30764b8 | 2001-10-18 00:01:48 +0000 | [diff] [blame] | 162 | tempVec.push_back(addrReg); |
| 163 | addrVal = addrReg; |
| 164 | } |
| 165 | else |
| 166 | addrVal = dest; |
| 167 | |
Vikram S. Adve | a2a7094 | 2001-10-28 21:41:46 +0000 | [diff] [blame] | 168 | minstr = new MachineInstr(SETX); |
Vikram S. Adve | e76af29 | 2002-03-18 03:09:15 +0000 | [diff] [blame^] | 169 | minstr->SetMachineOperandVal(0, MachineOperand::MO_PCRelativeDisp, val); |
| 170 | minstr->SetMachineOperandVal(1, MachineOperand::MO_VirtualRegister, tmpReg, |
Vikram S. Adve | a2a7094 | 2001-10-28 21:41:46 +0000 | [diff] [blame] | 171 | /*isdef*/ true); |
Vikram S. Adve | e76af29 | 2002-03-18 03:09:15 +0000 | [diff] [blame^] | 172 | minstr->SetMachineOperandVal(2, MachineOperand::MO_VirtualRegister,addrVal); |
Vikram S. Adve | 30764b8 | 2001-10-18 00:01:48 +0000 | [diff] [blame] | 173 | minstrVec.push_back(minstr); |
| 174 | |
Chris Lattner | e9bb2df | 2001-12-03 22:26:30 +0000 | [diff] [blame] | 175 | if (isa<Constant>(val)) |
Vikram S. Adve | 30764b8 | 2001-10-18 00:01:48 +0000 | [diff] [blame] | 176 | { |
Vikram S. Adve | e76af29 | 2002-03-18 03:09:15 +0000 | [diff] [blame^] | 177 | // Make sure constant is emitted to constant pool in assembly code. |
| 178 | MachineCodeForMethod& mcinfo = MachineCodeForMethod::get(method); |
| 179 | mcinfo.addToConstantPool(cast<Constant>(val)); |
| 180 | |
| 181 | // Generate the load instruction |
Vikram S. Adve | 30764b8 | 2001-10-18 00:01:48 +0000 | [diff] [blame] | 182 | minstr = new MachineInstr(ChooseLoadInstruction(val->getType())); |
Vikram S. Adve | e76af29 | 2002-03-18 03:09:15 +0000 | [diff] [blame^] | 183 | minstr->SetMachineOperandVal(0, MachineOperand::MO_VirtualRegister, |
Vikram S. Adve | 30764b8 | 2001-10-18 00:01:48 +0000 | [diff] [blame] | 184 | addrVal); |
Vikram S. Adve | e76af29 | 2002-03-18 03:09:15 +0000 | [diff] [blame^] | 185 | minstr->SetMachineOperandConst(1, MachineOperand::MO_SignExtendedImmed, |
Vikram S. Adve | 30764b8 | 2001-10-18 00:01:48 +0000 | [diff] [blame] | 186 | zeroOffset); |
Vikram S. Adve | e76af29 | 2002-03-18 03:09:15 +0000 | [diff] [blame^] | 187 | minstr->SetMachineOperandVal(2, MachineOperand::MO_VirtualRegister, |
Vikram S. Adve | 30764b8 | 2001-10-18 00:01:48 +0000 | [diff] [blame] | 188 | dest); |
| 189 | minstrVec.push_back(minstr); |
| 190 | } |
| 191 | } |
| 192 | } |
| 193 | |
| 194 | |
Vikram S. Adve | 5b6082e | 2001-11-09 02:16:40 +0000 | [diff] [blame] | 195 | // Create an instruction sequence to copy an integer value `val' |
| 196 | // to a floating point value `dest' by copying to memory and back. |
| 197 | // val must be an integral type. dest must be a Float or Double. |
Vikram S. Adve | b9c3863 | 2001-11-08 04:57:53 +0000 | [diff] [blame] | 198 | // The generated instructions are returned in `minstrVec'. |
| 199 | // Any temp. registers (TmpInstruction) created are returned in `tempVec'. |
| 200 | // |
| 201 | void |
| 202 | UltraSparcInstrInfo::CreateCodeToCopyIntToFloat(Method* method, |
Chris Lattner | 697954c | 2002-01-20 22:54:45 +0000 | [diff] [blame] | 203 | Value* val, |
| 204 | Instruction* dest, |
| 205 | std::vector<MachineInstr*>& minstrVec, |
| 206 | std::vector<TmpInstruction*>& tempVec, |
| 207 | TargetMachine& target) const |
Vikram S. Adve | b9c3863 | 2001-11-08 04:57:53 +0000 | [diff] [blame] | 208 | { |
Vikram S. Adve | 5b6082e | 2001-11-09 02:16:40 +0000 | [diff] [blame] | 209 | assert((val->getType()->isIntegral() || val->getType()->isPointerType()) |
| 210 | && "Source type must be integral"); |
Vikram S. Adve | b9c3863 | 2001-11-08 04:57:53 +0000 | [diff] [blame] | 211 | assert((dest->getType() ==Type::FloatTy || dest->getType() ==Type::DoubleTy) |
| 212 | && "Dest type must be float/double"); |
| 213 | |
Vikram S. Adve | b9c3863 | 2001-11-08 04:57:53 +0000 | [diff] [blame] | 214 | MachineCodeForMethod& mcinfo = MachineCodeForMethod::get(method); |
| 215 | int offset = mcinfo.allocateLocalVar(target, val); |
| 216 | |
Vikram S. Adve | b9c3863 | 2001-11-08 04:57:53 +0000 | [diff] [blame] | 217 | // Store instruction stores `val' to [%fp+offset]. |
Vikram S. Adve | 5b6082e | 2001-11-09 02:16:40 +0000 | [diff] [blame] | 218 | // The store and load opCodes are based on the value being copied, and |
Vikram S. Adve | b9959d8 | 2001-11-15 14:59:56 +0000 | [diff] [blame] | 219 | // they use integer and float types that accomodate the |
| 220 | // larger of the source type and the destination type: |
Vikram S. Adve | b9c3863 | 2001-11-08 04:57:53 +0000 | [diff] [blame] | 221 | // On SparcV9: int for float, long for double. |
Vikram S. Adve | 5b6082e | 2001-11-09 02:16:40 +0000 | [diff] [blame] | 222 | // |
Vikram S. Adve | b9c3863 | 2001-11-08 04:57:53 +0000 | [diff] [blame] | 223 | Type* tmpType = (dest->getType() == Type::FloatTy)? Type::IntTy |
| 224 | : Type::LongTy; |
| 225 | MachineInstr* store = new MachineInstr(ChooseStoreInstruction(tmpType)); |
Vikram S. Adve | e76af29 | 2002-03-18 03:09:15 +0000 | [diff] [blame^] | 226 | store->SetMachineOperandVal(0, MachineOperand::MO_VirtualRegister, val); |
| 227 | store->SetMachineOperandReg(1, target.getRegInfo().getFramePointer()); |
| 228 | store->SetMachineOperandConst(2, MachineOperand::MO_SignExtendedImmed, offset); |
Vikram S. Adve | b9c3863 | 2001-11-08 04:57:53 +0000 | [diff] [blame] | 229 | minstrVec.push_back(store); |
Vikram S. Adve | 30764b8 | 2001-10-18 00:01:48 +0000 | [diff] [blame] | 230 | |
Vikram S. Adve | b9c3863 | 2001-11-08 04:57:53 +0000 | [diff] [blame] | 231 | // Load instruction loads [%fp+offset] to `dest'. |
Vikram S. Adve | 5b6082e | 2001-11-09 02:16:40 +0000 | [diff] [blame] | 232 | // |
Vikram S. Adve | b9959d8 | 2001-11-15 14:59:56 +0000 | [diff] [blame] | 233 | MachineInstr* load =new MachineInstr(ChooseLoadInstruction(dest->getType())); |
Vikram S. Adve | e76af29 | 2002-03-18 03:09:15 +0000 | [diff] [blame^] | 234 | load->SetMachineOperandReg(0, target.getRegInfo().getFramePointer()); |
| 235 | load->SetMachineOperandConst(1, MachineOperand::MO_SignExtendedImmed,offset); |
| 236 | load->SetMachineOperandVal(2, MachineOperand::MO_VirtualRegister, dest); |
Vikram S. Adve | 5b6082e | 2001-11-09 02:16:40 +0000 | [diff] [blame] | 237 | minstrVec.push_back(load); |
| 238 | } |
| 239 | |
| 240 | |
| 241 | // Similarly, create an instruction sequence to copy an FP value |
| 242 | // `val' to an integer value `dest' by copying to memory and back. |
| 243 | // See the previous function for information about return values. |
| 244 | // |
| 245 | void |
| 246 | UltraSparcInstrInfo::CreateCodeToCopyFloatToInt(Method* method, |
Chris Lattner | 697954c | 2002-01-20 22:54:45 +0000 | [diff] [blame] | 247 | Value* val, |
| 248 | Instruction* dest, |
| 249 | std::vector<MachineInstr*>& minstrVec, |
| 250 | std::vector<TmpInstruction*>& tempVec, |
| 251 | TargetMachine& target) const |
Vikram S. Adve | 5b6082e | 2001-11-09 02:16:40 +0000 | [diff] [blame] | 252 | { |
| 253 | assert((val->getType() ==Type::FloatTy || val->getType() ==Type::DoubleTy) |
| 254 | && "Source type must be float/double"); |
| 255 | assert((dest->getType()->isIntegral() || dest->getType()->isPointerType()) |
| 256 | && "Dest type must be integral"); |
| 257 | |
Vikram S. Adve | 5b6082e | 2001-11-09 02:16:40 +0000 | [diff] [blame] | 258 | MachineCodeForMethod& mcinfo = MachineCodeForMethod::get(method); |
| 259 | int offset = mcinfo.allocateLocalVar(target, val); |
| 260 | |
| 261 | // Store instruction stores `val' to [%fp+offset]. |
| 262 | // The store and load opCodes are based on the value being copied, and |
| 263 | // they use the integer type that matches the source type in size: |
| 264 | // On SparcV9: int for float, long for double. |
| 265 | // |
| 266 | Type* tmpType = (val->getType() == Type::FloatTy)? Type::IntTy |
| 267 | : Type::LongTy; |
Vikram S. Adve | b9959d8 | 2001-11-15 14:59:56 +0000 | [diff] [blame] | 268 | MachineInstr* store=new MachineInstr(ChooseStoreInstruction(val->getType())); |
Vikram S. Adve | e76af29 | 2002-03-18 03:09:15 +0000 | [diff] [blame^] | 269 | store->SetMachineOperandVal(0, MachineOperand::MO_VirtualRegister, val); |
| 270 | store->SetMachineOperandReg(1, target.getRegInfo().getFramePointer()); |
| 271 | store->SetMachineOperandConst(2,MachineOperand::MO_SignExtendedImmed,offset); |
Vikram S. Adve | 5b6082e | 2001-11-09 02:16:40 +0000 | [diff] [blame] | 272 | minstrVec.push_back(store); |
| 273 | |
| 274 | // Load instruction loads [%fp+offset] to `dest'. |
Vikram S. Adve | b9c3863 | 2001-11-08 04:57:53 +0000 | [diff] [blame] | 275 | // |
| 276 | MachineInstr* load = new MachineInstr(ChooseLoadInstruction(tmpType)); |
Vikram S. Adve | e76af29 | 2002-03-18 03:09:15 +0000 | [diff] [blame^] | 277 | load->SetMachineOperandReg(0, target.getRegInfo().getFramePointer()); |
| 278 | load->SetMachineOperandConst(1, MachineOperand::MO_SignExtendedImmed, offset); |
| 279 | load->SetMachineOperandVal(2, MachineOperand::MO_VirtualRegister, dest); |
Vikram S. Adve | b9c3863 | 2001-11-08 04:57:53 +0000 | [diff] [blame] | 280 | minstrVec.push_back(load); |
| 281 | } |