summaryrefslogtreecommitdiff
path: root/src/arch/x86/isa/microops/ldstop.isa
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2007-06-20 15:02:50 +0000
committerGabe Black <gblack@eecs.umich.edu>2007-06-20 15:02:50 +0000
commita68ddf685c739220d09fdc44000dd217d0707f8e (patch)
tree5026458b55d8032a56b52bba3dc35a4281e540c7 /src/arch/x86/isa/microops/ldstop.isa
parentd2ccf5e50917701a4eab9f1848c8d524ccf0c7cc (diff)
downloadgem5-a68ddf685c739220d09fdc44000dd217d0707f8e.tar.xz
Make memory instructions work better, add more macroop implementations, add an lea microop, move EmulEnv into it's own .cc and .hh.
--HG-- extra : convert_revision : 1212b8463eab1c1dcba7182c487d1e9184cf9bea
Diffstat (limited to 'src/arch/x86/isa/microops/ldstop.isa')
-rw-r--r--src/arch/x86/isa/microops/ldstop.isa73
1 files changed, 68 insertions, 5 deletions
diff --git a/src/arch/x86/isa/microops/ldstop.isa b/src/arch/x86/isa/microops/ldstop.isa
index 38b690e6a..fbff899a0 100644
--- a/src/arch/x86/isa/microops/ldstop.isa
+++ b/src/arch/x86/isa/microops/ldstop.isa
@@ -59,9 +59,6 @@
//
//////////////////////////////////////////////////////////////////////////
-
-// Load templates
-
output header {{
/**
* Base class for load and store ops
@@ -119,6 +116,58 @@ output decoder {{
}
}};
+// LEA template
+
+def template MicroLeaExecute {{
+ Fault %(class_name)s::execute(%(CPU_exec_context)s *xc,
+ Trace::InstRecord *traceData) const
+ {
+ Fault fault = NoFault;
+ Addr EA;
+
+ %(op_decl)s;
+ %(op_rd)s;
+ %(ea_code)s;
+ DPRINTF(X86, "%s : %s: The address is %#x\n", instMnem, mnemonic, EA);
+
+ %(code)s;
+ if(fault == NoFault)
+ {
+ %(op_wb)s;
+ }
+
+ return fault;
+ }
+}};
+
+def template MicroLeaDeclare {{
+ class %(class_name)s : public %(base_class)s
+ {
+ protected:
+ void buildMe();
+
+ public:
+ %(class_name)s(ExtMachInst _machInst,
+ const char * instMnem,
+ bool isMicro, bool isDelayed, bool isFirst, bool isLast,
+ uint8_t _scale, RegIndex _index, RegIndex _base,
+ uint64_t _disp, uint8_t _segment,
+ RegIndex _data,
+ uint8_t _dataSize, uint8_t _addressSize);
+
+ %(class_name)s(ExtMachInst _machInst,
+ const char * instMnem,
+ uint8_t _scale, RegIndex _index, RegIndex _base,
+ uint64_t _disp, uint8_t _segment,
+ RegIndex _data,
+ uint8_t _dataSize, uint8_t _addressSize);
+
+ %(BasicExecDeclare)s
+ };
+}};
+
+// Load templates
+
def template MicroLoadExecute {{
Fault %(class_name)s::execute(%(CPU_exec_context)s *xc,
Trace::InstRecord *traceData) const
@@ -411,13 +460,27 @@ let {{
exec_output += MicroStoreCompleteAcc.subst(iop)
class StoreOp(LdStOp):
- def __init__(self, data, addr, segment):
- super(LoadOp, self).__init__(data, addr, segment)
+ def __init__(self, data, segment, addr, disp = 0):
+ super(LoadOp, self).__init__(data, segment, addr, disp)
self.className = Name
self.mnemonic = name
microopClasses[name] = StoreOp
defineMicroLoadOp('St', 'Mem = Data;')
+
+ iop = InstObjParams("lea", "Lea", 'LdStOp',
+ {"code": "Data = merge(Data, EA, dataSize);", "ea_code": calculateEA})
+ header_output += MicroLeaDeclare.subst(iop)
+ decoder_output += MicroLdStOpConstructor.subst(iop)
+ exec_output += MicroLeaExecute.subst(iop)
+
+ class LeaOp(LdStOp):
+ def __init__(self, data, segment, addr, disp = 0):
+ super(LeaOp, self).__init__(data, segment, addr, disp)
+ self.className = "Lea"
+ self.mnemonic = "lea"
+
+ microopClasses["lea"] = LeaOp
}};