Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/base/float-point-frm-run-3.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, 4, vl);
16
17 assert_equal (4, get_frm (), "The value of frm should be equal");
18
19 result = __riscv_vfadd_vv_f32m1 (op1, result, vl);
20 result = __riscv_vfadd_vv_f32m1 (op1, result, vl);
21
22 return result;
23 }
24
25 int
26 main ()
27 {
28 size_t vl = 8;
29 vfloat32m1_t op1 = {};
30 vfloat32m1_t op2 = {};
31
32 set_frm (0);
33 test_float_point_frm_run (op1, op2, vl);
34
35 assert_equal (0, get_frm (), "The value of frm should be equal");
36
37 return 0;
38 }