Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/autovec/sat/vec_sat_binary_vvv_run.h

raw
1 #ifndef HAVE_DEFINED_VEC_SAT_BINARY_VVV_RUN_H
2 #define HAVE_DEFINED_VEC_SAT_BINARY_VVV_RUN_H
3
4 /* To leverage this header files for run test, you need to:
5 1. define T as the type, for example uint8_t,
6 2. defint N as the test array size, for example 16.
7 3. define RUN_VEC_SAT_BINARY as run function.
8 4. prepare the test_data for test cases.
9 */
10
11 int
12 main ()
13 {
14 unsigned i, k;
15 T out[N];
16
17 for (i = 0; i < sizeof (test_data) / sizeof (test_data[0]); i++)
18 {
19 T *op_1 = test_data[i][0];
20 T *op_2 = test_data[i][1];
21 T *expect = test_data[i][2];
22
23 RUN_VEC_SAT_BINARY (T, out, op_1, op_2, N);
24
25 for (k = 0; k < N; k++)
26 if (out[k] != expect[k])
27 __builtin_abort ();
28 }
29
30 return 0;
31 }
32
33 #endif