64 bit ints
Gordon Cross
crossgl at ingr.UUCP
Tue Nov 1 04:21:15 AEST 1988
In article <6264 at june.cs.washington.edu>, david at june.cs.washington.edu (David Callahan) writes:
>
> 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?
As I recall the proposed ANSI standard states that the type "int" should be
the size which is most "natural" or efficient on the target machine. This
has been 32-bits on all 64-bit machines I've seen. If your machine has a
64-bit word size and a halfword (32 bits) access is more expensive then perhaps
a 64-bit "int" is appropiate. Seems like that if your machine has support
for 8, 16, 32, AND 64 bit integers then your only choice would have to be
char 8 bits
short 16 bits
int 32 bits
long 64 bits
unless someone wants to introduce "short short int" and/or "long long int"!!!!
Gordon Cross
Intergraph Corp. Huntsville, AL
More information about the Comp.lang.c
mailing list