64 bit ints

Henry Spencer henry at utzoo.uucp
Sat Nov 5 04:38:18 AEST 1988


In article <2074 at ficc.uu.net> peter at ficc.uu.net (Peter da Silva) writes:
>> ... int has always been intended to be the
>> integer type "most convenient for the machine".
>
>What is the most convenient type for a 68000? 16-bit ints are much faster
>(twice as fast for loads and stores) but 32-bit ints fit the register
>architecture better.

You have just discovered Excedrin Headache number 68000 for compiler
implementors.  Which is why some 68000 C compilers go one way and some
the other.  The 68000 actually does pretty well at supporting 16-bit ints,
so I don't think "not fitting the register architecture" is a big problem.
The hard part is that it supports 32 bits well enough to be tempting
(especially since sizeof(int)==sizeof(char*) reduces breakage of poorly-
written programs) but not well enough for it to be the clear choice.
It sort of depends on whether you view the 68000 as a cut-down 68020
(in the same way the 8088 is a cut-down 8086 -- all the 8088 compilers
that I know of use 16-bit ints even though 8 would be faster!) or as a
machine in its own right.
-- 
The Earth is our mother.        |    Henry Spencer at U of Toronto Zoology
Our nine months are up.         |uunet!attcan!utzoo!henry henry at zoo.toronto.edu



More information about the Comp.lang.c mailing list