On 7/5/2016 6:06 PM, deadalnix wrote:
On Tuesday, 5 July 2016 at 23:56:48 UTC, Walter Bright wrote:
On 7/5/2016 2:44 PM, ketmar wrote:
anyway, fixing long-standing bug with `align()` being ignored on stack variables
will allow to use SIMD on x86.

Not really. The alignment requirement has to be done by all functions, whether
they use SIMD or not.


The intel performance optimization manual have some nice trick to mix code with
different stack alignment.

You may want to check that out. Sadly, I can't find the article right now, but
mostly it boils down to :
 - as the stack grow down, you can mask the stack pointer at function entry to
get it aligned.
 - If both caller and callee both need alignment, callee can call/jump over the
masking instructions directly into the meat of the callee.


The trouble with that is you lose the ability to use EBP as a general purpose register, as you'll need EBP to point to the parameters and ESP to point to the locals.

It's a complex and disruptive change to the code generator.

It's certainly doable, but in an age of priorities I suspect the time is better spent on improving 64 bit code generation.

Reply via email to