Use conditional internal functions in if-conversion
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / sse2-psllq-1.c
blobc89746f54ae6a2fde2d207329713b6316dbd3429
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_psllq_1
14 #endif
16 #include <emmintrin.h>
18 #ifdef _ARCH_PWR8
19 #define TEST_FUNC(id, N) \
20 static __m128i \
21 __attribute__((noinline, unused)) \
22 test##id (__m128i s1) \
23 { \
24 return _mm_slli_epi64 (s1, N); \
27 TEST_FUNC(0, 0)
28 TEST_FUNC(15, 15)
29 TEST_FUNC(16, 16)
30 TEST_FUNC(31, 31)
31 TEST_FUNC(63, 63)
32 TEST_FUNC(neg1, -1)
33 TEST_FUNC(neg16, -16)
34 TEST_FUNC(neg32, -32)
35 TEST_FUNC(neg64, -64)
36 TEST_FUNC(neg128, -128)
37 #endif
39 #define TEST_CODE(id, N) \
40 { \
41 union128i_q u, s; \
42 long long e[2] = {0}; \
43 int i; \
44 s.x = _mm_set_epi64x (-1, 0xf); \
45 u.x = test##id (s.x); \
46 if (N >= 0 && N < 64) \
47 for (i = 0; i < 2; i++) \
48 e[i] = s.a[i] << (N * (N >= 0)); \
49 if (check_union128i_q (u, e)) \
50 abort (); \
53 static void
54 TEST (void)
56 #ifdef _ARCH_PWR8
57 TEST_CODE(0, 0);
58 TEST_CODE(15, 15);
59 TEST_CODE(16, 16);
60 TEST_CODE(31, 31);
61 TEST_CODE(63, 63);
62 TEST_CODE(neg1, -1);
63 TEST_CODE(neg16, -16);
64 TEST_CODE(neg32, -32);
65 TEST_CODE(neg64, -64);
66 TEST_CODE(neg128, -128);
67 #endif