|how to generate code for (a,b):=(b,a) firstname.lastname@example.org (1997-05-05)|
|Re: how to generate code for (a,b):=(b,a) email@example.com (David L Moore) (1997-05-08)|
|Choice of optimisations (was Re: how to generate code for (a,b):=(b,a) firstname.lastname@example.org (1997-05-16)|
|From:||email@example.com (Peach Microsystems)|
|Date:||16 May 1997 23:44:01 -0400|
David L Moore <firstname.lastname@example.org> wrote:
:When you don't have any free registers, it should be possible to achieve
:the same result with a series of xors instead of moves. For example, two
:registers can be exchanged with the sequence:
: xor a,b
: xor b,a
: xor a,b
Are there (should there be?) compilers that let the programmer
give more than one version of something & let the compiler pick?
e.g you give code above & a version using a temporary variable.
Programmer knows two blocks are equivalent. Compiler chooses
whichever it can optimise better.
Methinks this would give some lovely headaches in debugging,
but would it also mean faster code?
Return to the
Search the comp.compilers archives again.