4 typedef signed char sc
;
5 typedef unsigned char uc
;
6 typedef signed short ss
;
7 typedef unsigned short us
;
9 typedef unsigned int ui
;
10 typedef signed long long sll
;
11 typedef unsigned long long ull
;
13 #define FOR_EACH_TYPE(M) \
20 #define TEST_VALUE(I) ((I) * 5 / 2)
22 #define ADD_TEST(TYPE) \
23 void __attribute__((noinline, noclone)) \
24 test_##TYPE (TYPE *a, int step) \
26 for (int i = 0; i < N; ++i) \
28 a[i * step + 0] = a[i * step + 0] + 1; \
29 a[i * step + 1] = a[i * step + 1] + 2; \
30 a[i * step + 2] = a[i * step + 2] + 4; \
31 a[i * step + 3] = a[i * step + 3] + 8; \
34 void __attribute__((noinline, noclone)) \
35 ref_##TYPE (TYPE *a, int step) \
37 for (int i = 0; i < N; ++i) \
39 a[i * step + 0] = a[i * step + 0] + 1; \
40 a[i * step + 1] = a[i * step + 1] + 2; \
41 a[i * step + 2] = a[i * step + 2] + 4; \
42 a[i * step + 3] = a[i * step + 3] + 8; \
47 #define DO_TEST(TYPE) \
48 _Pragma("GCC novector") \
49 for (int j = -M; j <= M; ++j) \
51 TYPE a[N * M], b[N * M]; \
52 for (int i = 0; i < N * M; ++i) \
53 a[i] = b[i] = TEST_VALUE (i); \
54 int offset = (j < 0 ? N * M - 4 : 0); \
55 test_##TYPE (a + offset, j); \
56 ref_##TYPE (b + offset, j); \
57 if (__builtin_memcmp (a, b, sizeof (a)) != 0) \
61 FOR_EACH_TYPE (ADD_TEST
)
66 FOR_EACH_TYPE (DO_TEST
)
70 /* { dg-final { scan-tree-dump-not "using an address-based" "vect" } } */
71 /* { dg-final { scan-tree-dump-not "using an index-based" "vect" } } */