Use conditional internal functions in if-conversion
[official-gcc.git] / gcc / testsuite / gcc.target / aarch64 / sve / pack_1.c
blobd9de9963d09d45ef3d9af3a0fefbb928921557be
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -ftree-vectorize" } */
4 #include <stdint.h>
6 #define PACK(TYPED, TYPES) \
7 void __attribute__ ((noinline, noclone)) \
8 pack_##TYPED##_##TYPES (TYPED *d, TYPES *s, int size) \
9 { \
10 for (int i = 0; i < size; i++) \
11 d[i] = s[i] + 1; \
14 #define TEST_ALL(T) \
15 T (int32_t, int64_t) \
16 T (int16_t, int32_t) \
17 T (int8_t, int16_t) \
18 T (uint32_t, uint64_t) \
19 T (uint16_t, uint32_t) \
20 T (uint8_t, uint16_t)
22 TEST_ALL (PACK)
24 /* { dg-final { scan-assembler-times {\tuzp1\tz[0-9]+\.s, z[0-9]+\.s, z[0-9]+\.s\n} 2 } } */
25 /* { dg-final { scan-assembler-times {\tuzp1\tz[0-9]+\.h, z[0-9]+\.h, z[0-9]+\.h\n} 2 } } */
26 /* { dg-final { scan-assembler-times {\tuzp1\tz[0-9]+\.b, z[0-9]+\.b, z[0-9]+\.b\n} 2 } } */