On Tue, 21 Jun 2011, Gabe Black wrote:
The size of the immediate pulled in by IMMEDIATE is always the same
since it's the uint64_t "immediate" field of the x86 ExtMachInst. The
predecoder decides how to fill it, and it uses the tables in
src/arch/x86/predecoder_tables.cc for that. You have to use a particular
size for all instructions with the same main opcode bytes (aka it can't
change based on opcode extensions). Thankfully x86 -almost- follows this
rule, and the one exception I'm aware of is hardcoded into the
predecoder. Assuming you're grabbing a top level opcode and not doing
anything tricky, you should be able to just adjust the ImmediateType
table and get what you want. Some of the immediate types change size
based on the effective operand size, I believe, but there are also ones
that are fixed. That's determined by the SizeTypeToSize table.
enum SizeType {
NoImm,
NI = NoImm,
ByteImm,
BY = ByteImm,
WordImm,
WO = WordImm,
DWordImm,
DW = DWordImm,
QWordImm,
QW = QWordImm,
OWordImm,
OW = OWordImm,
VWordImm,
VW = VWordImm,
ZWordImm,
ZW = ZWordImm,
//The enter instruction takes -2- immediates for a total of 3
bytes
Enter,
EN = Enter,
Pointer,
PO = Pointer
};
What do VW and ZW stand for?
--
Nilay
_______________________________________________
gem5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users