On 03/04/12 15:04, Ian Lance Taylor wrote:
> "Paulo J. Matos"<pa...@matos-sorge.com>  writes:
>
>
> Hmmm, you're right, I didn't notice those.  You said that on your system
> QImode is 16 bits.  These modes are being used to efficiently load
> 16-bit, 32-bit, and 64-bit values, in order to handle DW_EH_PE_udata2
> and friends.  This code is not portable in that it assumes 8 bit bytes
> and 8 bit QImode.  But I don't know how to fix it.  What is the right
> way to load a 16-bit or 32-bit value on your system?
>

Registers are 16bits. Minimum addressable unit is 16bits. QImode is 16bits, HImode is 32bits, SImode is 64bits.

Loading 16bits in my system is extremely efficient since it's just the load of a word.
ld AL, H'beef

will do it.
My guess it that changing that structure so that I use QI instead of HI, HI instead of SI and SI instead of DI will work.

>
>> There are also some references to mode SI in unwind-dw2.c.
>>
>> And there's also this:
>> unwind-dw2-fde.h:typedef int sword __attribute__ ((mode (SI)));
>>
>> Why hardcode these type sizes here?    
>
> That just looks like a bug.  It should probably use __INT32_TYPE__
> instead.
>

That would be great because it would make it a lot more portable across really weird backends, like mine. :)

--
PMatos

Reply via email to