Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/autovec/vls-vlmax/full-vec-move1.c

raw
1 /* { dg-do compile } */
2 /* { dg-additional-options "-std=c99 -O3 -march=rv64gcv_zvl128b -mabi=lp64d -fno-vect-cost-model -mrvv-vector-bits=zvl" } */
3
4 #include <stdint-gcc.h>
5
6 /* This would cause us to emit a vl1r.v for VNx4HImode even when
7 the hardware vector size vl > 64. */
8
9 extern int16_t test_element (int16_t);
10
11 typedef int16_t V __attribute__((vector_size (128)));
12
13 int main ()
14 {
15 V v;
16 for (int i = 0; i < sizeof (v) / sizeof (v[0]); i++)
17 (v)[i] = i;
18
19 V res = v;
20 for (int i = 0; i < sizeof (v) / sizeof (v[0]); i++)
21 test_element (res[i]);
22 }
23
24 /* { dg-final { scan-assembler-not {vl[1248]r.v} } } */
25 /* { dg-final { scan-assembler-times {vl[1248]re16.v} 1 } } */