Code Generation (register byte, short...)

Dick Dunn rcd at opus.UUCP
Tue Nov 26 16:02:04 AEST 1985


> [on a 68000 where short*short is a single instruction, but int*int requires a
> procedure call ]
> 
> Thats what you get for using a machine that calims to be 32-bit when it really
> is 16-bit. Dont know how to help you with your gripe but "int" exists to
> represent the natural size of the machine..... in my interpretation that
> would be the size that works best, fastest etc.

Did you escape from a marketing department, or what?  Go tighten up your
tie 'til your eyes bug out.

The 68000 and 68010 are described by Motorola as 16-bit microprocessors.
See, for example, the manual called "MC68010 16-BIT VIRTUAL MEMORY
MICROPROCESSOR" from Motorola.  Hint:  Even the title will (might?) give
you a clue.  They didn't start calling th 68000 family 32-bit processors
until the 68020, in spite of having 32-bit registers and 32-bit
add/subtract/logical instructions all along.

A choice of 16-bit ints for C for the 68000/68010 would be idiotic.  (Yes,
I know a few people have done it.  That makes it no less idiotic.)  Issues
are at least array indices and differences of pointers.

Really, there's a matter that some machines don't have a handy-dandy black
and white definition of what the natural size of integer for the machine
is.  32-bit ints make a lot of sense for the 680[01]0, but multiplies and
divides are expensive.  Implementor makes a choice and you do what you
can.  More modern languages ought to be able to cope with machines which
don't have a single obvious choice of length for all possible forms of
integer.
-- 
Dick Dunn	{hao,ucbvax,allegra}!nbires!rcd		(303)444-5710 x3086
   ...If you get confused just listen to the music play...



More information about the Comp.lang.c mailing list