Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/base/float-point-frm-run-5.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 #define ORIGINAL_FRM 1
11 #define NEW_FRM 4
12
13 void __attribute__ ((noinline))
14 other_function ()
15 {
16 set_frm (NEW_FRM);
17 }
18
19 vfloat32m1_t __attribute__ ((noinline))
20 test_float_point_frm_run (vfloat32m1_t op1, vfloat32m1_t op2, size_t vl)
21 {
22 vfloat32m1_t result = {};
23
24 other_function ();
25 assert_equal (NEW_FRM, get_frm (), "The value of frm should be equal");
26
27 result = __riscv_vfadd_vv_f32m1_rm (op1, result, 2, vl);
28 assert_equal (2, get_frm (), "The value of frm should be equal");
29
30 result = __riscv_vfadd_vv_f32m1 (op1, result, vl);
31 assert_equal (NEW_FRM, get_frm (), "The value of frm should be equal");
32
33 return result;
34 }
35
36 int
37 main ()
38 {
39 size_t vl = 8;
40 vfloat32m1_t op1 = {};
41 vfloat32m1_t op2 = {};
42
43 set_frm (ORIGINAL_FRM);
44 test_float_point_frm_run (op1, op2, vl);
45
46 return 0;
47 }