Index: src/IceAssemblerARM32.h |
diff --git a/src/IceAssemblerARM32.h b/src/IceAssemblerARM32.h |
index d4c58af930eae4fb2af3369b20175fcecb5b405a..b7cd55a112f7541781069183fe68792175dba3aa 100644 |
--- a/src/IceAssemblerARM32.h |
+++ b/src/IceAssemblerARM32.h |
@@ -44,6 +44,16 @@ using IValueT = uint32_t; |
/// An Offset value (+/-) used in an ARM 32-bit instruction. |
using IOffsetT = int32_t; |
+/// Handles encoding of bottom/top 16 bits of an address using movw/movt. |
+class MoveRelocatableFixup : public AssemblerFixup { |
+ MoveRelocatableFixup &operator=(const MoveRelocatableFixup &) = delete; |
+ MoveRelocatableFixup(const MoveRelocatableFixup &) = default; |
+ |
+public: |
+ MoveRelocatableFixup() = default; |
+ size_t emit(GlobalContext *Ctx, const Assembler &Asm) const override; |
+}; |
+ |
class AssemblerARM32 : public Assembler { |
AssemblerARM32() = delete; |
AssemblerARM32(const AssemblerARM32 &) = delete; |
@@ -66,6 +76,8 @@ public: |
} |
} |
+ MoveRelocatableFixup *createMoveFixup(bool IsMovW, const Constant *Value); |
+ |
void alignFunction() override { |
const SizeT Align = 1 << getBundleAlignLog2Bytes(); |
SizeT BytesNeeded = Utils::OffsetToAlignment(Buffer.getPosition(), Align); |
@@ -138,6 +150,10 @@ public: |
void mov(const Operand *OpRd, const Operand *OpSrc, CondARM32::Cond Cond); |
+ void movw(const Operand *OpRd, const Operand *OpSrc, CondARM32::Cond Cond); |
+ |
+ void movt(const Operand *OpRd, const Operand *OpSrc, CondARM32::Cond Cond); |
+ |
void bx(RegARM32::GPRRegister Rm, CondARM32::Cond Cond = CondARM32::AL); |
void str(const Operand *OpRt, const Operand *OpAddress, CondARM32::Cond Cond); |