[Issue 16605] core.simd generates slow/irrelevant code

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat Oct 8 05:31:44 PDT 2016


https://issues.dlang.org/show_bug.cgi?id=16605

b2.temp at gmx.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |INVALID

--- Comment #5 from b2.temp at gmx.com ---
(In reply to Malte Kießling from comment #4)
> (In reply to b2.temp from comment #3)
> > (In reply to Malte Kießling from comment #1)
> > > asm.dlang.org example that shows this: https://goo.gl/wVQjQh
> > 
> > Unfortunately this report is only based on the backend production with the
> > switch "-release", so it just remove the assertions!
> > 
> > You should retry with "-release -O -boundscheck=off"
> 
> Woops i see. With "-release -O -boundscheck=off" i get the following:
> ****
> movaps xmm4,XMMWORD PTR [rip+0x0]        # 4c <void example.doStuff()+0x4c>
>  movaps xmm0,XMMWORD PTR [rsp]
>  addps  xmm0,xmm4
>  movaps XMMWORD PTR [rsp],xmm0
>  movaps xmm1,XMMWORD PTR [rsp+0x10]
>  movaps xmm2,XMMWORD PTR [rsp]
>  addps  xmm2,xmm1
>  movaps XMMWORD PTR [rsp],xmm2
>  movaps xmm3,XMMWORD PTR [rsp]
>  movaps xmm4,XMMWORD PTR [rsp+0x10]
>  addps  xmm4,xmm3
>  movaps XMMWORD PTR [rsp+0x10],xmm4
> ****
> 
> Wich is the same.

No at all, you should have:


 push   rax
 movaps xmm2,XMMWORD PTR [rip+0x0]        # 8 <void example.doStuff()+0x8>
 movaps xmm3,XMMWORD PTR [rip+0x0]        # f <void example.doStuff()+0xf>
 xor    eax,eax
 movaps xmm0,XMMWORD PTR [rip+0x0]        # 18 <void example.doStuff()+0x18>
 addps  xmm2,xmm0
 movaps xmm1,xmm3
 addps  xmm2,xmm1
 movaps xmm4,xmm2
 addps  xmm3,xmm4
 inc    rax
 cmp    rax,0xf4240
 jb     11 <void example.doStuff()+0x11>
 pop    rax
 ret    

see https://goo.gl/C3aquU

--


More information about the Digitalmars-d-bugs mailing list