===================================================================
@@ -626,13 +626,13 @@
__sign = __builtin_ia32_pcmpgtw ((__v4hi)0LL, (__v4hi)__A);
/* Convert the four words to doublewords. */
+ __losi = (__v2si) __builtin_ia32_punpcklwd ((__v4hi)__A, __sign);
__hisi = (__v2si) __builtin_ia32_punpckhwd ((__v4hi)__A, __sign);
- __losi = (__v2si) __builtin_ia32_punpcklwd ((__v4hi)__A, __sign);
/* Convert the doublewords to floating point two at a time. */
__zero = (__v4sf) _mm_setzero_ps ();
- __ra = __builtin_ia32_cvtpi2ps (__zero, __hisi);
- __rb = __builtin_ia32_cvtpi2ps (__ra, __losi);
+ __ra = __builtin_ia32_cvtpi2ps (__zero, __losi);
+ __rb = __builtin_ia32_cvtpi2ps (__ra, __hisi);
return (__m128) __builtin_ia32_movlhps (__ra, __rb);
}
@@ -645,13 +645,13 @@
__v4sf __zero, __ra, __rb;
/* Convert the four words to doublewords. */
+ __losi = (__v2si) __builtin_ia32_punpcklwd ((__v4hi)__A, (__v4hi)0LL);
__hisi = (__v2si) __builtin_ia32_punpckhwd ((__v4hi)__A, (__v4hi)0LL);
- __losi = (__v2si) __builtin_ia32_punpcklwd ((__v4hi)__A, (__v4hi)0LL);
/* Convert the doublewords to floating point two at a time. */
__zero = (__v4sf) _mm_setzero_ps ();
- __ra = __builtin_ia32_cvtpi2ps (__zero, __hisi);
- __rb = __builtin_ia32_cvtpi2ps (__ra, __losi);
+ __ra = __builtin_ia32_cvtpi2ps (__zero, __losi);
+ __rb = __builtin_ia32_cvtpi2ps (__ra, __hisi);
return (__m128) __builtin_ia32_movlhps (__ra, __rb);
}
===================================================================
@@ -0,0 +1,39 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
+
+#include "sse-check.h"
+
+#include <xmmintrin.h>
+
+void __attribute__((noinline))
+sse_test (void)
+{
+ char image[4];
+ __m128 image4;
+ float out[4] __attribute__ ((aligned (16)));
+ int i;
+
+ for (i = 0; i < 4; i++)
+ image[i] = i + 1;
+
+ image4 =
+ _mm_cvtpi8_ps (_mm_setr_pi8
+ (image[0], image[1], image[2], image[3], 0, 0, 0, 0));
+ _mm_store_ps (out, image4);
+ _mm_empty ();
+
+ for (i = 0; i < 4; i++)
+ if (out[i] != (float) (i + 1))
+ abort ();
+
+ image4 =
+ _mm_cvtpu8_ps (_mm_setr_pi8
+ (image[0], image[1], image[2], image[3], 0, 0, 0, 0));
+ _mm_store_ps (out, image4);
+ _mm_empty ();
+
+ for (i = 0; i < 4; i++)
+ if (out[i] != (float) (i + 1))
+ abort ();
+}