OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 // | 4 // |
5 // Modified by the Subzero authors. | 5 // Modified by the Subzero authors. |
6 // | 6 // |
7 //===- subzero/src/assembler_ia32.h - Assembler for x86-32 ----------------===// | 7 //===- subzero/src/assembler_ia32.h - Assembler for x86-32 ----------------===// |
8 // | 8 // |
9 // The Subzero Code Generator | 9 // The Subzero Code Generator |
10 // | 10 // |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 | 53 |
54 void Process(const MemoryRegion ®ion, intptr_t position) override { | 54 void Process(const MemoryRegion ®ion, intptr_t position) override { |
55 (void)region; | 55 (void)region; |
56 (void)position; | 56 (void)position; |
57 llvm_unreachable("We might not be using this Process() method later."); | 57 llvm_unreachable("We might not be using this Process() method later."); |
58 } | 58 } |
59 | 59 |
60 private: | 60 private: |
61 DisplacementRelocation(FixupKind Kind, const ConstantRelocatable *Sym) | 61 DisplacementRelocation(FixupKind Kind, const ConstantRelocatable *Sym) |
62 : AssemblerFixup(Kind, Sym) {} | 62 : AssemblerFixup(Kind, Sym) {} |
63 DisplacementRelocation(const DisplacementRelocation &) LLVM_DELETED_FUNCTION; | 63 DisplacementRelocation(const DisplacementRelocation &) = delete; |
64 DisplacementRelocation & | 64 DisplacementRelocation &operator=(const DisplacementRelocation &) = delete; |
65 operator=(const DisplacementRelocation &) LLVM_DELETED_FUNCTION; | |
66 }; | 65 }; |
67 | 66 |
68 class Immediate { | 67 class Immediate { |
69 public: | 68 public: |
70 explicit Immediate(int32_t value) : value_(value) {} | 69 explicit Immediate(int32_t value) : value_(value) {} |
71 | 70 |
72 Immediate(const Immediate &other) : value_(other.value_) {} | 71 Immediate(const Immediate &other) : value_(other.value_) {} |
73 | 72 |
74 int32_t value() const { return value_; } | 73 int32_t value() const { return value_; } |
75 | 74 |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 unresolved_near_positions_[num_unresolved_++] = position; | 312 unresolved_near_positions_[num_unresolved_++] = position; |
314 } | 313 } |
315 | 314 |
316 static const int kMaxUnresolvedBranches = 20; | 315 static const int kMaxUnresolvedBranches = 20; |
317 | 316 |
318 intptr_t position_; | 317 intptr_t position_; |
319 intptr_t num_unresolved_; | 318 intptr_t num_unresolved_; |
320 intptr_t unresolved_near_positions_[kMaxUnresolvedBranches]; | 319 intptr_t unresolved_near_positions_[kMaxUnresolvedBranches]; |
321 | 320 |
322 friend class AssemblerX86; | 321 friend class AssemblerX86; |
323 Label(const Label &) LLVM_DELETED_FUNCTION; | 322 Label(const Label &) = delete; |
324 Label &operator=(const Label &) LLVM_DELETED_FUNCTION; | 323 Label &operator=(const Label &) = delete; |
325 }; | 324 }; |
326 | 325 |
327 class AssemblerX86 : public Assembler { | 326 class AssemblerX86 : public Assembler { |
328 public: | 327 public: |
329 explicit AssemblerX86(bool use_far_branches = false) : buffer_(*this) { | 328 explicit AssemblerX86(bool use_far_branches = false) : buffer_(*this) { |
330 // This mode is only needed and implemented for MIPS and ARM. | 329 // This mode is only needed and implemented for MIPS and ARM. |
331 assert(!use_far_branches); | 330 assert(!use_far_branches); |
332 (void)use_far_branches; | 331 (void)use_far_branches; |
333 } | 332 } |
334 ~AssemblerX86() {} | 333 ~AssemblerX86() {} |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
720 const Immediate &immediate); | 719 const Immediate &immediate); |
721 void EmitLabel(Label *label, intptr_t instruction_size); | 720 void EmitLabel(Label *label, intptr_t instruction_size); |
722 void EmitLabelLink(Label *label); | 721 void EmitLabelLink(Label *label); |
723 void EmitNearLabelLink(Label *label); | 722 void EmitNearLabelLink(Label *label); |
724 | 723 |
725 void EmitGenericShift(int rm, GPRRegister reg, const Immediate &imm); | 724 void EmitGenericShift(int rm, GPRRegister reg, const Immediate &imm); |
726 void EmitGenericShift(int rm, const Operand &operand, GPRRegister shifter); | 725 void EmitGenericShift(int rm, const Operand &operand, GPRRegister shifter); |
727 | 726 |
728 AssemblerBuffer buffer_; | 727 AssemblerBuffer buffer_; |
729 | 728 |
730 AssemblerX86(const AssemblerX86 &) LLVM_DELETED_FUNCTION; | 729 AssemblerX86(const AssemblerX86 &) = delete; |
731 AssemblerX86 &operator=(const AssemblerX86 &) LLVM_DELETED_FUNCTION; | 730 AssemblerX86 &operator=(const AssemblerX86 &) = delete; |
732 }; | 731 }; |
733 | 732 |
734 inline void AssemblerX86::EmitUint8(uint8_t value) { | 733 inline void AssemblerX86::EmitUint8(uint8_t value) { |
735 buffer_.Emit<uint8_t>(value); | 734 buffer_.Emit<uint8_t>(value); |
736 } | 735 } |
737 | 736 |
738 inline void AssemblerX86::EmitInt16(int16_t value) { | 737 inline void AssemblerX86::EmitInt16(int16_t value) { |
739 buffer_.Emit<int16_t>(value); | 738 buffer_.Emit<int16_t>(value); |
740 } | 739 } |
741 | 740 |
(...skipping 13 matching lines...) Expand all Loading... |
755 inline void AssemblerX86::EmitFixup(AssemblerFixup *fixup) { | 754 inline void AssemblerX86::EmitFixup(AssemblerFixup *fixup) { |
756 buffer_.EmitFixup(fixup); | 755 buffer_.EmitFixup(fixup); |
757 } | 756 } |
758 | 757 |
759 inline void AssemblerX86::EmitOperandSizeOverride() { EmitUint8(0x66); } | 758 inline void AssemblerX86::EmitOperandSizeOverride() { EmitUint8(0x66); } |
760 | 759 |
761 } // end of namespace x86 | 760 } // end of namespace x86 |
762 } // end of namespace Ice | 761 } // end of namespace Ice |
763 | 762 |
764 #endif // SUBZERO_SRC_ASSEMBLER_IA32_H_ | 763 #endif // SUBZERO_SRC_ASSEMBLER_IA32_H_ |
OLD | NEW |