Index: src/arm/simulator-arm.cc |
=================================================================== |
--- src/arm/simulator-arm.cc (revision 3712) |
+++ src/arm/simulator-arm.cc (working copy) |
@@ -561,6 +561,13 @@ |
} |
+void Simulator::set_dw_register(int dreg, const int* dbl) { |
+ ASSERT((dreg >= 0) && (dreg < num_d_registers)); |
+ registers_[dreg] = dbl[0]; |
+ registers_[dreg + 1] = dbl[1]; |
+} |
+ |
+ |
// Raw access to the PC register. |
void Simulator::set_pc(int32_t value) { |
pc_modified_ = true; |
@@ -796,6 +803,20 @@ |
} |
+int* Simulator::ReadDW(int32_t addr) { |
Erik Corry
2010/05/04 07:06:13
Please use int32_t for things like this where the
zhangk
2010/05/07 05:32:14
On 2010/05/04 07:06:13, Erik Corry wrote:
Done.
|
+ int *ptr = reinterpret_cast<int *>(addr); |
Erik Corry
2010/05/04 07:06:13
int *ptr -> int* ptr
zhangk
2010/05/07 05:32:14
On 2010/05/04 07:06:13, Erik Corry wrote:
Done.
|
+ return ptr; |
+} |
+ |
+ |
+void Simulator::WriteDW(int32_t addr, int32_t value1, int32_t value2) { |
+ int32_t *ptr = reinterpret_cast<int32_t*>(addr); |
Erik Corry
2010/05/04 07:06:13
Asterisk placement.
zhangk
2010/05/07 05:32:14
On 2010/05/04 07:06:13, Erik Corry wrote:
Done.
|
+ *ptr++ = value1; |
+ *ptr = value2; |
+ return; |
+} |
+ |
+ |
// Returns the limit of the stack area to enable checking for stack overflows. |
uintptr_t Simulator::StackLimit() const { |
// Leave a safety margin of 256 bytes to prevent overrunning the stack when |
@@ -1408,7 +1429,18 @@ |
} |
} |
} |
- if (instr->HasH()) { |
+ if (((instr->Bits(7, 4) & 0xd) == 0xd) && (instr->Bit(20) == 0)) { |
+ if (instr->HasH()) { |
+ // strd |
Erik Corry
2010/05/04 07:06:13
Please check that rd specifies an even-numbered re
zhangk
2010/05/07 05:32:14
On 2010/05/04 07:06:13, Erik Corry wrote:
Done.
|
+ int32_t value1 = get_register(rd); |
+ int32_t value2 = get_register(rd+1); |
+ WriteDW(addr, value1, value2); |
+ } else { |
+ // ldrd |
+ int* rn_data = ReadDW(addr); |
+ set_dw_register(rd, rn_data); |
+ } |
+ } else if (instr->HasH()) { |
if (instr->HasSign()) { |
if (instr->HasL()) { |
int16_t val = ReadH(addr, instr); |