[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / unpack-vectorize.h
blob11fa7d4aa6f8e03d1d1a5cc29028b4015fb21214
1 typedef signed long long sll;
2 typedef unsigned long long ull;
3 typedef signed int si;
4 typedef unsigned int ui;
5 typedef signed short sh;
6 typedef unsigned short uh;
7 typedef signed char sc;
8 typedef unsigned char uc;
10 #ifndef ALIGN
11 #define ALIGN 32
12 #endif
14 #define ALIGN_ATTR __attribute__((__aligned__(ALIGN)))
16 #define N 128
18 #define DEF_ARR(TYPE) \
19 TYPE TYPE##_a[N] ALIGN_ATTR; \
20 TYPE TYPE##_b[N] ALIGN_ATTR; \
21 TYPE TYPE##_c[N] ALIGN_ATTR;
23 #define TEST1(NTYPE, WTYPE) \
24 __attribute__((noipa)) void test1_##NTYPE##_##WTYPE() { \
25 for (int i = 0; i < N; i++) \
26 WTYPE##_c[i] = NTYPE##_a[i] + NTYPE##_b[i]; \
29 #define CHECK1(NTYPE, WTYPE) \
30 __attribute__((noipa, optimize(0))) void check1_##NTYPE##_##WTYPE() { \
31 for (int i = 0; i < N; i++) { \
32 NTYPE##_a[i] = 2 * i * sizeof(NTYPE) + 10; \
33 NTYPE##_b[i] = 7 * i * sizeof(NTYPE) / 5 - 10; \
34 } \
35 test1_##NTYPE##_##WTYPE(); \
36 for (int i = 0; i < N; i++) { \
37 WTYPE exp = NTYPE##_a[i] + NTYPE##_b[i]; \
38 if (WTYPE##_c[i] != exp) \
39 __builtin_abort(); \
40 } \