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 if (buildAllowsAsserts()) { |
36 for (const Label *Label : CfgNodeLabels) { | 36 for (const Label *Label : CfgNodeLabels) { |
John
2015/06/23 22:28:30
optional: perhaps a good case for auto?
| |
37 Label->FinalCheck(); | 37 Label->FinalCheck(); |
38 } | |
39 for (const Label *Label : LocalLabels) { | |
40 Label->FinalCheck(); | |
41 } | |
38 } | 42 } |
39 for (const Label *Label : LocalLabels) { | |
40 Label->FinalCheck(); | |
41 } | |
42 #endif | |
43 } | 43 } |
44 | 44 |
45 void AssemblerX8632::alignFunction() { | 45 void AssemblerX8632::alignFunction() { |
46 SizeT Align = 1 << getBundleAlignLog2Bytes(); | 46 SizeT Align = 1 << getBundleAlignLog2Bytes(); |
47 SizeT BytesNeeded = Utils::OffsetToAlignment(Buffer.getPosition(), Align); | 47 SizeT BytesNeeded = Utils::OffsetToAlignment(Buffer.getPosition(), Align); |
48 const SizeT HltSize = 1; | 48 const SizeT HltSize = 1; |
49 while (BytesNeeded > 0) { | 49 while (BytesNeeded > 0) { |
50 hlt(); | 50 hlt(); |
51 BytesNeeded -= HltSize; | 51 BytesNeeded -= HltSize; |
52 } | 52 } |
(...skipping 2495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2548 assert(shifter == RegX8632::Encoded_Reg_ecx); | 2548 assert(shifter == RegX8632::Encoded_Reg_ecx); |
2549 (void)shifter; | 2549 (void)shifter; |
2550 if (Ty == IceType_i16) | 2550 if (Ty == IceType_i16) |
2551 emitOperandSizeOverride(); | 2551 emitOperandSizeOverride(); |
2552 emitUint8(isByteSizedArithType(Ty) ? 0xD2 : 0xD3); | 2552 emitUint8(isByteSizedArithType(Ty) ? 0xD2 : 0xD3); |
2553 emitOperand(rm, operand); | 2553 emitOperand(rm, operand); |
2554 } | 2554 } |
2555 | 2555 |
2556 } // end of namespace X8632 | 2556 } // end of namespace X8632 |
2557 } // end of namespace Ice | 2557 } // end of namespace Ice |
OLD | NEW |