1 /* { dg-options "-O2 --param=aarch64-ldp-policy=always -mcpu=generic" } */
6 typedef int v4si
__attribute__ ((vector_size (16)));
8 #define LDP_TEST_ALIGNED(TYPE) \
9 TYPE ldp_aligned_##TYPE(char* ptr){ \
11 TYPE *arr = (TYPE*) ((uintptr_t)ptr & ~(2 * 8 * _Alignof(TYPE) - 1)); \
17 #define LDP_TEST_UNALIGNED(TYPE) \
18 TYPE ldp_unaligned_##TYPE(char* ptr){ \
20 TYPE *arr = (TYPE*) ((uintptr_t)ptr & ~(2 * 8 * _Alignof(TYPE) - 1)); \
27 #define LDP_TEST_ADJUST_ALIGNED(TYPE) \
28 TYPE ldp_aligned_adjust_##TYPE(char* ptr){ \
29 TYPE a_0, a_1, a_2, a_3, a_4; \
30 TYPE *arr = (TYPE*) ((uintptr_t)ptr & ~(2 * 8 * _Alignof(TYPE) - 1)); \
36 return a_0 + a_1 + a_2 + a_3 + a_4; \
39 #define LDP_TEST_ADJUST_UNALIGNED(TYPE) \
40 TYPE ldp_unaligned_adjust_##TYPE(char* ptr){ \
41 TYPE a_0, a_1, a_2, a_3, a_4; \
42 TYPE *arr = (TYPE*) ((uintptr_t)ptr & ~(2 * 8 * _Alignof(TYPE) - 1)); \
49 return a_0 + a_1 + a_2 + a_3 + a_4; \
52 LDP_TEST_ALIGNED(int32_t);
53 LDP_TEST_ALIGNED(int64_t);
54 LDP_TEST_ALIGNED(v4si
);
55 LDP_TEST_UNALIGNED(int32_t);
56 LDP_TEST_UNALIGNED(int64_t);
57 LDP_TEST_UNALIGNED(v4si
);
58 LDP_TEST_ADJUST_ALIGNED(int32_t);
59 LDP_TEST_ADJUST_ALIGNED(int64_t);
60 LDP_TEST_ADJUST_UNALIGNED(int32_t);
61 LDP_TEST_ADJUST_UNALIGNED(int64_t);
63 /* { dg-final { scan-assembler-times "ldp\tw\[0-9\]+, w\[0-9\]" 6 } } */
64 /* { dg-final { scan-assembler-times "ldp\tx\[0-9\]+, x\[0-9\]" 6 } } */
65 /* { dg-final { scan-assembler-times "ldp\tq\[0-9\]+, q\[0-9\]" 2 } } */