summaryrefslogtreecommitdiff
path: root/src/arch/x86/isa
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2007-07-20 15:02:09 -0700
committerGabe Black <gblack@eecs.umich.edu>2007-07-20 15:02:09 -0700
commitf09847c7a69c25ab553dd95c73af05bbe4b01859 (patch)
treef6f74d4ea3779d076ce145e4ce2ae221a686ddb6 /src/arch/x86/isa
parentd926de462a6580b09a05d7a2fdf7eae699f51915 (diff)
downloadgem5-f09847c7a69c25ab553dd95c73af05bbe4b01859.tar.xz
Make load and store ops use the appropriate sized data access.
--HG-- extra : convert_revision : 6b808586fab10ca433ef04b062bf701b906634b9
Diffstat (limited to 'src/arch/x86/isa')
-rw-r--r--src/arch/x86/isa/microops/ldstop.isa81
1 files changed, 75 insertions, 6 deletions
diff --git a/src/arch/x86/isa/microops/ldstop.isa b/src/arch/x86/isa/microops/ldstop.isa
index baa692f83..ccf519963 100644
--- a/src/arch/x86/isa/microops/ldstop.isa
+++ b/src/arch/x86/isa/microops/ldstop.isa
@@ -123,7 +123,25 @@ def template MicroLoadExecute {{
%(ea_code)s;
DPRINTF(X86, "%s : %s: The address is %#x\n", instMnem, mnemonic, EA);
- fault = xc->read(EA, (%(mem_acc_type)s%(mem_acc_size)s_t&)Mem, 0);
+ unsigned flags = 0;
+ switch(dataSize)
+ {
+ case 1:
+ fault = xc->read(EA, (uint8_t&)Mem, flags);
+ break;
+ case 2:
+ fault = xc->read(EA, (uint16_t&)Mem, flags);
+ break;
+ case 4:
+ fault = xc->read(EA, (uint32_t&)Mem, flags);
+ break;
+ case 8:
+ fault = xc->read(EA, (uint64_t&)Mem, flags);
+ break;
+ default:
+ panic("Bad operand size!\n");
+ }
+
if(fault == NoFault)
{
%(code)s;
@@ -149,7 +167,24 @@ def template MicroLoadInitiateAcc {{
%(ea_code)s;
DPRINTF(X86, "%s : %s: The address is %#x\n", instMnem, mnemonic, EA);
- fault = xc->read(EA, (%(mem_acc_type)s%(mem_acc_size)s_t&)Mem, 0);
+ unsigned flags = 0;
+ switch(dataSize)
+ {
+ case 1:
+ fault = xc->read(EA, (uint8_t&)Mem, flags);
+ break;
+ case 2:
+ fault = xc->read(EA, (uint16_t&)Mem, flags);
+ break;
+ case 4:
+ fault = xc->read(EA, (uint32_t&)Mem, flags);
+ break;
+ case 8:
+ fault = xc->read(EA, (uint64_t&)Mem, flags);
+ break;
+ default:
+ panic("Bad operand size!\n");
+ }
return fault;
}
@@ -195,8 +230,25 @@ def template MicroStoreExecute {{
if(fault == NoFault)
{
- fault = xc->write((%(mem_acc_type)s%(mem_acc_size)s_t)Mem,
- EA, 0, 0);
+ unsigned flags = 0;
+ uint64_t *res = 0;
+ switch(dataSize)
+ {
+ case 1:
+ fault = xc->write((uint8_t&)Mem, EA, flags, res);
+ break;
+ case 2:
+ fault = xc->write((uint16_t&)Mem, EA, flags, res);
+ break;
+ case 4:
+ fault = xc->write((uint32_t&)Mem, EA, flags, res);
+ break;
+ case 8:
+ fault = xc->write((uint64_t&)Mem, EA, flags, res);
+ break;
+ default:
+ panic("Bad operand size!\n");
+ }
}
if(fault == NoFault)
{
@@ -223,8 +275,25 @@ def template MicroStoreInitiateAcc {{
if(fault == NoFault)
{
- fault = xc->write((%(mem_acc_type)s%(mem_acc_size)s_t)Mem,
- EA, 0, 0);
+ unsigned flags = 0;
+ uint64_t *res = 0;
+ switch(dataSize)
+ {
+ case 1:
+ fault = xc->write((uint8_t&)Mem, EA, flags, res);
+ break;
+ case 2:
+ fault = xc->write((uint16_t&)Mem, EA, flags, res);
+ break;
+ case 4:
+ fault = xc->write((uint32_t&)Mem, EA, flags, res);
+ break;
+ case 8:
+ fault = xc->write((uint64_t&)Mem, EA, flags, res);
+ break;
+ default:
+ panic("Bad operand size!\n");
+ }
}
if(fault == NoFault)
{