Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/base/float-point-frm-run-4.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
12 vfloat32m1_t __attribute__ ((noinline))
13 other_function (vfloat32m1_t op1, vfloat32m1_t op2, size_t vl)
14 {
15 vfloat32m1_t result = op2;
16
17 result = __riscv_vfadd_vv_f32m1 (op1, result, vl);
18
19 assert_equal (ORIGINAL_FRM, get_frm (), "The value of frm should be equal");
20
21 return result;
22 }
23
24 vfloat32m1_t __attribute__ ((noinline))
25 test_float_point_frm_run (vfloat32m1_t op1, vfloat32m1_t op2, size_t vl)
26 {
27 vfloat32m1_t result = {};
28
29 result = __riscv_vfadd_vv_f32m1_rm (op1, result, 4, vl);
30
31 assert_equal (4, get_frm (), "The value of frm should be equal");
32
33 return other_function (result, op2, vl);
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 }