This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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: m32c: pointer math vs sizetype again


DJ Delorie wrote:
I think this is the wrong place to fix this. If you would override
the sizetypes precision from your target, would that fix it? That
is, in stor-layout.c set_sizetype make the target allow adjusting
the passed type (which is supposed to be sizetype). If at all then
these types should be consistent.

The problem is that the chip has 24 bit pointers, but 16 bit registers. It has math operations for 16 bit numbers and some 32 bit numbers (the rest are emulated). It has a few operations for 24 bit numbers. There are no C types for 24 bit numbers (PSImode is 32 bits wide with 24 bit precision, if I tweak its precision manually it tries to use bitfield instructions all over the place, if I don't it uses "long int" which is wrong).

All I want for now is to treat ptr+int as a signed addition, not an
unsigned one. My patch is just trying to detect the case where a sign
extension is needed at all, and insert it.
Can you look in the CVS/SVN archives and see what the mn102 port did -- it had the same core properties as the chip you're describing. It was a 16/24 bit chip (true 24bit address registers), mostly 16bit ops with a few 24bit ops. All 32bit ops were synthesized.



Jeff


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