summaryrefslogtreecommitdiff
path: root/compiler/utils/arm/assembler_arm.h
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2015-05-21 12:32:34 +0000
committer Nicolas Geoffray <ngeoffray@google.com> 2015-05-22 15:06:45 +0100
commitd56376cce54e7df976780ecbd03228f60d276433 (patch)
tree5a523ff4a1589a4462207f4c75fad921870a62a2 /compiler/utils/arm/assembler_arm.h
parentaa49c23d47e5fdfcf51380550ee864e9d30d082b (diff)
Revert "Revert "Introduce a NearLabel in thumb2.""
This reverts commit 1f277e3cef6c33cd35e91123978491d83338d2ad. - Fix CompareAndBranch to not use cbz/cbnz with high registers. - Add a test for CompareAndBranch with the *inc file, as the other assembler test infrastructure does not handle labels. Change-Id: If552bf1112b96caa3b9bb6c73c4b40bb90a33db7
Diffstat (limited to 'compiler/utils/arm/assembler_arm.h')
-rw-r--r--compiler/utils/arm/assembler_arm.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/compiler/utils/arm/assembler_arm.h b/compiler/utils/arm/assembler_arm.h
index dee8287e67..52a69ca487 100644
--- a/compiler/utils/arm/assembler_arm.h
+++ b/compiler/utils/arm/assembler_arm.h
@@ -33,6 +33,16 @@ namespace arm {
class Arm32Assembler;
class Thumb2Assembler;
+// This class indicates that the label and its uses
+// will fall into a range that is encodable in 16bits on thumb2.
+class NearLabel : public Label {
+ public:
+ NearLabel() {}
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(NearLabel);
+};
+
class ShifterOperand {
public:
ShifterOperand() : type_(kUnknown), rm_(kNoRegister), rs_(kNoRegister),
@@ -519,6 +529,9 @@ class ArmAssembler : public Assembler {
// Branch instructions.
virtual void b(Label* label, Condition cond = AL) = 0;
+ virtual void b(NearLabel* label, Condition cond = AL) {
+ b(static_cast<Label*>(label), cond);
+ }
virtual void bl(Label* label, Condition cond = AL) = 0;
virtual void blx(Register rm, Condition cond = AL) = 0;
virtual void bx(Register rm, Condition cond = AL) = 0;
@@ -654,6 +667,9 @@ class ArmAssembler : public Assembler {
virtual void Bind(Label* label) = 0;
virtual void CompareAndBranchIfZero(Register r, Label* label) = 0;
+ virtual void CompareAndBranchIfZero(Register r, NearLabel* label) {
+ CompareAndBranchIfZero(r, static_cast<Label*>(label));
+ }
virtual void CompareAndBranchIfNonZero(Register r, Label* label) = 0;
//