1 /* { dg-options "-O2 -ftree-vectorize" } */ 2 3 #include <stdint.h> 4 5 #define TEST_LOOP(TYPE1, TYPE2) \ 6 void \ 7 f_##TYPE1##_##TYPE2 (TYPE1 *restrict dst, TYPE1 *restrict src1, \ 8 TYPE2 *restrict src2, int n) \ 9 { \ 10 for (int i = 0; i < n; ++i) \ 11 dst[i] += src1[i] + src2[i]; \ 12 } 13 14 #define TEST_ALL(T) \ 15 T (uint16_t, uint8_t) \ 16 T (uint32_t, uint8_t) \ 17 T (uint64_t, uint8_t) \ 18 T (uint32_t, uint16_t) \ 19 T (uint64_t, uint16_t) \ 20 T (uint64_t, uint32_t) 21 22 TEST_ALL (TEST_LOOP) 23 24 /* { dg-final { scan-assembler-times {\tld1b\tz[0-9]+\.h,} 1 } } */ 25 /* { dg-final { scan-assembler-times {\tld1b\tz[0-9]+\.s,} 1 } } */ 26 /* { dg-final { scan-assembler-times {\tld1b\tz[0-9]+\.d,} 1 } } */ 27 /* { dg-final { scan-assembler-times {\tld1h\tz[0-9]+\.s,} 1 } } */ 28 /* { dg-final { scan-assembler-times {\tld1h\tz[0-9]+\.d,} 1 } } */ 29 /* { dg-final { scan-assembler-times {\tld1w\tz[0-9]+\.d,} 1 } } */ 30 31 /* { dg-final { scan-assembler-not {\tuxt.\t} } } */ 32