Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Compilers LCC > lccwin32 genera...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 1017 of 1062
Post > Topic >>

lccwin32 generates MOVs instead of XCHG when swapping a pair of 32bit

by MatlabMonkey@[EMAIL PROTECTED] Jan 16, 2008 at 09:37 AM

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)
 




 2 Posts in Topic:
lccwin32 generates MOVs instead of XCHG when swapping a pair of
MatlabMonkey@[EMAIL PROTE  2008-01-16 09:37:06 
Re: lccwin32 generates MOVs instead of XCHG when swapping a pair
jacob navia <jacob@[EM  2008-01-16 19:55:54 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 2:48:52 CDT 2008.