Code Generation

Chris Torek chris at umcp-cs.UUCP
Mon Nov 25 22:53:08 AEST 1985


In article <462 at graffiti.UUCP> peter at graffiti.UUCP (Peter da Silva) writes:

[me]
> > > 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.

[Jim Cottrell]
> > Why is that? ...

> The registers are not wide enough to hold a double.

No, but then they never were.  The double precision instructions
operate on register pairs (shades of the 370! :-) ), when they
operate on registers at all.

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

That is not really necessary.  All you need is `cvtwl rI,rJ'.

But all this just goes to demonstrate my original point.  The code
generation gets messier, and that makes it harder:  That is the main
reason no one has done it, except maybe Tartan Labs---and they are
not exactly giving it away....
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 4251)
UUCP:	seismo!umcp-cs!chris
CSNet:	chris at umcp-cs		ARPA:	chris at mimsy.umd.edu



More information about the Comp.lang.c mailing list