September 16, 2011 Aligning data in memory / on the stack | ||||
---|---|---|---|---|
| ||||
Can anyone help me with this? http://stackoverflow.com/questions/7375165/aligning-stack-variables-in-d --- Is there a way to align data on the stack? In particular, I want to create an 16-byte aligned array of floats to load into XMM registers using movaps, which is significantly faster than movups. e.g. void foo() { float[4] v = [1.0f, 2.0f, 3.0f, 4.0f]; asm { movaps XMM0, v; // v must be 16-byte aligned for this to work. ... } } |
September 16, 2011 Re: Aligning data in memory / on the stack | ||||
---|---|---|---|---|
| ||||
Posted in reply to Peter Alexander | Peter Alexander:
> Is there a way to align data on the stack? In particular, I want to create an 16-byte aligned array of floats to load into XMM registers using movaps, which is significantly faster than movups.
Yours is a legitimate desire. I remember Don asking for this several times, and I remember Walter answering it's not an easy thing to do. I don't remember the current status of this. If others here later don't give you a good enough answer I suggest you to ask again in the main D newsgroup.
Bye,
bearophile
|
Copyright © 1999-2021 by the D Language Foundation