diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2007-06-18 14:15:00 +0000 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2007-06-18 14:15:00 +0000 |
commit | 6c125779372ecc7c9482f6e79bd4c5c0c99ad7ec (patch) | |
tree | 8ed9dc671fe4c0fdd557ae08b7e706c2353fd22c /src/arch/x86/isa/base.isa | |
parent | 3ceb0a46ae98fb14d48f45338d223d6c8a2c7509 (diff) | |
download | gem5-6c125779372ecc7c9482f6e79bd4c5c0c99ad7ec.tar.xz |
Add in incomplete pick and merge functions which read and write pieces of registers, and fill out microcode disassembly.
--HG--
extra : convert_revision : 56332b3999a9079b1bd305ee2826abdf593367e1
Diffstat (limited to 'src/arch/x86/isa/base.isa')
-rw-r--r-- | src/arch/x86/isa/base.isa | 58 |
1 files changed, 57 insertions, 1 deletions
diff --git a/src/arch/x86/isa/base.isa b/src/arch/x86/isa/base.isa index eba24f709..d9bd87f2d 100644 --- a/src/arch/x86/isa/base.isa +++ b/src/arch/x86/isa/base.isa @@ -95,6 +95,14 @@ output header {{ /** * Base class for all X86 static instructions. */ + BitUnion64(X86IntReg) + Bitfield<63,0> R; + Bitfield<31,0> E; + Bitfield<15,0> X; + Bitfield<15,8> H; + Bitfield<7, 0> L; + EndBitUnion(X86IntReg) + class X86StaticInst : public StaticInst { protected: @@ -114,10 +122,50 @@ output header {{ inline uint64_t merge(uint64_t into, uint64_t val, int size) const { - //FIXME This needs to be significantly more sophisticated + X86IntReg reg; + reg = into; + //FIXME This needs to be handle high bytes as well + switch(size) + { + case 1: + reg.L = val; + break; + case 2: + reg.X = val; + break; + case 4: + //XXX Check if this should be zeroed or sign extended + reg = 0; + reg.E = val; + break; + case 8: + reg.R = val; + break; + default: + panic("Tried to merge with unrecognized size %d.\n", size); + } return val; } + inline uint64_t pick(uint64_t from, int size) + { + X86IntReg reg; + reg = from; + switch(size) + { + case 1: + return reg.L; + case 2: + return reg.E; + case 4: + return reg.X; + case 8: + return reg.R; + default: + panic("Tried to pick with unrecognized size %d.\n", size); + } + } + }; }}; @@ -128,6 +176,12 @@ output decoder {{ ccprintf(os, "\t%s ", mnemonic); } + inline void printMnemonic(std::ostream &os, + const char * instMnemonic, const char * mnemonic) + { + ccprintf(os, "\t%s : %s ", instMnemonic, mnemonic); + } + void X86StaticInst::printSrcReg(std::ostream &os, int reg) const { @@ -197,6 +251,8 @@ output decoder {{ case INTREG_R15W: ccprintf(os, "r15"); break; + default: + ccprintf(os, "t%d", reg - NUM_INTREGS); } } else if (reg < Ctrl_Base_DepTag) { ccprintf(os, "%%f%d", reg - FP_Base_DepTag); |