summaryrefslogtreecommitdiff
path: root/src/arch/x86
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2007-08-02 15:09:12 -0700
committerGabe Black <gblack@eecs.umich.edu>2007-08-02 15:09:12 -0700
commit85b661e35d82cea3c5edd27f111cffbd4ee47f4b (patch)
tree04333220ff6c0e415bd8c08c156a6e68c7ec1878 /src/arch/x86
parente719a3e4c058920fb5913a38fbe4976d53a0e6e2 (diff)
downloadgem5-85b661e35d82cea3c5edd27f111cffbd4ee47f4b.tar.xz
X86: Fix special case with SIB index register and REX prefix.
--HG-- extra : convert_revision : b305708a722f2a08cb55c4548c5616fcbe6c5d68
Diffstat (limited to 'src/arch/x86')
-rw-r--r--src/arch/x86/emulenv.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/arch/x86/emulenv.cc b/src/arch/x86/emulenv.cc
index 3a54d7365..28282dc7a 100644
--- a/src/arch/x86/emulenv.cc
+++ b/src/arch/x86/emulenv.cc
@@ -73,7 +73,7 @@ void EmulEnv::doModRM(const ExtMachInst & machInst)
if (machInst.sib.base == INTREG_RBP && machInst.modRM.mod == 0)
base = NUM_INTREGS;
//In -this- special case, we don't use an index.
- if (machInst.sib.index == INTREG_RSP)
+ if (index == INTREG_RSP)
index = NUM_INTREGS;
} else {
if (machInst.addrSize == 2) {
@@ -82,11 +82,9 @@ void EmulEnv::doModRM(const ExtMachInst & machInst)
scale = 0;
base = machInst.modRM.rm | (machInst.rex.b << 3);
if (machInst.modRM.mod == 0 && machInst.modRM.rm == 5) {
- base = NUM_INTREGS;
//Since we need to use a different encoding of this
//instruction anyway, just ignore the base in those cases
-// if (machInst.mode.submode == SixtyFourBitMode)
-// base = NUM_INTREGS+7;
+ base = NUM_INTREGS;
}
}
}