Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/base/pr115456-3.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-march=rv64gcv_zvfh -mabi=lp64d -O3 -ftree-vectorize" } */
3
4 #include <assert.h>
5 #include <stdint-gcc.h>
6
7 typedef _Float16 vnx4f __attribute__ ((vector_size (8)));
8
9 vnx4f __attribute__ ((noinline, noclone))
10 test_5 (vnx4f x, vnx4f y)
11 {
12 return __builtin_shufflevector (x, y, 1, 3, 6, 7);
13 }
14
15 int
16 main (void)
17 {
18 vnx4f test_5_x = {0, 1, 3, 4};
19 vnx4f test_5_y = {4, 5, 6, 7};
20 vnx4f test_5_except = {1, 4, 6, 7};
21 vnx4f test_5_real;
22 test_5_real = test_5 (test_5_x, test_5_y);
23
24 for (int i = 0; i < 4; i++)
25 assert (test_5_real[i] == test_5_except[i]);
26
27 return 0;
28 }
29
30 /* { dg-final { scan-assembler-not {call\s+__extendhfsf2} } } */
31 /* { dg-final { scan-assembler-times {vfmv\.f\.s\s+fa[0-9]+,\s*v[0-9]+} 4 } } */