Index: src/arm64/instructions-arm64.h |
diff --git a/src/arm64/instructions-arm64.h b/src/arm64/instructions-arm64.h |
index ab64cb2bf003cd57313c8883d686b36ef3bd2796..de76b69b6b87120154041d5a7e250569900c4421 100644 |
--- a/src/arm64/instructions-arm64.h |
+++ b/src/arm64/instructions-arm64.h |
@@ -160,9 +160,10 @@ class Instruction { |
// ImmPCRel is a compound field (not present in INSTRUCTION_FIELDS_LIST), |
// formed from ImmPCRelLo and ImmPCRelHi. |
int ImmPCRel() const { |
+ ASSERT(IsPCRelAddressing()); |
int const offset = ((ImmPCRelHi() << ImmPCRelLo_width) | ImmPCRelLo()); |
int const width = ImmPCRelLo_width + ImmPCRelHi_width; |
- return signed_bitextract_32(width-1, 0, offset); |
+ return signed_bitextract_32(width - 1, 0, offset); |
} |
uint64_t ImmLogical(); |
@@ -203,6 +204,10 @@ class Instruction { |
return Mask(PCRelAddressingFMask) == PCRelAddressingFixed; |
} |
+ bool IsAdr() const { |
+ return Mask(PCRelAddressingMask) == ADR; |
+ } |
+ |
bool IsLogicalImmediate() const { |
return Mask(LogicalImmediateFMask) == LogicalImmediateFixed; |
} |
@@ -211,6 +216,10 @@ class Instruction { |
return Mask(AddSubImmediateFMask) == AddSubImmediateFixed; |
} |
+ bool IsAddSubShifted() const { |
+ return Mask(AddSubShiftedFMask) == AddSubShiftedFixed; |
+ } |
+ |
bool IsAddSubExtended() const { |
return Mask(AddSubExtendedFMask) == AddSubExtendedFixed; |
} |
@@ -387,6 +396,10 @@ class Instruction { |
} |
+ static const int ImmPCRelRangeBitwidth = 21; |
+ static bool IsValidPCRelOffset(int offset) { |
+ return is_int21(offset); |
+ } |
void SetPCRelImmTarget(Instruction* target); |
void SetBranchImmTarget(Instruction* target); |
}; |