Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/sew64-rv32.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-march=rv32gcv -mabi=ilp32d -O3 -ftree-vectorize -fno-vect-cost-model -ffast-math" } */
3
4 #include <stdint-gcc.h>
5 #include "test-math.h"
6
7 #define ARRAY_SIZE 128
8
9 float in[ARRAY_SIZE];
10 int64_t out[ARRAY_SIZE];
11 int64_t ref[ARRAY_SIZE];
12
13 TEST_UNARY_CALL_CVT (float, int64_t, __builtin_llrintf)
14 TEST_ASSERT (int64_t)
15
16
17 TEST_INIT_CVT (float, __builtin_inf (), int64_t, __builtin_llrintf (__builtin_inff ()), 19)
18 TEST_INIT_CVT (float, -__builtin_inf (), int64_t, __builtin_llrintf (-__builtin_inff ()), 20)
19 TEST_INIT_CVT (float, __builtin_nanf (""), int64_t, 0x7fffffffffffffff, 21)
20
21 int
22 main ()
23 {
24 RUN_TEST_CVT (float, int64_t, 19, __builtin_llrintf, in, out, ref, ARRAY_SIZE);
25 RUN_TEST_CVT (float, int64_t, 20, __builtin_llrintf, in, out, ref, ARRAY_SIZE);
26 RUN_TEST_CVT (float, int64_t, 21, __builtin_llrintf, in, out, ref, ARRAY_SIZE);
27
28 return 0;
29 }