SSA simplify passes

Matthew Fluet fluet@CS.Cornell.EDU
Tue, 8 Jan 2002 08:54:18 -0500 (EST)


> It it really true that for a memory-memory move we push floats into the
> floating point registers?  Or is this just for the `move in and out of argument
> positions'?

All floating point operations go through the floating point registers.
So, for example, something like this:

L (x: (real * real * real))
 val a = #1 x
 val b = #2 x
 val z = (a, b)
 z

will move the first component of x to a float register and then move it to
the first component of the allocated object.  Similarly with the second
component.

Or, even something like:

L (x: real, y: real, z: real)
 K (x, y)

will require shuffling arguments from one location to another.

For example, I see the following assembly being generated:

	fldL (0+(64*1))(%ebp)
	fstpL (0+(56*1))(%ebp)
	fldL (0+(48*1))(%ebp)
	fstpL (0+(72*1))(%ebp)

I could probably hack the register allocator to do these types of
memory-memory moves through a general purpose register.  With register
renaming, I shouldn't be slowed down by using the same register for both
components of the float (right?).

Although, I'll need to be careful of things like:

	fldL (0+(572*1))(%ebp)
	fstpL (0+(576*1))(%ebp)
	fldL (0+(564*1))(%ebp)
	fstpL (0+(560*1))(%ebp)

because the source and destinations overlap.