diff options
Diffstat (limited to 'src/arm/constants-arm.h')
-rw-r--r-- | src/arm/constants-arm.h | 51 |
1 files changed, 38 insertions, 13 deletions
diff --git a/src/arm/constants-arm.h b/src/arm/constants-arm.h index 6bd0d008..94322073 100644 --- a/src/arm/constants-arm.h +++ b/src/arm/constants-arm.h @@ -43,24 +43,27 @@ # define USE_THUMB_INTERWORK 1 #endif -#if defined(__ARM_ARCH_5T__) || \ - defined(__ARM_ARCH_5TE__) || \ - defined(__ARM_ARCH_6__) || \ - defined(__ARM_ARCH_7A__) || \ +#if defined(__ARM_ARCH_7A__) || \ + defined(__ARM_ARCH_7R__) || \ defined(__ARM_ARCH_7__) -# define CAN_USE_ARMV5_INSTRUCTIONS 1 -# define CAN_USE_THUMB_INSTRUCTIONS 1 +# define CAN_USE_ARMV7_INSTRUCTIONS 1 #endif -#if defined(__ARM_ARCH_6__) || \ - defined(__ARM_ARCH_7A__) || \ - defined(__ARM_ARCH_7__) +#if defined(__ARM_ARCH_6__) || \ + defined(__ARM_ARCH_6J__) || \ + defined(__ARM_ARCH_6K__) || \ + defined(__ARM_ARCH_6Z__) || \ + defined(__ARM_ARCH_6ZK__) || \ + defined(__ARM_ARCH_6T2__) || \ + defined(CAN_USE_ARMV7_INSTRUCTIONS) # define CAN_USE_ARMV6_INSTRUCTIONS 1 #endif -#if defined(__ARM_ARCH_7A__) || \ - defined(__ARM_ARCH_7__) -# define CAN_USE_ARMV7_INSTRUCTIONS 1 +#if defined(__ARM_ARCH_5T__) || \ + defined(__ARM_ARCH_5TE__) || \ + defined(CAN_USE_ARMV6_INSTRUCTIONS) +# define CAN_USE_ARMV5_INSTRUCTIONS 1 +# define CAN_USE_THUMB_INSTRUCTIONS 1 #endif // Simulator should support ARM5 instructions. @@ -75,6 +78,9 @@ namespace arm { // Number of registers in normal ARM mode. static const int kNumRegisters = 16; +// VFP support. +static const int kNumVFPRegisters = 48; + // PC is register 15. static const int kPCRegister = 15; static const int kNoRegister = -1; @@ -231,6 +237,16 @@ class Instr { inline int RnField() const { return Bits(19, 16); } inline int RdField() const { return Bits(15, 12); } + // Support for VFP. + // Vn(19-16) | Vd(15-12) | Vm(3-0) + inline int VnField() const { return Bits(19, 16); } + inline int VmField() const { return Bits(3, 0); } + inline int VdField() const { return Bits(15, 12); } + inline int NField() const { return Bit(7); } + inline int MField() const { return Bit(5); } + inline int DField() const { return Bit(22); } + inline int RtField() const { return Bits(15, 12); } + // Fields used in Data processing instructions inline Opcode OpcodeField() const { return static_cast<Opcode>(Bits(24, 21)); @@ -307,7 +323,7 @@ class Registers { struct RegisterAlias { int reg; - const char *name; + const char* name; }; private: @@ -315,6 +331,15 @@ class Registers { static const RegisterAlias aliases_[]; }; +// Helper functions for converting between VFP register numbers and names. +class VFPRegisters { + public: + // Return the name of the register. + static const char* Name(int reg); + + private: + static const char* names_[kNumVFPRegisters]; +}; } } // namespace assembler::arm |