Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/autovec/unop/math-iceil-run-1.c

raw
1 /* { dg-do run { target { riscv_v } } } */
2 /* { dg-additional-options "-std=c99 -O3 -ftree-vectorize -fno-vect-cost-model -ffast-math" } */
3
4 #include "test-math.h"
5
6 #define ARRAY_SIZE 128
7
8 double in[ARRAY_SIZE];
9 int out[ARRAY_SIZE];
10 int ref[ARRAY_SIZE];
11
12 TEST_UNARY_CALL_CVT (double, int, __builtin_iceil)
13 TEST_ASSERT (int)
14
15 TEST_INIT_CVT (double, 0.0, int, __builtin_iceil (-0.0), 1)
16 TEST_INIT_CVT (double, -0.0, int, __builtin_iceil (-0.0), 2)
17 TEST_INIT_CVT (double, 1.2, int, __builtin_iceil (1.2), 3)
18 TEST_INIT_CVT (double, -1.2, int, __builtin_iceil (-1.2), 4)
19 TEST_INIT_CVT (double, 1.5, int, __builtin_iceil (1.5), 5)
20 TEST_INIT_CVT (double, -1.5, int, __builtin_iceil (-1.5), 6)
21 TEST_INIT_CVT (double, 1.8, int, __builtin_iceil (1.8), 7)
22 TEST_INIT_CVT (double, -1.8, int, __builtin_iceil (-1.8), 8)
23 TEST_INIT_CVT (double, 0.2, int, __builtin_iceil (0.2), 9)
24 TEST_INIT_CVT (double, -0.2, int, __builtin_iceil (-0.2), 10)
25 TEST_INIT_CVT (double, 0.5, int, __builtin_iceil (0.5), 11)
26 TEST_INIT_CVT (double, -0.5, int, __builtin_iceil (-0.5), 12)
27 TEST_INIT_CVT (double, 0.8, int, __builtin_iceil (0.8), 13)
28 TEST_INIT_CVT (double, -0.8, int, __builtin_iceil (-0.8), 14)
29 TEST_INIT_CVT (double, 4.0, int, __builtin_iceil (4.0), 15)
30 TEST_INIT_CVT (double, -4.0, int, __builtin_iceil (-4.0), 16)
31 TEST_INIT_CVT (double, 4503599627370495.5, int, __builtin_iceil (4503599627370495.5), 17)
32 TEST_INIT_CVT (double, 4503599627370497.0, int, __builtin_iceil (4503599627370497.0), 18)
33 TEST_INIT_CVT (double, -4503599627370495.5, int, __builtin_iceil (-4503599627370495.5), 19)
34 TEST_INIT_CVT (double, -4503599627370496.0, int, __builtin_iceil (-4503599627370496.0), 20)
35 TEST_INIT_CVT (double, 2147483647.0, int, __builtin_iceil (2147483647.0), 21)
36 TEST_INIT_CVT (double, -2147483648.0, int, __builtin_iceil (-2147483648.0), 22)
37 TEST_INIT_CVT (double, 2147483647.0000002384185791, int, 0x7fffffff, 23)
38 TEST_INIT_CVT (double, -2147483648.0000004768371582, int, __builtin_iceil (-2147483648.0000004768371582), 24)
39 TEST_INIT_CVT (double, 9223372036854774784.0, int, __builtin_iceil (9223372036854774784.0), 25)
40 TEST_INIT_CVT (double, 9223372036854775808.0, int, 0x7fffffff, 26)
41 TEST_INIT_CVT (double, -9223372036854775808.0, int, __builtin_iceil (-9223372036854775808.0), 27)
42 TEST_INIT_CVT (double, -9223372036854777856.0, int, 0x80000000, 28)
43 TEST_INIT_CVT (double, __builtin_inf (), int, __builtin_iceil (__builtin_inf ()), 29)
44 TEST_INIT_CVT (double, -__builtin_inf (), int, __builtin_iceil (-__builtin_inf ()), 30)
45 TEST_INIT_CVT (double, __builtin_nan (""), int, 0x7fffffff, 31)
46
47 int
48 main ()
49 {
50 RUN_TEST_CVT (double, int, 1, __builtin_iceil, in, out, ref, ARRAY_SIZE);
51 RUN_TEST_CVT (double, int, 2, __builtin_iceil, in, out, ref, ARRAY_SIZE);
52 RUN_TEST_CVT (double, int, 3, __builtin_iceil, in, out, ref, ARRAY_SIZE);
53 RUN_TEST_CVT (double, int, 4, __builtin_iceil, in, out, ref, ARRAY_SIZE);
54 RUN_TEST_CVT (double, int, 5, __builtin_iceil, in, out, ref, ARRAY_SIZE);
55 RUN_TEST_CVT (double, int, 6, __builtin_iceil, in, out, ref, ARRAY_SIZE);
56 RUN_TEST_CVT (double, int, 7, __builtin_iceil, in, out, ref, ARRAY_SIZE);
57 RUN_TEST_CVT (double, int, 8, __builtin_iceil, in, out, ref, ARRAY_SIZE);
58 RUN_TEST_CVT (double, int, 9, __builtin_iceil, in, out, ref, ARRAY_SIZE);
59 RUN_TEST_CVT (double, int, 10, __builtin_iceil, in, out, ref, ARRAY_SIZE);
60 RUN_TEST_CVT (double, int, 11, __builtin_iceil, in, out, ref, ARRAY_SIZE);
61 RUN_TEST_CVT (double, int, 12, __builtin_iceil, in, out, ref, ARRAY_SIZE);
62 RUN_TEST_CVT (double, int, 13, __builtin_iceil, in, out, ref, ARRAY_SIZE);
63 RUN_TEST_CVT (double, int, 14, __builtin_iceil, in, out, ref, ARRAY_SIZE);
64 RUN_TEST_CVT (double, int, 15, __builtin_iceil, in, out, ref, ARRAY_SIZE);
65 RUN_TEST_CVT (double, int, 16, __builtin_iceil, in, out, ref, ARRAY_SIZE);
66 RUN_TEST_CVT (double, int, 17, __builtin_iceil, in, out, ref, ARRAY_SIZE);
67 RUN_TEST_CVT (double, int, 18, __builtin_iceil, in, out, ref, ARRAY_SIZE);
68 RUN_TEST_CVT (double, int, 19, __builtin_iceil, in, out, ref, ARRAY_SIZE);
69 RUN_TEST_CVT (double, int, 20, __builtin_iceil, in, out, ref, ARRAY_SIZE);
70 RUN_TEST_CVT (double, int, 21, __builtin_iceil, in, out, ref, ARRAY_SIZE);
71 RUN_TEST_CVT (double, int, 22, __builtin_iceil, in, out, ref, ARRAY_SIZE);
72 RUN_TEST_CVT (double, int, 23, __builtin_iceil, in, out, ref, ARRAY_SIZE);
73 RUN_TEST_CVT (double, int, 24, __builtin_iceil, in, out, ref, ARRAY_SIZE);
74 RUN_TEST_CVT (double, int, 25, __builtin_iceil, in, out, ref, ARRAY_SIZE);
75 RUN_TEST_CVT (double, int, 26, __builtin_iceil, in, out, ref, ARRAY_SIZE);
76 RUN_TEST_CVT (double, int, 27, __builtin_iceil, in, out, ref, ARRAY_SIZE);
77 RUN_TEST_CVT (double, int, 28, __builtin_iceil, in, out, ref, ARRAY_SIZE);
78 RUN_TEST_CVT (double, int, 29, __builtin_iceil, in, out, ref, ARRAY_SIZE);
79 RUN_TEST_CVT (double, int, 30, __builtin_iceil, in, out, ref, ARRAY_SIZE);
80 RUN_TEST_CVT (double, int, 31, __builtin_iceil, in, out, ref, ARRAY_SIZE);
81
82 return 0;
83 }