28 #ifndef V8_ARM_CONSTANTS_ARM_H_
29 #define V8_ARM_CONSTANTS_ARM_H_
32 #if defined(__arm__) && !defined(__ARM_EABI__)
33 #error ARM EABI support is required.
39 #if defined(__THUMB_INTERWORK__) || !defined(__arm__)
40 # define USE_THUMB_INTERWORK 1
43 #if defined(__ARM_ARCH_7A__) || \
44 defined(__ARM_ARCH_7R__) || \
45 defined(__ARM_ARCH_7__)
46 # define CAN_USE_ARMV7_INSTRUCTIONS 1
49 #if defined(__ARM_ARCH_6__) || \
50 defined(__ARM_ARCH_6J__) || \
51 defined(__ARM_ARCH_6K__) || \
52 defined(__ARM_ARCH_6Z__) || \
53 defined(__ARM_ARCH_6ZK__) || \
54 defined(__ARM_ARCH_6T2__) || \
55 defined(CAN_USE_ARMV7_INSTRUCTIONS)
56 # define CAN_USE_ARMV6_INSTRUCTIONS 1
59 #if defined(__ARM_ARCH_5T__) || \
60 defined(__ARM_ARCH_5TE__) || \
61 defined(__ARM_ARCH_5TEJ__) || \
62 defined(CAN_USE_ARMV6_INSTRUCTIONS)
63 # define CAN_USE_ARMV5_INSTRUCTIONS 1
64 # define CAN_USE_THUMB_INSTRUCTIONS 1
69 # define CAN_USE_ARMV5_INSTRUCTIONS 1
70 # define CAN_USE_THUMB_INSTRUCTIONS 1
72 # ifndef CAN_USE_UNALIGNED_ACCESSES
73 # define CAN_USE_UNALIGNED_ACCESSES 1
79 #if defined(USE_THUMB_INTERWORK) || defined(CAN_USE_ARMV5_INSTRUCTIONS)
517 #define DECLARE_STATIC_TYPED_ACCESSOR(return_type, Name) \
518 static inline return_type Name(Instr instr) { \
519 char* temp = reinterpret_cast<char*>(&instr); \
520 return reinterpret_cast<Instruction*>(temp)->Name(); \
523 #define DECLARE_STATIC_ACCESSOR(Name) DECLARE_STATIC_TYPED_ACCESSOR(int, Name)
527 return *
reinterpret_cast<const Instr*
>(
this);
532 *
reinterpret_cast<Instr*
>(
this) = value;
536 inline int Bit(
int nr)
const {
554 return (instr >> nr) & 1;
559 return (instr >> lo) & ((2 << (hi -
lo)) - 1);
565 return instr & (((2 << (hi -
lo)) - 1) << lo);
620 return VFPGlueRegValue(pre, 16, 7);
623 return VFPGlueRegValue(pre, 0, 5);
626 return VFPGlueRegValue(pre, 12, 22);
688 && ((
Bit(7) == 0)); }
725 inline int VFPGlueRegValue(
VFPRegPrecision pre,
int four_bit,
int one_bit) {
727 return (
Bits(four_bit + 3, four_bit) << 1) |
Bit(one_bit);
729 return (
Bit(one_bit) << 4) |
Bits(four_bit + 3, four_bit);
733 DISALLOW_IMPLICIT_CONSTRUCTORS(Instruction);
741 static const char*
Name(
int reg);
744 static int Number(
const char* name);
760 static const char*
Name(
int reg,
bool is_double);
765 static int Number(
const char* name,
bool* is_double);
774 #endif // V8_ARM_CONSTANTS_ARM_H_
static int BitField(Instr instr, int hi, int lo)
const uint32_t kVFPZConditionFlagBit
const int kNumVFPRegisters
const Instr kLdrRegFpOffsetPattern
const Instr kMovwLeaveCCFlip
const Instr kLdrPCPattern
const Instr kMovMvnPattern
const uint32_t kVFPNConditionFlagBit
const uint32_t kVFPInvalidOpExceptionBit
static int Bit(Instr instr, int nr)
const uint32_t kVFPOverflowExceptionBit
int VFPDRegValue(VFPRegPrecision pre)
bool IsSpecialType0() const
const uint32_t kVFPUnderflowExceptionBit
SoftwareInterruptCodes SvcValue() const
static const char * Name(int reg, bool is_double)
DECLARE_STATIC_TYPED_ACCESSOR(Condition, ConditionValue)
const Instr kLdrStrOffsetMask
Instr InstructionBits() const
static int Number(const char *name, bool *is_double)
const uint32_t kMaxStopCode
int ShiftAmountValue() const
#define ASSERT(condition)
const uint32_t kStopCodeMask
const Instr kCmpCmnPattern
const Instr kPopRegPattern
static const char * Name(int reg)
const int kNumVFPSingleRegisters
const Instr kPushRegPattern
const uint32_t kVFPFlushToZeroMask
Condition ReverseCondition(Condition cond)
static Instruction * At(byte *pc)
int ImmedMovwMovtValue() const
const Instr kLdrStrInstrArgumentMask
const int32_t kDefaultStopCode
static int Number(const char *name)
void SetInstructionBits(Instr value)
Hint NegateHint(Hint ignored)
const Instr kLdrRegFpNegOffsetPattern
double DoubleImmedVmov() const
static int Bits(Instr instr, int hi, int lo)
const Instr kMovLeaveCCMask
int BitField(int hi, int lo) const
const Instr kPopInstruction
const Instr kStrRegFpOffsetPattern
const uint32_t kVFPExceptionMask
Opcode OpcodeField() const
int CoprocessorValue() const
const int kConstantPoolMarker
int Bits(int hi, int lo) const
const Instr kMovLeaveCCPattern
const Instr kLdrStrInstrTypeMask
int VFPNRegValue(VFPRegPrecision pre)
const Instr kBlxRegPattern
const uint32_t kVFPVConditionFlagBit
const uint32_t kVFPInexactExceptionBit
Condition NegateCondition(Condition cond)
DECLARE_STATIC_ACCESSOR(RnValue)
uint32_t SRegisterFieldMask
Condition ConditionField() const
ShiftOp ShiftField() const
int Offset12Value() const
CheckForInexactConversion
const int kConstantPoolMarkerMask
Condition ConditionValue() const
const uint32_t kVFPRoundingModeMask
int SImmed24Value() const
const int kConstantPoolLengthMask
const Instr kStrRegFpNegOffsetPattern
int VFPMRegValue(VFPRegPrecision pre)
const uint32_t kVFPCConditionFlagBit
const int kNumVFPDoubleRegisters
int RegShiftValue() const