This is the mail archive of the
cgen@sourceware.org
mailing list for the CGEN project.
Re: CGEN_DIS_HASH: how to get endianness and/or instruction size?
- From: "Frank Ch. Eigler" <fche at redhat dot com>
- To: Joern Rennecke <joernr at arc dot com>
- Cc: cgen at sources dot redhat dot com
- Date: Thu, 25 Jan 2007 09:59:50 -0500
- Subject: Re: CGEN_DIS_HASH: how to get endianness and/or instruction size?
- References: <20070125142036.GA18395@elsdt-razorfish.arc.com>
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