Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Unified Diff: src/arm/simulator-arm.cc

Issue 568029: Add support for ldrd/strd from Kun Zhang (zhangk@codeaurora.org), Code Aurora (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/arm/codegen-arm.cc ('K') | « src/arm/simulator-arm.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« src/arm/codegen-arm.cc ('K') | « src/arm/simulator-arm.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698