Index: src/arm/simulator-arm.h |
diff --git a/src/arm/simulator-arm.h b/src/arm/simulator-arm.h |
index d1cad15bd04213036d8013ac140cfbb500d4bf85..7bc86df1e2aaae019af70058b6a3f1182b8bc67a 100644 |
--- a/src/arm/simulator-arm.h |
+++ b/src/arm/simulator-arm.h |
@@ -163,12 +163,38 @@ class Simulator { |
// Support for VFP. |
void set_s_register(int reg, unsigned int value); |
unsigned int get_s_register(int reg) const; |
- void set_d_register_from_double(int dreg, const double& dbl); |
- double get_double_from_d_register(int dreg); |
- void set_s_register_from_float(int sreg, const float dbl); |
- float get_float_from_s_register(int sreg); |
- void set_s_register_from_sinteger(int reg, const int value); |
- int get_sinteger_from_s_register(int reg); |
+ |
+ void set_d_register_from_double(int dreg, const double& dbl) { |
+ SetVFPRegister<double, 2>(dreg, dbl); |
+ } |
+ |
+ double get_double_from_d_register(int dreg) { |
+ return GetFromVFPRegister<double, 2>(dreg); |
+ } |
+ |
+ void set_d_register_from_raw_bits(int dreg, const int64_t bits) { |
+ SetVFPRegister<int64_t, 2>(dreg, bits); |
+ } |
+ |
+ int64_t get_raw_bits_from_d_register(int dreg) { |
+ return GetFromVFPRegister<int64_t, 2>(dreg); |
+ } |
+ |
+ void set_s_register_from_float(int sreg, const float flt) { |
+ SetVFPRegister<float, 1>(sreg, flt); |
+ } |
+ |
+ float get_float_from_s_register(int sreg) { |
+ return GetFromVFPRegister<float, 1>(sreg); |
+ } |
+ |
+ void set_s_register_from_sinteger(int sreg, const int sint) { |
+ SetVFPRegister<int, 1>(sreg, sint); |
+ } |
+ |
+ int get_sinteger_from_s_register(int sreg) { |
+ return GetFromVFPRegister<int, 1>(sreg); |
+ } |
// Special case of set_register and get_register to access the raw PC value. |
void set_pc(int32_t value); |
@@ -302,6 +328,8 @@ class Simulator { |
void DecodeType6(Instruction* instr); |
void DecodeType7(Instruction* instr); |
+ void DecodeSpecialCondition(Instruction* instr); |
+ |
// Support for VFP. |
void DecodeTypeVFP(Instruction* instr); |
void DecodeType6CoprocessorIns(Instruction* instr); |
@@ -332,6 +360,12 @@ class Simulator { |
void SetFpResult(const double& result); |
void TrashCallerSaveRegisters(); |
+ template<class ReturnType, int register_size> |
+ ReturnType GetFromVFPRegister(int reg_index); |
+ |
+ template<class InputType, int register_size> |
+ void SetVFPRegister(int reg_index, const InputType& value); |
+ |
// Architecture state. |
// Saturating instructions require a Q flag to indicate saturation. |
// There is currently no way to read the CPSR directly, and thus read the Q |