SSE, Inline assembler, Structs, ...

Audun Wilhelmsen seronor at gmail.com
Thu Apr 3 12:33:09 PDT 2008


Sascha Katzner Wrote:

> Audun Wilhelmsen wrote:
> > Also, this confuses me:
> > 	Vec4 v1 = Vec4(1,2,3,4);
> > //	Vec4* p = &v1;
> > 	asm {
> > 		movaps XMM1, v1[EBP]; 
> > 	}
> > 
> > if I remove the comment, the program crashes.
> 
> It seems that this is an data alignment problem, IIRC the "a" in movAps 
> stands for "align" that means the command expects aligned data. You can 
> use movups (unaligned), but that is not as fast. Or you can align your data.
> 
> LLAP,
> Sascha

Well I've tried align, align(4) and align(16) in front of struct Vec4.. Isn't that supposed to align the data?


More information about the Digitalmars-d-learn mailing list