Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/base/float-point-frm-run-2.c

raw
1 /* { dg-do run { target { riscv_v } } } */
2 /* { dg-options "-O3" } */
3
4 #include "riscv_vector.h"
5 #include <stdio.h>
6 #include <stdint-gcc.h>
7
8 #include "float-point-frm-run.h"
9
10 vfloat32m1_t __attribute__ ((noinline))
11 test_float_point_frm_run (vfloat32m1_t op1, vfloat32m1_t op2, size_t vl)
12 {
13 vfloat32m1_t result = {};
14
15 result = __riscv_vfadd_vv_f32m1_rm (op1, result, 1, vl);
16 result = __riscv_vfadd_vv_f32m1_rm (op1, result, 2, vl);
17 result = __riscv_vfadd_vv_f32m1_rm (op1, result, 4, vl);
18
19 assert_equal (4, get_frm (), "The value of frm should be equal");
20
21 return result;
22 }
23
24 int
25 main ()
26 {
27 size_t vl = 8;
28 vfloat32m1_t op1 = {};
29 vfloat32m1_t op2 = {};
30
31 set_frm (2);
32 test_float_point_frm_run (op1, op2, vl);
33
34 assert_equal (2, get_frm (), "The value of frm should be equal");
35
36 return 0;
37 }