summaryrefslogtreecommitdiff
path: root/src/arch/x86/predecoder.cc
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2007-07-22 02:34:52 +0000
committerGabe Black <gblack@eecs.umich.edu>2007-07-22 02:34:52 +0000
commit47b024261895adf02ca6428a9ba67db16d2172b1 (patch)
tree6145ea3cf4607b21cbb85835aedf838083b8a245 /src/arch/x86/predecoder.cc
parentbff4f765f53b371139991e531ab00a0c650410e5 (diff)
downloadgem5-47b024261895adf02ca6428a9ba67db16d2172b1.tar.xz
Fixed immediate byte accounting bug.
--HG-- extra : convert_revision : ee5275da14a2923b9a525ae5b5c582c15df4608a
Diffstat (limited to 'src/arch/x86/predecoder.cc')
-rw-r--r--src/arch/x86/predecoder.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/arch/x86/predecoder.cc b/src/arch/x86/predecoder.cc
index 2c997f34b..295ca10a4 100644
--- a/src/arch/x86/predecoder.cc
+++ b/src/arch/x86/predecoder.cc
@@ -72,7 +72,6 @@ namespace X86ISA
immediateCollected = 0;
emi.immediate = 0;
- displacementCollected = 0;
emi.displacement = 0;
emi.modRM = 0;
@@ -359,14 +358,16 @@ namespace X86ISA
{
State nextState = ErrorState;
- getImmediate(displacementCollected,
+ getImmediate(immediateCollected,
emi.displacement,
displacementSize);
DPRINTF(Predecoder, "Collecting %d byte displacement, got %d bytes.\n",
- displacementSize, displacementCollected);
+ displacementSize, immediateCollected);
- if(displacementSize == displacementCollected) {
+ if(displacementSize == immediateCollected) {
+ //Reset this for other immediates.
+ immediateCollected = 0;
//Sign extend the displacement
switch(displacementSize)
{
@@ -411,6 +412,9 @@ namespace X86ISA
if(immediateSize == immediateCollected)
{
+ //Reset this for other immediates.
+ immediateCollected = 0;
+
//XXX Warning! The following is an observed pattern and might
//not always be true!