summaryrefslogtreecommitdiff
path: root/src/arch/x86/isa
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2007-10-02 22:57:33 -0700
committerGabe Black <gblack@eecs.umich.edu>2007-10-02 22:57:33 -0700
commit3e644b48bbbc3c0c3f3dd6bb158ea7b9c2024424 (patch)
tree358ffe6a7e3ffc1d940f4b0b4a9193278b5ce48f /src/arch/x86/isa
parenta56c651980921d210f2c48f84ce5d3445fc38475 (diff)
downloadgem5-3e644b48bbbc3c0c3f3dd6bb158ea7b9c2024424.tar.xz
X86: Fix x87 floating point stack register indexing.
--HG-- extra : convert_revision : b515ec20cbfc50b38aa7da6cf4d465acf9054c08
Diffstat (limited to 'src/arch/x86/isa')
-rw-r--r--src/arch/x86/isa/insts/x87/data_transfer_and_conversion/load_or_store_floating_point.py4
-rw-r--r--src/arch/x86/isa/microasm.isa2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/arch/x86/isa/insts/x87/data_transfer_and_conversion/load_or_store_floating_point.py b/src/arch/x86/isa/insts/x87/data_transfer_and_conversion/load_or_store_floating_point.py
index 6d56ac3bd..2a4c3f0ed 100644
--- a/src/arch/x86/isa/insts/x87/data_transfer_and_conversion/load_or_store_floating_point.py
+++ b/src/arch/x86/isa/insts/x87/data_transfer_and_conversion/load_or_store_floating_point.py
@@ -56,13 +56,13 @@
microcode = '''
def macroop FLD_M {
ldfp ufp1, seg, sib, disp
- movfp st(1), ufp1, spm=-1
+ movfp st(-1), ufp1, spm=-1
};
def macroop FLD_P {
rdip t7
ldfp ufp1, seg, riprel, disp
- movfp st(1), ufp1, spm=-1
+ movfp st(-1), ufp1, spm=-1
};
def macroop FST_M {
diff --git a/src/arch/x86/isa/microasm.isa b/src/arch/x86/isa/microasm.isa
index e961cc63c..c8bc36b69 100644
--- a/src/arch/x86/isa/microasm.isa
+++ b/src/arch/x86/isa/microasm.isa
@@ -137,7 +137,7 @@ let {{
assembler.symbols["label"] = labeler
def stack_index(index):
- return "(NUM_FLOATREGS + (%s))" % index
+ return "(NUM_FLOATREGS + (((%s) + 8) %% 8))" % index
assembler.symbols["st"] = stack_index