[Issue 10226] core.simd bad codegen

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jun 3 03:43:36 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10226


Manu <turkeyman at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |turkeyman at gmail.com


--- Comment #2 from Manu <turkeyman at gmail.com> 2013-06-03 03:43:34 PDT ---
(In reply to comment #1)
> Small correction, ideal assembly should look like this:
> 
> 1 mov         rax,qword ptr [rbp-68h]  
> 2 movaps      xmm0,xmmword ptr [rax]  
> 5 addps       xmm0,xmm0
> 9 movaps      xmmword ptr [rax],xmm0 
> 
> Instruction 5 should use a xmm register as well and not add from memory.

Interesting. I haven't scrutinised DMD's codegen as much as GDC yet.
I've been working on the std.simd API mostly against GDC, and once I'm happy
with that, I'll be logging codegen bugs in DMD accordingly.

What do you get if you do:

    float4 result = [1,2,3,4];
    result = __simd(XMM.ADDPS, result, result);
    writefln("%s", result.array);

Why do you need to issue the loads and stores explicitly?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list