Help needed on inline assembly

Hendrik Renken funsheep at gmx.net
Thu Jan 31 00:11:21 PST 2008


Jarrett Billingsley wrote:
> "Hendrik Renken" <funsheep at -[no-spam]-gmx.net> wrote in message 
> news:fnqet1$1on0$1 at digitalmars.com...
> 
>> Doesnt seem to work for me (using DMD 1.026 on linux). Or the aligment
>> is in 1.026 broken again...
> 
> Ah, it's probably because of Linux.  That code works on Windows.  I forgot 
> that DMD uses ELF on Linux like GDC.  DMD maybe can't control the alignment 
> of the data there.
> 
> Either that, or it's a genuine bug.  :\ 

i did some more testing, it seems that dynamically allocated data is 
aligned. for that i can use movaps. however statically allocated data is 
not aligned. but we can allocate 1 to 3 ints/floats/etc before the data, 
until it is aligned ;)

thanks for the help, got it working - and a speedup factor of 240! yeah. 
from 480 millisec down to 2 millisec with sse instructions.

that rocks!

regards
Hendrik


More information about the Digitalmars-d-learn mailing list