Code Generation

Michael Meissner meissner at rtp47.UUCP
Sun Nov 24 01:12:35 AEST 1985


In article <3457 at brl-tgr.ARPA> cottrell at nbs-vms.arpa (COTTRELL, JAMES) writes:
>/* Key: >>> Ron Natalie, >> Chris Torek
>> > It doesn't ignore register short definitions, it mearly does not put them
>> > in registers because registers can only be applied to types int and long
>> > on VAX.
>> 
>> You can indeed apply
>> registers to `short's and `char's and even `float's and `double's;
>> it is merely much more difficult to get the code generation right.
>
>Why is that? For the moment lets forget about the floating types.
>From the way I read my manual, using the byte & word flavors of
>instruxions makes the registers appear to be 8 & 16 bits wide.
>So what's so difficult about that.
>

    I don't know much about the VAX pcc C compilers, but I would guess the
real problem is the semantics of C, which requires short/char items to be
converted to INT in any arithmetic expression.  Thus the 8 and 16 bit forms
of the instruction cannot be used (because they would truncate, etc.).  Also
such instructions assume that both operands are short/char.

	Michael Meissner, Data General



More information about the Comp.lang.c mailing list