| OLD | NEW |
| 1 //===- subzero/src/IceTargetLoweringX8632.cpp - x86-32 lowering -----------===// | 1 //===- subzero/src/IceTargetLoweringX8632.cpp - x86-32 lowering -----------===// |
| 2 // | 2 // |
| 3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
| 4 // | 4 // |
| 5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 // | 9 // |
| 10 // This file implements the TargetLoweringX8632 class, which | 10 // This file implements the TargetLoweringX8632 class, which |
| (...skipping 1263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1274 // being somewhat clumsy in the current IR, so we use a | 1274 // being somewhat clumsy in the current IR, so we use a |
| 1275 // workaround. Force the operand into a (xmm) register, and | 1275 // workaround. Force the operand into a (xmm) register, and |
| 1276 // then push the register. An xmm register push is actually not | 1276 // then push the register. An xmm register push is actually not |
| 1277 // possible in x86, but the Push instruction emitter handles | 1277 // possible in x86, but the Push instruction emitter handles |
| 1278 // this by decrementing the stack pointer and directly writing | 1278 // this by decrementing the stack pointer and directly writing |
| 1279 // the xmm register value. | 1279 // the xmm register value. |
| 1280 Variable *T = NULL; | 1280 Variable *T = NULL; |
| 1281 _mov(T, Arg); | 1281 _mov(T, Arg); |
| 1282 _push(T); | 1282 _push(T); |
| 1283 } else { | 1283 } else { |
| 1284 // Otherwise PNaCl requires parameter types to be at least 32-bits. |
| 1285 assert(Arg->getType() == IceType_f32 || Arg->getType() == IceType_i32); |
| 1284 _push(Arg); | 1286 _push(Arg); |
| 1285 } | 1287 } |
| 1286 StackOffset += typeWidthInBytesOnStack(Arg->getType()); | 1288 StackOffset += typeWidthInBytesOnStack(Arg->getType()); |
| 1287 } | 1289 } |
| 1288 // Generate the call instruction. Assign its result to a temporary | 1290 // Generate the call instruction. Assign its result to a temporary |
| 1289 // with high register allocation weight. | 1291 // with high register allocation weight. |
| 1290 Variable *Dest = Instr->getDest(); | 1292 Variable *Dest = Instr->getDest(); |
| 1291 Variable *eax = NULL; // doubles as RegLo as necessary | 1293 Variable *eax = NULL; // doubles as RegLo as necessary |
| 1292 Variable *edx = NULL; | 1294 Variable *edx = NULL; |
| 1293 if (Dest) { | 1295 if (Dest) { |
| (...skipping 973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2267 // llvm-mc doesn't parse "dword ptr [.L$foo]". | 2269 // llvm-mc doesn't parse "dword ptr [.L$foo]". |
| 2268 Str << "dword ptr [L$" << IceType_f32 << "$" << getPoolEntryID() << "]"; | 2270 Str << "dword ptr [L$" << IceType_f32 << "$" << getPoolEntryID() << "]"; |
| 2269 } | 2271 } |
| 2270 | 2272 |
| 2271 template <> void ConstantDouble::emit(GlobalContext *Ctx) const { | 2273 template <> void ConstantDouble::emit(GlobalContext *Ctx) const { |
| 2272 Ostream &Str = Ctx->getStrEmit(); | 2274 Ostream &Str = Ctx->getStrEmit(); |
| 2273 Str << "qword ptr [L$" << IceType_f64 << "$" << getPoolEntryID() << "]"; | 2275 Str << "qword ptr [L$" << IceType_f64 << "$" << getPoolEntryID() << "]"; |
| 2274 } | 2276 } |
| 2275 | 2277 |
| 2276 } // end of namespace Ice | 2278 } // end of namespace Ice |
| OLD | NEW |