On 5 January 2012 23:53, Sean Kelly <sean@invisibleduck.org> wrote:
I recall Walter rejecting the idea because compilers shouldn't optimize across asm blocks.  This should probably be revisited at some point.

It's proven then, inline asm blocks break the optimiser... they are officially useless. This is why all C coders use intrinsics these days, and D should too.
 
> How so? Parameters are passed in a sequence of regs of the appropriate type, to a point, at which stage they get put on the stack... is x64 somehow more complicated than that?
> Multiple return values would use the exact same regs in reverse. There should be no side effects, the calling function has already (or has the caoability to) stored off any save regs in order to pass args in the first place.

No, that's exactly how x64 works.  But compared to x32 where everything is simply pushed onto the stack…  That's all I was saying.

Ah yes, I forgot... x86 is such a shit architecture! ;) .. I rarely write x86 code, it's fairly pointless usually. Chips don't execute the opcodes you write anyway, they reinterpret and microcode them.. you can never know what's best, and it's different for every x86 processor/vendor :P
Despite the assembly you read, x86 doesn't REALLY push all those args to the stack, they have much larger register banks internally, and use them... finally, x64 put an end to the nostalgic x86 nonsense :)