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 > Assembly x86 > Re: -mregparm o...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 2 Topic 4598 of 4710
Post > Topic >>

Re: -mregparm on gcc doesnt work correctly?

by "H. Peter Anvin" <spamtrap@[EMAIL PROTECTED] > Mar 31, 2008 at 04:30 AM

junkoi wrote:
> Hi,
> 
> I have some expermentals with -mregparm option of gcc. I compile my
> code (16bit, if that matters) like this
> 
> gcc -mregparm=2 ...
> 
> So I expect that the first 2 param of a function is transferred in EAX
> and EDX, and from the 3rd params onward the params are put in stack.
> So for example calling "function(x,y,z,v)" should put "z" and "v" in
> stack.
> 
> But by disassembling my gcc-generated code, I surprised to see that it
> uses ECX for the 3rd param, and only from 4th param it uses stack. So
> in the above example, only "v" is in stack, but not "z" as expected (z
> is in ECX!!). How is that possible??
> 

Probably because anything but -mregparm=0 and -mregparm=3 gets virtually 
zero testing.

	-hpa
 




 2 Posts in Topic:
-mregparm on gcc doesnt work correctly?
junkoi <spamtrap@[EMA  2008-03-30 21:13:26 
Re: -mregparm on gcc doesnt work correctly?
"H. Peter Anvin"  2008-03-31 04:30:05 

Post A Reply:
  Go here to Signup

AddThis Feed Button


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

Contact
tan12V112 Sun Jul 6 20:29:34 CDT 2008.