Use conditional internal functions in if-conversion
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / sse2-psrld-1.c
blobe96cf0a3ca8322adbea81103221ebf1a0383a289
1 /* { dg-do run } */
2 /* { dg-options "-O3 -mpower8-vector -Wno-psabi" } */
3 /* { dg-require-effective-target lp64 } */
4 /* { dg-require-effective-target p8vector_hw } */
6 #ifndef CHECK_H
7 #define CHECK_H "sse2-check.h"
8 #endif
10 #include CHECK_H
12 #ifndef TEST
13 #define TEST sse2_test_psrld_1
14 #endif
16 #define N 0xf
18 #include <emmintrin.h>
20 static __m128i
21 __attribute__((noinline, unused))
22 test (__m128i s1)
24 return _mm_srli_epi32 (s1, N);
27 static void
28 TEST (void)
30 union128i_d u, s;
31 int e[4] = { 0 };
32 unsigned int tmp;
33 int i;
35 s.x = _mm_set_epi32 (1, -2, 3, 4);
37 u.x = test (s.x);
39 if (N < 32)
40 for (i = 0; i < 4; i++)
42 tmp = s.a[i];
43 e[i] = tmp >> N;
46 if (check_union128i_d (u, e))
47 #if DEBUG
49 printf ("sse2_test_psrld_1; check_union128i_d failed\n");
50 printf ("\tsrl\t([%x,%x,%x,%x],%d\n", s.a[0], s.a[1], s.a[2], s.a[3], N);
51 printf ("\t ->\t [%x,%x,%x,%x]\n", u.a[0], u.a[1], u.a[2], u.a[3]);
52 printf ("\texpect\t [%x,%x,%x,%x]\n", e[0], e[1], e[2], e[3]);
54 #else
55 abort ();
56 #endif