diff options
author | Steve Reinhardt <stever@eecs.umich.edu> | 2007-07-22 10:40:45 -0400 |
---|---|---|
committer | Steve Reinhardt <stever@eecs.umich.edu> | 2007-07-22 10:40:45 -0400 |
commit | 03730edc45e2e00bdec58dabc84e94c632634a1a (patch) | |
tree | affdbffcb174a9cfc0de933f3c240ae5f2813292 /src/arch/x86/emulenv.cc | |
parent | 658eeee50715d9fd334ae3fd3e0e21b6db6de0c4 (diff) | |
parent | 2cd454d102b5da828b0fbf4b66ef1a24875e69f6 (diff) | |
download | gem5-03730edc45e2e00bdec58dabc84e94c632634a1a.tar.xz |
Merge Gabe's changes with mine.
--HG--
extra : convert_revision : f50ed42e7acb3f11e610fd6976eaa8df0c6ba2ab
Diffstat (limited to 'src/arch/x86/emulenv.cc')
-rw-r--r-- | src/arch/x86/emulenv.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/arch/x86/emulenv.cc b/src/arch/x86/emulenv.cc index e3f703cff..3a54d7365 100644 --- a/src/arch/x86/emulenv.cc +++ b/src/arch/x86/emulenv.cc @@ -66,8 +66,8 @@ void EmulEnv::doModRM(const ExtMachInst & machInst) //Use the SIB byte for addressing if the modrm byte calls for it. if (machInst.modRM.rm == 4 && machInst.addrSize != 2) { scale = 1 << machInst.sib.scale; - index = machInst.sib.index; - base = machInst.sib.base; + index = machInst.sib.index | (machInst.rex.x << 3); + base = machInst.sib.base | (machInst.rex.b << 3); //In this special case, we don't use a base. The displacement also //changes, but that's managed by the predecoder. if (machInst.sib.base == INTREG_RBP && machInst.modRM.mod == 0) @@ -80,11 +80,13 @@ void EmulEnv::doModRM(const ExtMachInst & machInst) warn("I'm not really using 16 bit MODRM like I'm supposed to!\n"); } else { scale = 0; - base = machInst.modRM.rm; + base = machInst.modRM.rm | (machInst.rex.b << 3); if (machInst.modRM.mod == 0 && machInst.modRM.rm == 5) { base = NUM_INTREGS; - if (machInst.mode.submode == SixtyFourBitMode) - base = NUM_INTREGS+7; + //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; } } } |