Index: src/arm/simulator-arm.h |
diff --git a/src/arm/simulator-arm.h b/src/arm/simulator-arm.h |
index d1cad15bd04213036d8013ac140cfbb500d4bf85..abc91bbc42a1dec072be83178a4fc860f3d9e439 100644 |
--- a/src/arm/simulator-arm.h |
+++ b/src/arm/simulator-arm.h |
@@ -163,12 +163,30 @@ 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_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); |
@@ -332,6 +350,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 |