This is the mail archive of the
cgen@sourceware.org
mailing list for the CGEN project.
CGEN_DIS_HASH: how to get endianness and/or instruction size?
- From: Joern Rennecke <joernr at arc dot com>
- To: cgen at sources dot redhat dot com
- Date: Thu, 25 Jan 2007 14:20:36 +0000
- Subject: CGEN_DIS_HASH: how to get endianness and/or instruction size?
The ARCompact architecture has both 16 and 32 bit opcodes, and each can
take an optional 32 bit immediate. Moreover, this is a bi-endian
architecture.
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.
If I want to use the passed instruction value, I need to know what size it
is. Note that there are valid 32 bit opcodes which have all upper 16 bits
cleared.
It is also not quite clear if I can use this value if there is a 32 bit
immediate attached to the opcode.