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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |x86_64-*-*
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-01-12
          Component|c                           |target
      Known to work|                            |4.7.0
     Ever Confirmed|0                           |1
      Known to fail|                            |4.6.2

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-01-12 
09:11:55 UTC ---
Confirmed.  Reduced testcase:

typedef signed short int16_t;
typedef unsigned short uint16_t;
typedef char v8qi __attribute__ ((vector_size (8)));
typedef uint16_t v4hu __attribute__ ((vector_size (8)));
typedef int16_t v4hi __attribute__ ((vector_size (8)));
v4hu v4hu_ (uint16_t const i);
void rgb_to_YCrCb (v8qi * const y, v8qi * const u, v8qi * const v,        
                   v8qi const r, v8qi const g, v8qi const b, uint16_t *c)
{
    v8qi const zero8 = { 0,0,0,0,0,0,0,0 };
    v4hu r0 = (v4hu) __builtin_ia32_punpckhbw (zero8, r);
    v4hu r1 = (v4hu) __builtin_ia32_punpcklbw (zero8, r);
    v4hu g0 = (v4hu) __builtin_ia32_punpckhbw (zero8, g);
    v4hu g1 = (v4hu) __builtin_ia32_punpcklbw (zero8, g);
    v4hu b0 = (v4hu) __builtin_ia32_punpckhbw (zero8, b);
    v4hu b1 = (v4hu) __builtin_ia32_punpcklbw (zero8, b);
    v4hu y0 = (v4hu_(c[0]) * r0 + v4hu_(c[1]) * g0 + v4hu_(c[2]) * b0) >> 8;
    v4hu y1 = (v4hu_(c[0]) * r1 + v4hu_(c[1]) * g1 + v4hu_(c[2]) * b1) >> 8;
    *y = (v8qi)__builtin_ia32_packsswb ((v4hi)y0, (v4hi)y1);
}

fails at -O2.  4.5 does not support the shifts for vectors, fixed for 4.7.

Reply via email to