[squeak-dev] Cog+NativeBoost @ Mac OS

Eliot Miranda eliot.miranda at gmail.com
Fri Dec 10 18:14:07 UTC 2010


On Fri, Dec 10, 2010 at 5:36 AM, Igor Stasenko <siguctua at gmail.com> wrote:

> Yeah, i just found post which confirms my guess :)
>
> http://blogs.embarcadero.com/eboling/2009/05/20/5607
>
> <<
> In the Mac OS X ABI Function Call Guide there is an innocent little
> sentence:  "The stack is 16-byte aligned at the point of function
> calls."  We’ve not been able to find out why this is required for the
> IA-32 environment, but they really mean it, and there are deep
> implications.
> >>
>

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'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>>genAlignCStackSavingRegisters:numArgs:wordAlignment: and
ReentrantFFIPlugin class>>perambleCCode.

cheers
Eliot



>
> how nice of them, isn't?  :))
>
> --
> Best regards,
> Igor Stasenko AKA sig.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20101210/d53b13de/attachment.htm


More information about the Squeak-dev mailing list