Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Unified Diff: src/IceAssemblerARM32.h

Issue 1424863005: Handle MOV (immediate) and MOVT to load ARM global addresses. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nits. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);

Powered by Google App Engine
This is Rietveld 408576698