<br><br><div class="gmail_quote">On Fri, Dec 10, 2010 at 5:36 AM, Igor Stasenko <span dir="ltr">&lt;<a href="mailto:siguctua@gmail.com">siguctua@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Yeah, i just found post which confirms my guess :)<br>
<br>
<a href="http://blogs.embarcadero.com/eboling/2009/05/20/5607" target="_blank">http://blogs.embarcadero.com/eboling/2009/05/20/5607</a><br>
<br>
&lt;&lt;<br>
In the Mac OS X ABI Function Call Guide there is an innocent little<br>
sentence:  &quot;The stack is 16-byte aligned at the point of function<br>
calls.&quot;  We’ve not been able to find out why this is required for the<br>
IA-32 environment, but they really mean it, and there are deep<br>
implications.<br>
&gt;&gt;<br></blockquote><div><br></div><div>And the reason is to allow the use of sse2 instructions on locals in functions, which requires correct stack alignment because certain sse instructions will trap on unaligned addresses.  In fact this is now a general requirement on common x86 platforms, i.e. current linux variants, as well as Mac OS X.  If you have a look at Cog and the FFI code there-in you&#39;ll see it carefully maintains 16-byte stack alignment for calls form machine-code into the interpreter run-time and from the FFI to external code.  See e.g. CogIA32Compiler&gt;&gt;genAlignCStackSavingRegisters:numArgs:wordAlignment: and ReentrantFFIPlugin class&gt;&gt;perambleCCode.</div>
<div><br></div><div>cheers</div><div>Eliot</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
how nice of them, isn&#39;t?  :))<br>
<div><div></div><div class="h5"><br>
--<br>
Best regards,<br>
Igor Stasenko AKA sig.<br>
<br>
</div></div></blockquote></div><br>