[kaffe] alignment sizes of PPCs... troubles ahead

Riccardo zuse at libero.it
Wed Oct 27 02:45:41 PDT 2004


Hello,

Working with hkraemer I found out what the PPC troubles lately might be: 
alignments. This is coherent with the fact that since

2004-07-23  Guilhem Lavaux <guilhem at kaffe.org>

        * config/powerpc/common.h: Define ALIGNMENT_OF_SIZE.

I had no registered kaffe build except on darwin (which then broke too).

linux (ppc601) netbsd(ppc604e) seem to align 8 byte data on 8 byte, 
Darwin5(ppc604ev aka ppc760) and darwin6 (ppc750) seem to align it on 4 
byte.

(kaffe/developer/alignment_of_size.c) If someone wants to check on more 
os/cpu combinations to be sure, let me know....

I was starting to craft a patch right away. When I had doubts about 
machTen and AIX. FOr the first I might need a bit to set-up an 
environment, for the second... I have an unsupported (by kaffe) box,but 
I ran the test nevertheless. Here we have something even more strange:

alignment of            Char with size 1 -> 1
alignment of           Short with size 2 -> 2
alignment of             Int with size 4 -> 4
alignment of           Float with size 4 -> 4
alignment of            Long with size 4 -> 4
alignment of        LongLong with size 8 -> 8
alignment of          Double with size 8 -> 4
alignment of      CharStruct with size 1 -> 1
alignment of     ShortStruct with size 2 -> 2
alignment of       IntStruct with size 4 -> 4
alignment of     FloatStruct with size 4 -> 4
alignment of      LongStruct with size 4 -> 4
alignment of  LongLongStruct with size 8 -> 8
alignment of    DoubleStruct with size 8 -> 4

some 8bytes data are 8-byte aligned, some 4.... Since I hoped to revive 
AIX anyway one of these days (I have a POWER1 processor, aka rios for 
gcc users) this might get hairy. Any help?

-Riccardo





More information about the kaffe mailing list