@@ -32,10 +32,14 @@ function process_rfvv_single(funct6, vm, vs2, vs1, vd, num_elem_vs, SEW, LMUL_po
3232 let rm_3b = fcsr [FRM ];
3333 let num_elem_vd = get_num_elem (0 , SEW ); /* vd regardless of LMUL setting */
3434
35- if illegal_fp_reduction (SEW , rm_3b ) then return Illegal_Instruction ();
35+ if illegal_fp_reduction (SEW , rm_3b ) then {
36+ return Illegal_Instruction ();
37+ };
3638 assert (SEW != 8 );
3739
38- if unsigned (vl ) == 0 then return RETIRE_SUCCESS ; /* if vl=0, no operation is performed */
40+ if unsigned (vl ) == 0 then {
41+ return RETIRE_SUCCESS ; /* if vl=0, no operation is performed */
42+ };
3943
4044 let 'n = num_elem_vs ;
4145 let 'd = num_elem_vd ;
@@ -66,7 +70,7 @@ function process_rfvv_single(funct6, vm, vs2, vs1, vd, num_elem_vs, SEW, LMUL_po
6670 write_single_element (SEW , 0 , vd , sum );
6771 /* other elements in vd are treated as tail elements, currently remain unchanged */
6872 /* TODO: configuration support for agnostic behavior */
69- set_vstart ( zeros ());
73+ // illegal_fp_reduction checks vstart == 0, and raises illegal-instruction otherwise.
7074 RETIRE_SUCCESS
7175}
7276
@@ -75,12 +79,16 @@ function process_rfvv_widening_reduction(funct6, vm, vs2, vs1, vd, num_elem_vs,
7579 let rm_3b = fcsr [FRM ];
7680 let SEW_widen = SEW * 2 ;
7781
78- if illegal_fp_widening_reduction (SEW , rm_3b , SEW_widen ) then return Illegal_Instruction ();
82+ if illegal_fp_widening_reduction (SEW , rm_3b , SEW_widen ) then {
83+ return Illegal_Instruction ();
84+ };
7985 assert (SEW >= 16 & SEW_widen <= 64 );
8086
8187 let num_elem_vd = get_num_elem (0 , SEW_widen ); /* vd regardless of LMUL setting */
8288
83- if unsigned (vl ) == 0 then return RETIRE_SUCCESS ; /* if vl=0, no operation is performed */
89+ if unsigned (vl ) == 0 then {
90+ return RETIRE_SUCCESS ; /* if vl=0, no operation is performed */
91+ };
8492
8593 let 'n = num_elem_vs ;
8694 let 'd = num_elem_vd ;
@@ -106,7 +114,7 @@ function process_rfvv_widening_reduction(funct6, vm, vs2, vs1, vd, num_elem_vs,
106114 write_single_element (SEW_widen , 0 , vd , sum );
107115 /* other elements in vd are treated as tail elements, currently remain unchanged */
108116 /* TODO: configuration support for agnostic behavior */
109- set_vstart ( zeros ());
117+ // illegal_fp_widening_reduction checks vstart == 0, and raises illegal-instruction otherwise.
110118 RETIRE_SUCCESS
111119}
112120
0 commit comments