CGEN_DIS_HASH: how to get endianness and/or instruction size?
Frank Ch. Eigler
fche@redhat.com
Thu Jan 25 15:00:00 GMT 2007
Hi -
On Thu, Jan 25, 2007 at 02:20:36PM +0000, Joern Rennecke wrote:
> [...] So, inside CGEN_DIS_HASH, how can I get the first 16 bits of
> the instruction, represented in host byte order?
> If I want to dereference the buffer pointer, I need to know the
> target endianness.
Use the "value" parameter (a host-endian copy of the "base insn")
rather than the "buffer" parameter.
> If I want to use the passed instruction value, I need to know what
> size it is. [...]
See m32r_cgen_dis_hash: a hand-written baby insn classifier routine.
It is important to realize though that this disassembler hashing
widget is strictly an optimization. You can try hard-coding the hash
value to 0 like some other cgen platforms, and see if the performance
is bearable.
- FChE
More information about the Cgen
mailing list