64 bit ints
mcdonald at uxe.cso.uiuc.edu
mcdonald at uxe.cso.uiuc.edu
Sun Oct 30 01:48:00 AEST 1988
>Suppose I am designing a C compiler for a machine with 64bit
>words. "Char" should be 8bits of course and "long int" 64 since
>pointers will be.
>How long should an "int" be (32 or 64)?
>How about a "short int" (16/32)?
>How is this decision altered if partial word accesses
>are more expensive than full word accesses?
The answer here should be very clear:
Make the compiler so that it can handle the general case of
char 8 bits
short int 16 bits
int 32 bits
long int 64 bits.
Then allow the user to specify, either by an "install" program,
by command line switches, by a "config" file, or by (gasp) pragmas,
whatever combination of shorts, ints and longs he wants, so
long as they fit the usual rules of C. Some people will use
short = int = long int = 64 while others will put short = int = 16
and long int = 64 (to match pointers) or whatever.
Doug McDonald
More information about the Comp.lang.c
mailing list