This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: swap (a, b) - test


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~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]