2018-05-17 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / pr46419.c
blob3b722283ef328e6a2d535eba5d17c77ffbc308c9
1 /* { dg-do run } */
2 /* { dg-options "-O2 -msse" } */
3 /* { dg-require-effective-target sse } */
5 #include "sse-check.h"
7 #include <xmmintrin.h>
9 void __attribute__((noinline))
10 sse_test (void)
12 char image[4];
13 __m128 image4;
14 float out[4] __attribute__ ((aligned (16)));
15 int i;
17 for (i = 0; i < 4; i++)
18 image[i] = i + 1;
20 image4 =
21 _mm_cvtpi8_ps (_mm_setr_pi8
22 (image[0], image[1], image[2], image[3], 0, 0, 0, 0));
23 _mm_store_ps (out, image4);
24 _mm_empty ();
26 for (i = 0; i < 4; i++)
27 if (out[i] != (float) (i + 1))
28 abort ();
30 image4 =
31 _mm_cvtpu8_ps (_mm_setr_pi8
32 (image[0], image[1], image[2], image[3], 0, 0, 0, 0));
33 _mm_store_ps (out, image4);
34 _mm_empty ();
36 for (i = 0; i < 4; i++)
37 if (out[i] != (float) (i + 1))
38 abort ();