This is the mail archive of the cgen@sourceware.org mailing list for the CGEN project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: CGEN_DIS_HASH: how to get endianness and/or instruction size?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]