summaryrefslogtreecommitdiff
path: root/src/arch/x86/predecoder.cc
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2007-06-13 20:09:03 +0000
committerGabe Black <gblack@eecs.umich.edu>2007-06-13 20:09:03 +0000
commitcd8f604cc9baa65bf59ecf26e3380595418bc046 (patch)
tree691976be5db4bf48337976efbae20b9c2625cc00 /src/arch/x86/predecoder.cc
parent5fd567425d9c2624e46dde692d8973ee8008d669 (diff)
downloadgem5-cd8f604cc9baa65bf59ecf26e3380595418bc046.tar.xz
Seperate the pc-pc and the pc of the incoming bytes, and get rid of the "moreBytes" which just takes a MachInst.
src/arch/x86/predecoder.cc: Seperate the pc-pc and the pc of the incoming bytes, and get rid of the "moreBytes" which just takes a MachInst. Also make the "opSize" field describe the number of bytes and not the log of the number of bytes. --HG-- extra : convert_revision : 3a5ec7053ec69c5cba738a475d8b7fd9e6e6ccc0
Diffstat (limited to 'src/arch/x86/predecoder.cc')
-rw-r--r--src/arch/x86/predecoder.cc22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/arch/x86/predecoder.cc b/src/arch/x86/predecoder.cc
index c99b0cfb0..5c98a1831 100644
--- a/src/arch/x86/predecoder.cc
+++ b/src/arch/x86/predecoder.cc
@@ -209,34 +209,38 @@ namespace X86ISA
//Figure out the effective operand size. This can be overriden to
//a fixed value at the decoder level.
+ int logOpSize;
if(/*FIXME long mode*/1)
{
- if(emi.rex && emi.rex.w)
- emi.opSize = 3; // 64 bit operand size
+ if(emi.rex.w)
+ logOpSize = 3; // 64 bit operand size
else if(emi.legacy.op)
- emi.opSize = 1; // 16 bit operand size
+ logOpSize = 1; // 16 bit operand size
else
- emi.opSize = 2; // 32 bit operand size
+ logOpSize = 2; // 32 bit operand size
}
else if(/*FIXME default 32*/1)
{
if(emi.legacy.op)
- emi.opSize = 1; // 16 bit operand size
+ logOpSize = 1; // 16 bit operand size
else
- emi.opSize = 2; // 32 bit operand size
+ logOpSize = 2; // 32 bit operand size
}
else // 16 bit default operand size
{
if(emi.legacy.op)
- emi.opSize = 2; // 32 bit operand size
+ logOpSize = 2; // 32 bit operand size
else
- emi.opSize = 1; // 16 bit operand size
+ logOpSize = 1; // 16 bit operand size
}
//Figure out how big of an immediate we'll retreive based
//on the opcode.
int immType = ImmediateType[emi.opcode.num - 1][nextByte];
- immediateSize = SizeTypeToSize[emi.opSize - 1][immType];
+ immediateSize = SizeTypeToSize[logOpSize - 1][immType];
+
+ //Set the actual op size
+ emi.opSize = 1 << logOpSize;
//Determine what to expect next
if (UsesModRM[emi.opcode.num - 1][nextByte]) {