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

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

Issue 172223002: A64: Use fixed width MemoryRead/Write in simulator. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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
« no previous file with comments | « src/a64/simulator-a64.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/a64/simulator-a64.cc
diff --git a/src/a64/simulator-a64.cc b/src/a64/simulator-a64.cc
index 014b71477def993b76a8d1c6d953b8c0b67403fe..a2867a033f60d861c1082afccbc57f538930487e 100644
--- a/src/a64/simulator-a64.cc
+++ b/src/a64/simulator-a64.cc
@@ -1222,7 +1222,6 @@ void Simulator::LoadStoreHelper(Instruction* instr,
unsigned srcdst = instr->Rt();
unsigned addr_reg = instr->Rn();
uint8_t* address = LoadStoreAddress(addr_reg, offset, addrmode);
- int num_bytes = 1 << instr->SizeLS();
uint8_t* stack = NULL;
// Handle the writeback for stores before the store. On a CPU the writeback
@@ -1242,14 +1241,14 @@ void Simulator::LoadStoreHelper(Instruction* instr,
LoadStoreOp op = static_cast<LoadStoreOp>(instr->Mask(LoadStoreOpMask));
switch (op) {
- case LDRB_w:
- case LDRH_w:
- case LDR_w:
- case LDR_x: set_xreg(srcdst, MemoryRead(address, num_bytes)); break;
- case STRB_w:
- case STRH_w:
- case STR_w:
- case STR_x: MemoryWrite(address, xreg(srcdst), num_bytes); break;
+ case LDRB_w: set_xreg(srcdst, MemoryRead8(address)); break;
+ case LDRH_w: set_xreg(srcdst, MemoryRead16(address)); break;
+ case LDR_w: set_xreg(srcdst, MemoryRead32(address)); break;
+ case LDR_x: set_xreg(srcdst, MemoryRead64(address)); break;
+ case STRB_w: MemoryWrite8(address, reg<uint8_t>(srcdst)); break;
+ case STRH_w: MemoryWrite16(address, reg<uint16_t>(srcdst)); break;
+ case STR_w: MemoryWrite32(address, reg<uint32_t>(srcdst)); break;
+ case STR_x: MemoryWrite64(address, reg<uint64_t>(srcdst)); break;
case LDRSB_w: {
set_wreg(srcdst, ExtendValue(kWRegSize, MemoryRead8(address), SXTB));
break;
@@ -1479,31 +1478,11 @@ uint64_t Simulator::MemoryRead(uint8_t* address, unsigned num_bytes) {
}
-uint8_t Simulator::MemoryRead8(uint8_t* address) {
- return MemoryRead(address, sizeof(uint8_t));
-}
-
-
-uint16_t Simulator::MemoryRead16(uint8_t* address) {
- return MemoryRead(address, sizeof(uint16_t));
-}
-
-
-uint32_t Simulator::MemoryRead32(uint8_t* address) {
- return MemoryRead(address, sizeof(uint32_t));
-}
-
-
float Simulator::MemoryReadFP32(uint8_t* address) {
return rawbits_to_float(MemoryRead32(address));
}
-uint64_t Simulator::MemoryRead64(uint8_t* address) {
- return MemoryRead(address, sizeof(uint64_t));
-}
-
-
double Simulator::MemoryReadFP64(uint8_t* address) {
return rawbits_to_double(MemoryRead64(address));
}
@@ -1520,21 +1499,11 @@ void Simulator::MemoryWrite(uint8_t* address,
}
-void Simulator::MemoryWrite32(uint8_t* address, uint32_t value) {
- MemoryWrite(address, value, sizeof(uint32_t));
-}
-
-
void Simulator::MemoryWriteFP32(uint8_t* address, float value) {
MemoryWrite32(address, float_to_rawbits(value));
}
-void Simulator::MemoryWrite64(uint8_t* address, uint64_t value) {
- MemoryWrite(address, value, sizeof(uint64_t));
-}
-
-
void Simulator::MemoryWriteFP64(uint8_t* address, double value) {
MemoryWrite64(address, double_to_rawbits(value));
}
« no previous file with comments | « src/a64/simulator-a64.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698