From: Weddington, E. <Eri...@at...> - 2012-01-12 20:49:02
|
> -----Original Message----- > From: Borja Ferrer [mailto:bor...@gm...] > Sent: Thursday, January 12, 2012 1:25 PM > To: Weddington, Eric > Cc: Sherard Dames; avr...@li... > Subject: Re: [avr-llvm-devel] Current Status? > > For now I've implemented it the same way as gcc, but it's something that > popped to me when i was coding it. > I don't see how it saves space :) what I think is that you get the same > amount of pushes and std's when moving data into the stack no matter what > method is used. The difference I see is that when using std, you have to > adjust the SP pointer which creates an additional overhead. Just to > clarify I'm talking about the case when you want to pass function > arguments before a function call, not in a function prologue which is a > different story. > > In x86 it would be something like: > > sub esp, 8 > mov DWORD PTR [esp], reg1 > mov DWORD PTR [esp+4], reg 2 > call foo > ... > > instead of > > push reg1 > push reg2 > call foo > ... > > which saves 1 instruction, but in our case doing "sub esp, 8" means adding > 5 or 6 more instructions. > My x86 assembly is extremely rusty. ;-) Maybe we should work with a real test case... Do you have something that shows the issue? Eric |