diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2007-06-13 20:09:03 +0000 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2007-06-13 20:09:03 +0000 |
commit | cd8f604cc9baa65bf59ecf26e3380595418bc046 (patch) | |
tree | 691976be5db4bf48337976efbae20b9c2625cc00 /src/arch | |
parent | 5fd567425d9c2624e46dde692d8973ee8008d669 (diff) | |
download | gem5-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')
-rw-r--r-- | src/arch/alpha/predecoder.hh | 11 | ||||
-rw-r--r-- | src/arch/mips/predecoder.hh | 9 | ||||
-rw-r--r-- | src/arch/sparc/predecoder.hh | 9 | ||||
-rw-r--r-- | src/arch/x86/predecoder.cc | 22 | ||||
-rw-r--r-- | src/arch/x86/predecoder.hh | 11 |
5 files changed, 19 insertions, 43 deletions
diff --git a/src/arch/alpha/predecoder.hh b/src/arch/alpha/predecoder.hh index 650f2bfa2..0407ce99b 100644 --- a/src/arch/alpha/predecoder.hh +++ b/src/arch/alpha/predecoder.hh @@ -69,9 +69,9 @@ namespace AlphaISA //Use this to give data to the predecoder. This should be used //when there is control flow. - void moreBytes(Addr pc, Addr off, MachInst inst) + void moreBytes(Addr pc, Addr _fetchPC, Addr off, MachInst inst) { - fetchPC = pc; + fetchPC = _fetchPC; assert(off == 0); ext_inst = inst; #if FULL_SYSTEM @@ -80,13 +80,6 @@ namespace AlphaISA #endif } - //Use this to give data to the predecoder. This should be used - //when instructions are executed in order. - void moreBytes(MachInst machInst) - { - moreBytes(fetchPC + sizeof(machInst), 0, machInst); - } - bool needMoreBytes() { return true; diff --git a/src/arch/mips/predecoder.hh b/src/arch/mips/predecoder.hh index a25cce8a7..90f768d73 100644 --- a/src/arch/mips/predecoder.hh +++ b/src/arch/mips/predecoder.hh @@ -66,19 +66,12 @@ namespace MipsISA //Use this to give data to the predecoder. This should be used //when there is control flow. - void moreBytes(Addr currPC, Addr off, MachInst inst) + void moreBytes(Addr pc, Addr fetchPC, Addr off, MachInst inst) { assert(off == 0); emi = inst; } - //Use this to give data to the predecoder. This should be used - //when instructions are executed in order. - void moreBytes(MachInst machInst) - { - moreBytes(0, 0, machInst); - } - bool needMoreBytes() { return true; diff --git a/src/arch/sparc/predecoder.hh b/src/arch/sparc/predecoder.hh index 4a8c9dc4a..38d8fd1a2 100644 --- a/src/arch/sparc/predecoder.hh +++ b/src/arch/sparc/predecoder.hh @@ -67,7 +67,7 @@ namespace SparcISA //Use this to give data to the predecoder. This should be used //when there is control flow. - void moreBytes(Addr currPC, Addr off, MachInst inst) + void moreBytes(Addr pc, Addr fetchPC, Addr off, MachInst inst) { assert(off == 0); @@ -85,13 +85,6 @@ namespace SparcISA << (sizeof(MachInst) * 8)); } - //Use this to give data to the predecoder. This should be used - //when instructions are executed in order. - void moreBytes(MachInst machInst) - { - moreBytes(0, 0, machInst); - } - bool needMoreBytes() { return true; 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]) { diff --git a/src/arch/x86/predecoder.hh b/src/arch/x86/predecoder.hh index 9b4d36d4a..0708875c1 100644 --- a/src/arch/x86/predecoder.hh +++ b/src/arch/x86/predecoder.hh @@ -192,9 +192,9 @@ namespace X86ISA //Use this to give data to the predecoder. This should be used //when there is control flow. - void moreBytes(Addr currPC, Addr off, MachInst data) + void moreBytes(Addr pc, Addr fetchPC, Addr off, MachInst data) { - basePC = currPC; + basePC = fetchPC; offset = off; fetchChunk = data; assert(off < sizeof(MachInst)); @@ -202,13 +202,6 @@ namespace X86ISA process(); } - //Use this to give data to the predecoder. This should be used - //when instructions are executed in order. - void moreBytes(MachInst machInst) - { - moreBytes(basePC + sizeof(machInst), 0, machInst); - } - bool needMoreBytes() { return outOfBytes; |