[fpc-pascal] avx2 32-byte alignment

Jonas Maebe jonas.maebe at elis.ugent.be
Tue Nov 29 16:00:16 CET 2016


Adriaan van Os wrote:
> Jonas Maebe wrote:
>>
>> http://www.freepascal.org/docs-html/3.0.0/prog/progsu9.html
> 
> But that is the code alignment, not the data alignment
> <http://www.freepascal.org/docs-html/3.0.0/prog/progsu1.html> ?

It's for everything (there is no such thing as a "code constant" or
"code variable"). The directive is named {$codealign xxx} because IIRC
originally it only supported changing the alignment of procedures and
jump targets.

> Also note that it is the OS that specifies the alignment on the stack,
> so you probably won't get 32-byte alignment for arrays on the stack.

True, although that is a bug in the compiler (it should re-align the
stack if necessary). I did not mention this, because FPC does not allow
defining constants on the stack.


Jonas



More information about the fpc-pascal mailing list