summaryrefslogtreecommitdiff
path: root/src/arch/x86/isa
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2007-10-21 18:44:50 -0700
committerGabe Black <gblack@eecs.umich.edu>2007-10-21 18:44:50 -0700
commit4d15e4cf7b2c8eb1f2232e0cbcd09893e9cb9500 (patch)
treedcc029105a1066916a0734928092fc0f6da1eadf /src/arch/x86/isa
parentd8494325f07695e810e51dffbf9daf5145b10d1a (diff)
downloadgem5-4d15e4cf7b2c8eb1f2232e0cbcd09893e9cb9500.tar.xz
X86: Implement the stupd microop ("store with update", not "stupid") and use it in ENTER.
--HG-- extra : convert_revision : 9151f701162d31ef26298497467c42b7b0ed85d5
Diffstat (limited to 'src/arch/x86/isa')
-rw-r--r--src/arch/x86/isa/insts/general_purpose/data_transfer/stack_operations.py9
-rw-r--r--src/arch/x86/isa/microops/ldstop.isa5
2 files changed, 8 insertions, 6 deletions
diff --git a/src/arch/x86/isa/insts/general_purpose/data_transfer/stack_operations.py b/src/arch/x86/isa/insts/general_purpose/data_transfer/stack_operations.py
index 4c4aec000..3ed9d8bff 100644
--- a/src/arch/x86/isa/insts/general_purpose/data_transfer/stack_operations.py
+++ b/src/arch/x86/isa/insts/general_purpose/data_transfer/stack_operations.py
@@ -169,8 +169,7 @@ def macroop ENTER_I_I {
# t1 is now the masked nesting level, and t2 is the amount of storage.
# Push rbp.
- st rbp, ss, [1, t0, rsp], "-env.dataSize"
- subi rsp, rsp, dsz
+ stupd rbp, ss, [1, t0, rsp], "-env.dataSize"
# Save the stack pointer for later
mov t6, t6, rsp
@@ -186,8 +185,7 @@ def macroop ENTER_I_I {
limm t4, "ULL(-1)", dataSize=8
topOfLoop:
ld t5, ss, [dsz, t4, rbp]
- st t5, ss, [1, t0, rsp], "-env.dataSize"
- subi rsp, rsp, dsz
+ stupd t5, ss, [1, t0, rsp], "-env.dataSize"
# If we're not done yet, loop
subi t4, t4, 1, dataSize=8
@@ -196,8 +194,7 @@ topOfLoop:
bottomOfLoop:
# Push the old rbp onto the stack
- st t6, ss, [1, t0, rsp], "-env.dataSize"
- subi rsp, rsp, dsz
+ stupd t6, ss, [1, t0, rsp], "-env.dataSize"
skipLoop:
sub rsp, rsp, t2
diff --git a/src/arch/x86/isa/microops/ldstop.isa b/src/arch/x86/isa/microops/ldstop.isa
index 32fefb5fa..c9ace4790 100644
--- a/src/arch/x86/isa/microops/ldstop.isa
+++ b/src/arch/x86/isa/microops/ldstop.isa
@@ -422,6 +422,11 @@ let {{
defineMicroStoreOp('St', 'Mem = Data;')
defineMicroStoreOp('Stfp', 'Mem = FpData.uqw;')
+ defineMicroStoreOp('Stupd', '''
+ Mem = Data;
+ Base = merge(Base, EA - SegBase, addressSize);
+ ''');
+
iop = InstObjParams("lea", "Lea", 'X86ISA::LdStOp',
{"code": "Data = merge(Data, EA, dataSize);",