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]

BITS_PER_UNIT less than 8 (was: Re: BITS_PER_UNIT larger than 8 -- word addressing)



Am 05.12.2007 um 22:32 schrieb Ian Lance Taylor:


Boris Boesler <baembel@gmx.de> writes:

  I assume that GCC internals assume that memory can be byte (8 bits)
addressed - for historical reasons.

No. gcc internals assume that memory can be addressed in units of size BITS_PER_UNIT. The default for BITS_PER_UNIT is 8. I have written backends for machines for which that is not true.

It is unusual, and there is only one official target with
BITS_PER_UNIT != 8 (c4x), so there is often some minor breakage.

Ok, so what have I to do to write a back-end where all addresses are given in bits? Memory is addressed in bits, not bytes. So I set:


#define BITS_PER_UNIT 1
#define UNITS_PER_WORD 32

(As far as I can see, offsets are divided by BITS_PER_UNIT, so this seems to be a precondition for bit addressing.)

All sizes and and boundary are set to 32. SImode is only four bits wide, so I added the integer modes OI and XI:
INT_MODE(OI, 32)
INT_MODE(XI, 64)


In builtin_define_type_max I added the case "1", which will return without doing anything.

Without these changes the compiler stops with internal error mesages. With these changes gcc/cc1 generates a bus error.

So, what can I do to get this running for my architecture?

Thanks in advance,
Boris


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