Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/autovec/conversions/vfncvt-itof-run.c

raw
1 /* { dg-do run { target { riscv_v } } } */
2 /* { dg-additional-options "-std=c99 -fno-vect-cost-model -mrvv-vector-bits=scalable" } */
3
4 #include "vfncvt-itof-template.h"
5
6 #define RUN(TYPE1, TYPE2, NUM) \
7 TYPE1 src##TYPE1##TYPE2##NUM[NUM]; \
8 TYPE2 dst##TYPE1##TYPE2##NUM[NUM]; \
9 for (int i = 0; i < NUM; i++) \
10 { \
11 src##TYPE1##TYPE2##NUM[i] = i * 3 + 88932; \
12 } \
13 vfncvt_##TYPE1##TYPE2 (dst##TYPE1##TYPE2##NUM, src##TYPE1##TYPE2##NUM, NUM); \
14 for (int i = 0; i < NUM; i++) \
15 if (dst##TYPE1##TYPE2##NUM[i] != (TYPE2) src##TYPE1##TYPE2##NUM[i]) \
16 __builtin_abort ();
17
18 int
19 main ()
20 {
21 RUN (int64_t, float, 3)
22 RUN (int64_t, float, 4)
23 RUN (int64_t, float, 7)
24 RUN (int64_t, float, 99)
25 RUN (int64_t, float, 119)
26 RUN (int64_t, float, 128)
27 RUN (int64_t, float, 256)
28 RUN (int64_t, float, 279)
29 RUN (int64_t, float, 555)
30 RUN (int64_t, float, 1024)
31 RUN (int64_t, float, 1389)
32 RUN (int64_t, float, 2048)
33 RUN (int64_t, float, 3989)
34 RUN (int64_t, float, 4096)
35 RUN (int64_t, float, 5975)
36
37 RUN (uint64_t, float, 3)
38 RUN (uint64_t, float, 4)
39 RUN (uint64_t, float, 7)
40 RUN (uint64_t, float, 99)
41 RUN (uint64_t, float, 119)
42 RUN (uint64_t, float, 128)
43 RUN (uint64_t, float, 256)
44 RUN (uint64_t, float, 279)
45 RUN (uint64_t, float, 555)
46 RUN (uint64_t, float, 1024)
47 RUN (uint64_t, float, 1389)
48 RUN (uint64_t, float, 2048)
49 RUN (uint64_t, float, 3989)
50 RUN (uint64_t, float, 4096)
51 RUN (uint64_t, float, 5975)
52 }