This is the mail archive of the cgen@sources.redhat.com 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]

Re: Endianness and CGEN_INT_INSN_P


On Tue, 2 Jan 2001, Dave Brolley wrote:

>  From what I understand, CGEN_INT_INSN_P will not be true if there is at 
> least one insn which will not fit into the word.

Do you mean host or target word?  As it stands, the macro gets set to 1
whenever the longest instruction is 32 bits or less, i.e. whenever it can
fit into an int.  But the code that handles instructions as integers
seems to assume that every instruction can fit into one *target* word.
It builds the instruction as an int without considering endianness, then
it stores that integer in either big or little endian form, depending
on the target.  But, in a 16-bit arch, the two-word insn "AABB
CCDD" gets stored as "BB AA DD CC" when the macro is false and "DD CC BB 
AA" when it is true.

Richard



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