| OLD | NEW |
| 1 //===- subzero/src/IceAssemblerX8632.cpp - Assembler for x86-32 ----------===// | 1 //===- subzero/src/IceAssemblerX8632.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 14 matching lines...) Expand all Loading... |
| 25 namespace Ice { | 25 namespace Ice { |
| 26 namespace X8632 { | 26 namespace X8632 { |
| 27 | 27 |
| 28 Address Address::ofConstPool(Assembler *Asm, const Constant *Imm) { | 28 Address Address::ofConstPool(Assembler *Asm, const Constant *Imm) { |
| 29 AssemblerFixup *Fixup = Asm->createFixup(llvm::ELF::R_386_32, Imm); | 29 AssemblerFixup *Fixup = Asm->createFixup(llvm::ELF::R_386_32, Imm); |
| 30 const RelocOffsetT Offset = 0; | 30 const RelocOffsetT Offset = 0; |
| 31 return Address::Absolute(Offset, Fixup); | 31 return Address::Absolute(Offset, Fixup); |
| 32 } | 32 } |
| 33 | 33 |
| 34 AssemblerX8632::~AssemblerX8632() { | 34 AssemblerX8632::~AssemblerX8632() { |
| 35 #ifndef NDEBUG | 35 #ifdef NDEBUG |
| 36 return; |
| 37 #endif // NDEBUG |
| 36 for (const Label *Label : CfgNodeLabels) { | 38 for (const Label *Label : CfgNodeLabels) { |
| 37 Label->FinalCheck(); | 39 Label->FinalCheck(); |
| 38 } | 40 } |
| 39 for (const Label *Label : LocalLabels) { | 41 for (const Label *Label : LocalLabels) { |
| 40 Label->FinalCheck(); | 42 Label->FinalCheck(); |
| 41 } | 43 } |
| 42 #endif | |
| 43 } | 44 } |
| 44 | 45 |
| 45 void AssemblerX8632::alignFunction() { | 46 void AssemblerX8632::alignFunction() { |
| 46 SizeT Align = 1 << getBundleAlignLog2Bytes(); | 47 SizeT Align = 1 << getBundleAlignLog2Bytes(); |
| 47 SizeT BytesNeeded = Utils::OffsetToAlignment(Buffer.getPosition(), Align); | 48 SizeT BytesNeeded = Utils::OffsetToAlignment(Buffer.getPosition(), Align); |
| 48 const SizeT HltSize = 1; | 49 const SizeT HltSize = 1; |
| 49 while (BytesNeeded > 0) { | 50 while (BytesNeeded > 0) { |
| 50 hlt(); | 51 hlt(); |
| 51 BytesNeeded -= HltSize; | 52 BytesNeeded -= HltSize; |
| 52 } | 53 } |
| (...skipping 2495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2548 assert(shifter == RegX8632::Encoded_Reg_ecx); | 2549 assert(shifter == RegX8632::Encoded_Reg_ecx); |
| 2549 (void)shifter; | 2550 (void)shifter; |
| 2550 if (Ty == IceType_i16) | 2551 if (Ty == IceType_i16) |
| 2551 emitOperandSizeOverride(); | 2552 emitOperandSizeOverride(); |
| 2552 emitUint8(isByteSizedArithType(Ty) ? 0xD2 : 0xD3); | 2553 emitUint8(isByteSizedArithType(Ty) ? 0xD2 : 0xD3); |
| 2553 emitOperand(rm, operand); | 2554 emitOperand(rm, operand); |
| 2554 } | 2555 } |
| 2555 | 2556 |
| 2556 } // end of namespace X8632 | 2557 } // end of namespace X8632 |
| 2557 } // end of namespace Ice | 2558 } // end of namespace Ice |
| OLD | NEW |