Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/vsetvl/pr111255.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-mrvv-vector-bits=scalable -march=rv64gcv -mabi=lp64d -O3 -mrvv-max-lmul=m2 -fno-vect-cost-model" } */
3
4 #include <stdint-gcc.h>
5
6 #define DEF_LOOP(OLD_TYPE, NEW_TYPE) \
7 void __attribute__ ((noipa)) \
8 test_##OLD_TYPE##_2_##NEW_TYPE (NEW_TYPE *__restrict r, \
9 OLD_TYPE *__restrict a, NEW_TYPE b, \
10 OLD_TYPE *__restrict pred, int n) \
11 { \
12 for (int i = 0; i < n; ++i) \
13 { \
14 r[i] = pred[i] ? (NEW_TYPE) a[i] : b; \
15 } \
16 }
17
18 /* INT -> narrower-INT */
19 #define TEST_ALL_X2X_NARROWER(T) \
20 T (int16_t, int8_t)
21
22 TEST_ALL_X2X_NARROWER (DEF_LOOP)
23
24 /* { dg-final { scan-assembler-not {\tvsetvli\t[a-x0-9]+,[a-x0-9]+,e[0-9]+,m[f0-9]+,t[au],m[au]\n\tvsetvli\t} } } */