diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2007-03-15 02:47:42 +0000 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2007-03-15 02:47:42 +0000 |
commit | a2b56088fb4d12aee73ecfeaba88cfa46f98567e (patch) | |
tree | 7c6787e2757e9e5d047a3b6cec1b71b4eef915f1 /src/arch/x86/types.hh | |
parent | ce18d900a17cdda2cc041b51c56e6c84fb155331 (diff) | |
download | gem5-a2b56088fb4d12aee73ecfeaba88cfa46f98567e.tar.xz |
Make the predecoder an object with it's own switched header file. Start adding predecoding functionality to x86.
src/arch/SConscript:
src/arch/alpha/utility.hh:
src/arch/mips/utility.hh:
src/arch/sparc/utility.hh:
src/cpu/base.hh:
src/cpu/o3/fetch.hh:
src/cpu/o3/fetch_impl.hh:
src/cpu/simple/atomic.cc:
src/cpu/simple/base.cc:
src/cpu/simple/base.hh:
src/cpu/static_inst.hh:
src/arch/alpha/predecoder.hh:
src/arch/mips/predecoder.hh:
src/arch/sparc/predecoder.hh:
Make the predecoder an object with it's own switched header file.
--HG--
extra : convert_revision : 77206e29089130e86b97164c30022a062699ba86
Diffstat (limited to 'src/arch/x86/types.hh')
-rw-r--r-- | src/arch/x86/types.hh | 58 |
1 files changed, 56 insertions, 2 deletions
diff --git a/src/arch/x86/types.hh b/src/arch/x86/types.hh index 3f3c1ca0e..68d95de94 100644 --- a/src/arch/x86/types.hh +++ b/src/arch/x86/types.hh @@ -59,18 +59,72 @@ #define __ARCH_X86_TYPES_HH__ #include <inttypes.h> +#include <iostream> namespace X86ISA { //This really determines how many bytes are passed to the predecoder. typedef uint64_t MachInst; + + enum Prefixes { + NoOverride = 0, + CSOverride = 1, + DSOverride = 2, + ESOverride = 3, + FSOverride = 4, + GSOverride = 5, + SSOverride = 6, + //The Rex prefix obviously doesn't fit in with the above, but putting + //it here lets us save double the space the enums take up. + Rex = 7, + //There can be only one segment override, so they share the + //first 3 bits in the legacyPrefixes bitfield. + SegmentOverride = 0x7, + OperandSizeOverride = 8, + AddressSizeOverride = 16, + Lock = 32, + Rep = 64, + Repne = 128 + }; + //The intermediate structure the x86 predecoder returns. struct ExtMachInst { - //Empty for now... + public: //XXX These should be hidden in the future + + uint8_t legacyPrefixes; + uint8_t rexPrefix; + bool twoByteOpcode; + uint8_t opcode; + uint64_t immediate; + uint64_t displacement; + + public: + + //These are to pacify the decoder for now. This will go away once + //it can handle non integer inputs, and in the mean time allow me to + //excercise the predecoder a little. + operator unsigned int() + { + return 0; + } + + ExtMachInst(unsigned int) + {;} + + ExtMachInst() + {;} }; - bool operator == (const ExtMachInst &emi1, const ExtMachInst &emi2) + inline static std::ostream & + operator << (std::ostream & os, const ExtMachInst & emi) + { + os << "{X86 ExtMachInst}"; + return os; + } + + inline static bool + operator == (const ExtMachInst &emi1, const ExtMachInst &emi2) { //Since this is empty, it's always equal return true; |