1 /* { dg-do compile } */
2 /* { dg-skip-if "" { *-*-* } { "-march=*" } { "-march=x86-64" } } */
3 /* { dg-options "-O3 -march=x86-64 -msse2 -mno-ssse3" } */
4 /* { dg-final { scan-assembler "punpcklbw" } } */
5 extern void abort();
6 #include <emmintrin.h>
7 __m128i foo (char) __attribute__((noinline));
foo(char x)8 __m128i foo (char x) {
9 return _mm_set1_epi8(x);
10 }
11 __m128i bar (char) __attribute__((noinline));
bar(char x)12 __m128i bar (char x) {
13 return _mm_set_epi8 (x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x);
14 }
15
16 int
main()17 main() {
18 int i, j;
19 union u { __m128i v; char c[16]; };
20 union u x, y;
21 for (i = -128; i <= 127; i++)
22 {
23 x.v = foo ((char)i);
24 y.v = bar ((char)i);
25 for (j=0; j<16; j++)
26 if (x.c[j] != y.c[j])
27 abort();
28 }
29 return 0;
30 }
31
32