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

Unified Diff: src/IceAssemblerARM32.h

Issue 1452293003: Add BL (immediate) and BLX (register) to ARM assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nits. Created 5 years, 1 month 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 e524e4224fe0a346141cac3197e543eb066f4bc7..8de4e258465d5bf88b77e88c77da8e16b9786f7c 100644
--- a/src/IceAssemblerARM32.h
+++ b/src/IceAssemblerARM32.h
@@ -45,13 +45,23 @@ using IValueT = uint32_t;
using IOffsetT = int32_t;
/// Handles encoding of bottom/top 16 bits of an address using movw/movt.
-class MoveRelocatableFixup : public AssemblerFixup {
+class MoveRelocatableFixup final : public AssemblerFixup {
MoveRelocatableFixup &operator=(const MoveRelocatableFixup &) = delete;
MoveRelocatableFixup(const MoveRelocatableFixup &) = default;
public:
MoveRelocatableFixup() = default;
- size_t emit(GlobalContext *Ctx, const Assembler &Asm) const override;
+ size_t emit(GlobalContext *Ctx, const Assembler &Asm) const final;
+};
+
+/// Handles encoding of branch and link to global location.
+class BlRelocatableFixup final : public AssemblerFixup {
+ BlRelocatableFixup(const BlRelocatableFixup &) = delete;
+ BlRelocatableFixup &operator=(const BlRelocatableFixup &) = delete;
+
+public:
+ BlRelocatableFixup() = default;
+ size_t emit(GlobalContext *Ctx, const Assembler &Asm) const final;
};
class AssemblerARM32 : public Assembler {
@@ -103,6 +113,8 @@ public:
MoveRelocatableFixup *createMoveFixup(bool IsMovW, const Constant *Value);
+ BlRelocatableFixup *createBlFixup(const ConstantRelocatable *Target);
Jim Stichnoth 2015/11/22 03:27:03 I'd be happier if we reserved variable name "Targe
Karl 2015/11/30 16:54:35 Done.
+
void alignFunction() override {
const SizeT Align = 1 << getBundleAlignLog2Bytes();
SizeT BytesNeeded = Utils::OffsetToAlignment(Buffer.getPosition(), Align);
@@ -186,15 +198,19 @@ public:
void b(Label *L, CondARM32::Cond Cond);
- void bx(RegARM32::GPRRegister Rm, CondARM32::Cond Cond = CondARM32::AL);
-
void bkpt(uint16_t Imm16);
- void cmp(const Operand *OpRn, const Operand *OpSrc1, CondARM32::Cond Cond);
-
void bic(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1,
bool SetFlags, CondARM32::Cond Cond);
+ void bl(const ConstantRelocatable *Target);
+
+ void blx(const Operand *Target);
+
+ void bx(RegARM32::GPRRegister Rm, CondARM32::Cond Cond = CondARM32::AL);
+
+ void cmp(const Operand *OpRn, const Operand *OpSrc1, CondARM32::Cond Cond);
+
void eor(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1,
bool SetFlags, CondARM32::Cond Cond);

Powered by Google App Engine
This is Rietveld 408576698