| OLD | NEW |
| 1 //===- subzero/src/assembler_ia32.cpp - Assembler for x86-32 -------------===// | 1 //===- subzero/src/assembler_ia32.cpp - Assembler for x86-32 -------------===// |
| 2 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 2 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 3 // for details. All rights reserved. Use of this source code is governed by a | 3 // for details. All rights reserved. Use of this source code is governed by a |
| 4 // BSD-style license that can be found in the LICENSE file. | 4 // BSD-style license that can be found in the LICENSE file. |
| 5 // | 5 // |
| 6 // Modified by the Subzero authors. | 6 // Modified by the Subzero authors. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 // | 9 // |
| 10 // The Subzero Code Generator | 10 // The Subzero Code Generator |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 Address Address::ofConstPool(GlobalContext *Ctx, Assembler *Asm, | 52 Address Address::ofConstPool(GlobalContext *Ctx, Assembler *Asm, |
| 53 const Constant *Imm) { | 53 const Constant *Imm) { |
| 54 // We should make this much lighter-weight. E.g., just record the const pool | 54 // We should make this much lighter-weight. E.g., just record the const pool |
| 55 // entry ID. | 55 // entry ID. |
| 56 std::string Buffer; | 56 std::string Buffer; |
| 57 llvm::raw_string_ostream StrBuf(Buffer); | 57 llvm::raw_string_ostream StrBuf(Buffer); |
| 58 Type Ty = Imm->getType(); | 58 Type Ty = Imm->getType(); |
| 59 assert(llvm::isa<ConstantFloat>(Imm) || llvm::isa<ConstantDouble>(Imm)); | 59 assert(llvm::isa<ConstantFloat>(Imm) || llvm::isa<ConstantDouble>(Imm)); |
| 60 StrBuf << "L$" << Ty << "$" << Imm->getPoolEntryID(); | 60 StrBuf << ".L$" << Ty << "$" << Imm->getPoolEntryID(); |
| 61 const RelocOffsetT Offset = 0; | 61 const RelocOffsetT Offset = 0; |
| 62 const bool SuppressMangling = true; | 62 const bool SuppressMangling = true; |
| 63 Constant *Sym = | 63 Constant *Sym = |
| 64 Ctx->getConstantSym(Ty, Offset, StrBuf.str(), SuppressMangling); | 64 Ctx->getConstantSym(Ty, Offset, StrBuf.str(), SuppressMangling); |
| 65 AssemblerFixup *Fixup = x86::DisplacementRelocation::create( | 65 AssemblerFixup *Fixup = x86::DisplacementRelocation::create( |
| 66 Asm, FK_Abs_4, llvm::cast<ConstantRelocatable>(Sym)); | 66 Asm, FK_Abs_4, llvm::cast<ConstantRelocatable>(Sym)); |
| 67 return x86::Address::Absolute(Fixup); | 67 return x86::Address::Absolute(Fixup); |
| 68 } | 68 } |
| 69 | 69 |
| 70 AssemblerX86::~AssemblerX86() { | 70 AssemblerX86::~AssemblerX86() { |
| (...skipping 2450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2521 assert(shifter == RegX8632::Encoded_Reg_ecx); | 2521 assert(shifter == RegX8632::Encoded_Reg_ecx); |
| 2522 (void)shifter; | 2522 (void)shifter; |
| 2523 if (Ty == IceType_i16) | 2523 if (Ty == IceType_i16) |
| 2524 EmitOperandSizeOverride(); | 2524 EmitOperandSizeOverride(); |
| 2525 EmitUint8(isByteSizedArithType(Ty) ? 0xD2 : 0xD3); | 2525 EmitUint8(isByteSizedArithType(Ty) ? 0xD2 : 0xD3); |
| 2526 EmitOperand(rm, operand); | 2526 EmitOperand(rm, operand); |
| 2527 } | 2527 } |
| 2528 | 2528 |
| 2529 } // end of namespace x86 | 2529 } // end of namespace x86 |
| 2530 } // end of namespace Ice | 2530 } // end of namespace Ice |
| OLD | NEW |