integer moves of floating point values
Matthew Fluet
Matthew Fluet <fluet@CS.Cornell.EDU>
Wed, 9 Jan 2002 18:24:48 -0500 (EST)
> Isn't it more efficient, in terms of number of registers used, to use only a
> single register? I.e., instead of loading the high and low parts of the real
> into different 32-bit registers and then storing them, just load the high,
> store the high and then load the low and store the low.
That should be what the code is doing. Did you see an example that I sent
where this isn't the case?
> I would think that making all of this invisible except
> to the actual code generator would be the way to go, and then the aliasing
> wouldn't be a problem, but I guess that then certain possible (very local)
> optimizations wouldn't be possible.
This is done at the very last stage of register allocation; everything up
to that point is doing operations in terms of abstract memory locations.
But, the aliasing problem doesn't go away. When moving a float from SD(8)
to SD(12) I need to do the high word first, whereas moving the float in
the opposite direction requires doing the low word first.
Ah... if you thought that I first decided to implement the mem-mem f.p.
move using a gpr, did optimizations, and then did register allocation,
that is not the case. During register allocation, I see a f.p. move and
make some decision how it's going to be implemented and immediately output
the allocated assembly.