Skip to content

Commit d42b62d

Browse files
committed
make sure vstart is zero when instruction early return
1 parent 0e96ba6 commit d42b62d

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

model/extensions/V/vext_fp_red_insts.sail

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ function process_rfvv_single(funct6, vm, vs2, vs1, vd, num_elem_vs, SEW, LMUL_po
6666
write_single_element(SEW, 0, vd, sum);
6767
// other elements in vd are treated as tail elements, currently remain unchanged
6868
// TODO: configuration support for agnostic behavior
69-
set_vstart(zeros());
69+
// illegal_fp_reduction checks vstart == 0, and raises illegal-instruction otherwise.
7070
RETIRE_SUCCESS
7171
}
7272

@@ -106,7 +106,7 @@ function process_rfvv_widening_reduction(funct6, vm, vs2, vs1, vd, num_elem_vs,
106106
write_single_element(SEW_widen, 0, vd, sum);
107107
// other elements in vd are treated as tail elements, currently remain unchanged
108108
// TODO: configuration support for agnostic behavior
109-
set_vstart(zeros());
109+
// illegal_fp_widening_reduction checks vstart == 0, and raises illegal-instruction otherwise.
110110
RETIRE_SUCCESS
111111
}
112112

model/extensions/V/vext_red_insts.sail

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function clause execute(RIVVTYPE(funct6, vm, vs2, vs1, vd)) = {
6464
write_single_element(SEW_widen, 0, vd, sum);
6565
// other elements in vd are treated as tail elements, currently remain unchanged
6666
// TODO: configuration support for agnostic behavior
67-
set_vstart(zeros());
67+
// illegal_widening_reduction checks vstart == 0, and raises illegal-instruction otherwise.
6868
RETIRE_SUCCESS
6969
}
7070

@@ -135,7 +135,7 @@ function clause execute(RMVVTYPE(funct6, vm, vs2, vs1, vd)) = {
135135
write_single_element(SEW, 0, vd, sum);
136136
// other elements in vd are treated as tail elements, currently remain unchanged
137137
// TODO: configuration support for agnostic behavior
138-
set_vstart(zeros());
138+
// illegal_reduction checks vstart == 0, and raises illegal-instruction otherwise.
139139
RETIRE_SUCCESS
140140
}
141141

model/extensions/V/vext_vm_insts.sail

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function clause execute(VVMTYPE(funct6, vs2, vs1, vd)) = {
4343

4444
let (initial_result, mask) : (bits('n), bits('n)) = match init_masked_result_carry(num_elem, SEW, LMUL_pow, vd_val) {
4545
Ok(v) => v,
46-
Err(()) => return Illegal_Instruction()
46+
Err(()) => return Illegal_Instruction(),
4747
};
4848
var result = initial_result;
4949

0 commit comments

Comments
 (0)