Code Generation

Peter da Silva peter at graffiti.UUCP
Sat Nov 23 23:59:51 AEST 1985


> > 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.

The registers are not wide enough to hold a double. Also, you cannot
just change the flavors of the instructions. Consider a case where
{ register short i; register long j; short c; } are in registers. Perform
{ i=c; ... j=i; }. You have to do more than move the low word of the register.
You have to either explicitly clear the high word of i when you store
c in it, have explicitly cleared it when you entered the block, or clear
the high word of j after doing a 16-bit move from i to j.
-- 
Name: Peter da Silva
Graphic: `-_-'
UUCP: ...!shell!{graffiti,baylor}!peter
IAEF: ...!kitty!baylor!peter



More information about the Comp.lang.c mailing list