Skip to content

Commit

Permalink
Vector: Remove some unused result variables
Browse files Browse the repository at this point in the history
There are some vector instructions that use `init_masked_result_cmp`
but do not use the returned result variable, so just discard it rather
than create a new variable.
  • Loading branch information
Alasdair committed Sep 20, 2024
1 parent 6dd6464 commit fd1be4b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions model/riscv_insts_vext_mask.sail
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ function clause execute(VCPOP_M(vm, vs2, rd)) = {
let vm_val : vector('n, dec, bool) = read_vmask(num_elem, vm, 0b00000);
let vs2_val : vector('n, dec, bool) = read_vmask(num_elem, 0b0, vs2);

let (initial_result, mask) = init_masked_result_cmp(num_elem, SEW, 0, vs2_val, vm_val);
var result = initial_result;
let (_, mask) = init_masked_result_cmp(num_elem, SEW, 0, vs2_val, vm_val);

var count : nat = 0;
foreach (i from 0 to (num_elem - 1)) {
Expand Down Expand Up @@ -133,8 +132,7 @@ function clause execute(VFIRST_M(vm, vs2, rd)) = {
let vm_val : vector('n, dec, bool) = read_vmask(num_elem, vm, 0b00000);
let vs2_val : vector('n, dec, bool) = read_vmask(num_elem, 0b0, vs2);

let (initial_result, mask) = init_masked_result_cmp(num_elem, SEW, 0, vs2_val, vm_val);
var result = initial_result;
let (_, mask) = init_masked_result_cmp(num_elem, SEW, 0, vs2_val, vm_val);

var index : int = -1;
foreach (i from 0 to (num_elem - 1)) {
Expand Down

0 comments on commit fd1be4b

Please sign in to comment.