Take the following code:
#define vector __attribute__((vector_size(16)))

float a; float b;
vector float fb(void) { return (vector float){ 0,0,b,a};}
--------
Currently we produce:
        movss   _a, %xmm1
        movss   _b, %xmm0
        unpcklps        %xmm1, %xmm0
        movaps  %xmm0, %xmm1
        xorps   %xmm0, %xmm0
        movlhps %xmm1, %xmm0
        ret
-----

But from what I hear the xorps and movlhps are useless instructions because 
those bits are already 
zero.

-- 
           Summary: (vector float){0, 0, b, a} code gen as not good as it
                    should be
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Keywords: missed-optimization, ssemmx
          Severity: minor
          Priority: P2
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: i786-pc-darwin7.9


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24074

Reply via email to