Aligning data in memory

Trass3r un at known.com
Mon Sep 19 18:08:57 PDT 2011


Am 17.09.2011, 20:11 Uhr, schrieb Adam D. Ruppe  
<destructionator at gmail.com>:

> Perhaps:
>
> void foo() {
>         struct V { align(16) float[4] v = [1.0f, 2.0f, 3.0f, 4.0f]; }
> 	V v;
> 	asm {
> 		movaps XMM0, v;
> 	}
> }
>
> It compiles, but I'm not sure if it's actually correct.

That align directive is fucked up anyways.
Why does it even exist if the value you specify doesn't change anything?

I can't make sense out of the description:
http://www.d-programming-language.org/attribute.html#align


More information about the Digitalmars-d mailing list