Using inline assembler

2014-10-09 Thread Etienne via Digitalmars-d-learn
I'm a bit new to the inline assembler, I'm trying to use the `movdqu` operation to move a 128 bit double quadword from a pointer location into another location like this: align(16) union __m128i { ubyte[16] data }; void store(__m128i* src, __m128i* dst) { asm { movdqu [dst], src; } }

Re: Using inline assembler

2014-10-09 Thread anonymous via Digitalmars-d-learn
On Thursday, 9 October 2014 at 12:37:20 UTC, Etienne wrote: I'm a bit new to the inline assembler, I'm trying to use the `movdqu` operation to move a 128 bit double quadword from a pointer location into another location like this: align(16) union __m128i { ubyte[16] data }; void store(__m128i

Re: Using inline assembler

2014-10-09 Thread Etienne via Digitalmars-d-learn
On 2014-10-09 8:54 AM, anonymous wrote: This compiles: align(16) union __m128i { ubyte[16] data; } /* note the position of the semicolon */ void store(__m128i* src, __m128i* dst) { asm { movdqu XMM0, [src]; /* note: [src] */ movdqu [dst], XMM0; } } Yes, t

Re: Using inline assembler

2014-10-09 Thread Etienne via Digitalmars-d-learn
Maybe someone can help with the more specific problem. I'm translating a crypto engine here: https://github.com/etcimon/botan/blob/master/source/botan/block/aes_ni/aes_ni.d But I need this to work on DMD, LDC and GDC. I decided to write the assembler code directly for the functions in this mod

Re: Using inline assembler

2014-10-09 Thread anonymous via Digitalmars-d-learn
On Thursday, 9 October 2014 at 13:29:27 UTC, Etienne wrote: On 2014-10-09 8:54 AM, anonymous wrote: This compiles: align(16) union __m128i { ubyte[16] data; } /* note the position of the semicolon */ void store(__m128i* src, __m128i* dst) { asm { movdqu XMM0, [src]; /* not

Re: Using inline assembler

2014-10-09 Thread Etienne via Digitalmars-d-learn
On 2014-10-09 9:46 AM, anonymous wrote: I'm out of my knowledge zone here, but it seems to work when you move the pointers to registers first: void store(__m128i* src, __m128i* dst) { asm { mov RAX, src; mov RBX, dst; movdqu XMM0, [RAX]; movdqu