2015-12-10 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / pr22432.c
blob86ae4b28f92d354160e1158f65cd50a8bf643831
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -mmmx" } */
3 /* { dg-final { scan-assembler-not "paddb" } } */
5 typedef int v2si __attribute__ ((__vector_size__ (8)));
6 typedef short v4hi __attribute__ ((__vector_size__ (8)));
7 typedef char v8qi __attribute__ ((__vector_size__ (8)));
9 int
10 foo (unsigned int *a, unsigned int *b)
12 long long i, j, k;
14 i = (long long) __builtin_ia32_vec_init_v2si (*a, 0);
15 j = (long long) __builtin_ia32_vec_init_v2si (*b, 0);
16 i = (long long) __builtin_ia32_punpcklbw ((v8qi) i, (v8qi) 0ll);
17 j = (long long) __builtin_ia32_punpcklbw ((v8qi) j, (v8qi) 0ll);
18 k = (long long) __builtin_ia32_paddw ((v4hi) i, (v4hi) j);
19 return __builtin_ia32_vec_ext_v2si ((v2si) k, 0);