align(16) struct member throws an exception with movdqa

jerro a at a.com
Sun Jun 10 20:35:40 PDT 2012


On Monday, 11 June 2012 at 03:19:08 UTC, ixid wrote:
>     struct a
>     {   align(16) int[4] test = [1,2,3,4];
>     }
>     a test;
>
>     asm
>     {
>             movdqa XMM0, test   ;
>             addps XMM0, XMM0    ;
>             movdpa test, XMM0   ;
>     }
>
> This works fine with unaligned movdqu but throws an access 
> violation exception with movdqa. Why isn't align letting me do 
> an aligned read? How should I do an aligned read?

One way would be to a vector type:

import core.simd;
int4 test;


More information about the Digitalmars-d-learn mailing list