Help - are we running low on registers in the following code snippet?
Is it generally better to choose MOVL over XCHG?
If XCHG is faster, how would one rearrange the C code to get XCHG in
the ASM code?
Many thanks in advance.
// --------------------- Incomplete code snippet
---------------------
// Logiciels/Informatique lcc-win32 version 3.8. (Dec 18 2007
19:12:54)
// Compile options -v -S -p6 -O
125 IntSwapBuf = *IntPtrL;
126 *IntPtrL = *IntPtrR;
127 *IntPtrR = IntSwapBuf
.line 125
movl -8(%ebp),%eax
movl (,%eax),%ecx
movl %ecx,-20(%ebp)
.line 126
movl -16(%ebp),%edx
movl (,%edx),%edx
movl %edx,(,%eax)
.line 127
movl -16(%ebp),%eax
movl %ecx,(,%eax)


|