cleans up agnostic behaviour for softvector

This commit is contained in:
2025-06-30 09:04:46 +02:00
parent 67f364049c
commit cd866fd74d

View File

@ -364,11 +364,10 @@ void vector_imm_op(uint8_t* V, unsigned funct6, unsigned funct3, uint64_t vl, ui
auto fn = get_funct<dest_elem_t, src2_elem_t, src1_elem_t>(funct6, funct3);
for(size_t idx = vstart; idx < vl; idx++) {
bool mask_active = vm ? 1 : mask_reg[idx];
if(mask_active) {
if(mask_active)
vd_view[idx] = fn(vd_view[idx], vs2_view[idx], imm);
} else {
vd_view[idx] = vtype.vma() ? vd_view[idx] : vd_view[idx];
}
else if(vtype.vma())
vd_view[idx] = agnostic_behavior(vd_view[idx]);
}
if(vtype.vta())
for(size_t idx = vl; idx < vlmax; idx++)
@ -550,8 +549,8 @@ void vector_unary_op(uint8_t* V, unsigned unary_op, uint64_t vl, uint64_t vstart
bool mask_active = vm ? 1 : mask_reg[idx];
if(mask_active)
vd_view[idx] = fn(vs2_view[idx]);
else
vd_view[idx] = vtype.vma() ? vd_view[idx] : vd_view[idx];
else if(vtype.vma())
vd_view[idx] = agnostic_behavior(vd_view[idx]);
}
if(vtype.vta())
for(size_t idx = vl; idx < vlmax; idx++)
@ -774,11 +773,10 @@ bool sat_vector_vector_op(uint8_t* V, unsigned funct6, unsigned funct3, uint64_t
auto fn = get_sat_funct<dest_elem_t, src2_elem_t, src1_elem_t>(funct6, funct3);
for(size_t idx = vstart; idx < vl; idx++) {
bool mask_active = vm ? 1 : mask_reg[idx];
if(mask_active) {
if(mask_active)
saturated |= fn(vxrm, vtype, vd_view[idx], vs2_view[idx], vs1_view[idx]);
} else {
vd_view[idx] = vtype.vma() ? vd_view[idx] : vd_view[idx];
}
else if(vtype.vma())
vd_view[idx] = agnostic_behavior(vd_view[idx]);
}
if(vtype.vta())
for(size_t idx = vl; idx < vlmax; idx++) {
@ -797,11 +795,10 @@ bool sat_vector_imm_op(uint8_t* V, unsigned funct6, unsigned funct3, uint64_t vl
auto fn = get_sat_funct<dest_elem_t, src2_elem_t, src1_elem_t>(funct6, funct3);
for(size_t idx = vstart; idx < vl; idx++) {
bool mask_active = vm ? 1 : mask_reg[idx];
if(mask_active) {
if(mask_active)
saturated |= fn(vxrm, vtype, vd_view[idx], vs2_view[idx], imm);
} else {
vd_view[idx] = vtype.vma() ? vd_view[idx] : vd_view[idx];
}
else if(vtype.vma())
vd_view[idx] = agnostic_behavior(vd_view[idx]);
}
if(vtype.vta())
for(size_t idx = vl; idx < vlmax; idx++) {