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: BITS_PER_UNIT less than 8


Boris Boesler writes:
> 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

I don't know if it's useful to define the size of a byte to be less than
8-bits, even if that more accurately reflects the hardware.  Standard C
requires that the char type both be at least 8 bits (UCHAR_MAX >= 256)
and the same size as a byte (sizeof(char) == 1).  You can't define any
types that are smaller than a char and have sizeof work correctly.

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

If you think there's still some benefit from having GCC use a 1-bit byte,
you'll probably have to fix a number of assumptions made in the code.
Things like that the size of a byte is at least 8 bits and is the same
in frontend and backend.

					Ross Ridge


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