OLD | NEW |
1 //===- subzero/src/IceAssemblerX86BaseImpl.h - base x86 assembler -*- C++ -*-=// | 1 //===- subzero/src/IceAssemblerX86BaseImpl.h - base x86 assembler -*- C++ -*-=// |
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 88 matching lines...) Loading... |
99 } | 99 } |
100 | 100 |
101 template <typename TraitsType> | 101 template <typename TraitsType> |
102 void AssemblerX86Base<TraitsType>::bindLocalLabel(SizeT Number) { | 102 void AssemblerX86Base<TraitsType>::bindLocalLabel(SizeT Number) { |
103 Label *L = getOrCreateLocalLabel(Number); | 103 Label *L = getOrCreateLocalLabel(Number); |
104 if (!getPreliminary()) | 104 if (!getPreliminary()) |
105 this->bind(L); | 105 this->bind(L); |
106 } | 106 } |
107 | 107 |
108 template <typename TraitsType> | 108 template <typename TraitsType> |
109 void AssemblerX86Base<TraitsType>::bindRelocOffset(RelocOffset *Offset) { | |
110 if (!getPreliminary()) { | |
111 Offset->setOffset(Buffer.getPosition()); | |
112 } | |
113 } | |
114 | |
115 template <typename TraitsType> | |
116 void AssemblerX86Base<TraitsType>::call(GPRRegister reg) { | 109 void AssemblerX86Base<TraitsType>::call(GPRRegister reg) { |
117 AssemblerBuffer::EnsureCapacity ensured(&Buffer); | 110 AssemblerBuffer::EnsureCapacity ensured(&Buffer); |
118 emitRexB(RexTypeIrrelevant, reg); | 111 emitRexB(RexTypeIrrelevant, reg); |
119 emitUint8(0xFF); | 112 emitUint8(0xFF); |
120 emitRegisterOperand(2, gprEncoding(reg)); | 113 emitRegisterOperand(2, gprEncoding(reg)); |
121 } | 114 } |
122 | 115 |
123 template <typename TraitsType> | 116 template <typename TraitsType> |
124 void AssemblerX86Base<TraitsType>::call(const Address &address) { | 117 void AssemblerX86Base<TraitsType>::call(const Address &address) { |
125 AssemblerBuffer::EnsureCapacity ensured(&Buffer); | 118 AssemblerBuffer::EnsureCapacity ensured(&Buffer); |
(...skipping 3416 matching lines...) Loading... |
3542 (void)shifter; | 3535 (void)shifter; |
3543 if (Ty == IceType_i16) | 3536 if (Ty == IceType_i16) |
3544 emitOperandSizeOverride(); | 3537 emitOperandSizeOverride(); |
3545 emitRexB(Ty, operand.rm()); | 3538 emitRexB(Ty, operand.rm()); |
3546 emitUint8(isByteSizedArithType(Ty) ? 0xD2 : 0xD3); | 3539 emitUint8(isByteSizedArithType(Ty) ? 0xD2 : 0xD3); |
3547 emitOperand(rm, operand); | 3540 emitOperand(rm, operand); |
3548 } | 3541 } |
3549 | 3542 |
3550 } // end of namespace X86NAMESPACE | 3543 } // end of namespace X86NAMESPACE |
3551 } // end of namespace Ice | 3544 } // end of namespace Ice |
OLD | NEW |