swap (a, b) - test

Richard Henderson rth@cygnus.com
Sun Jan 4 22:14:00 GMT 1998


On Sun, Jan 04, 1998 at 01:57:49PM -0500, Eric Buddington wrote:
> However, a quick test now is now running slower with the XOR swap. I
> don't see why three XOR operations on two ints would be slower
> than three assignments among three ints...

Ideally the register allocator can elide the swap altogether by
logically swapping what register it believes a value to reside in.

Certainly it would not be possible all of the time, and I think
things are in practice hindered by the fact that pseudos are 
currently allocated (or not) a single register for their entire 
life span.  


r~



More information about the Gcc mailing list