adds floating point reduction instrs, widening are untested

This commit is contained in:
2025-02-26 18:53:14 +01:00
parent 60d2b45a81
commit 8746003d3e
3 changed files with 198 additions and 4 deletions

View File

@ -750,7 +750,33 @@ if(vector != null) {%>
void fp_vector_slide1down(uint8_t* V, uint64_t vl, uint64_t vstart, softvector::vtype_t vtype, bool vm, unsigned vd, unsigned vs2, uint64_t imm, uint8_t sew_val) {
return vector_slide1down(V, vl, vstart, vtype, vm, vd, vs2, imm, sew_val);
}
void fp_vector_red_op(uint8_t* V, uint8_t funct6, uint8_t funct3, uint64_t vl, uint64_t vstart, softvector::vtype_t vtype, bool vm, uint8_t vd, uint8_t vs2, uint8_t vs1, uint8_t rm, uint8_t sew_val){
switch(sew_val){
case 0b000:
throw new std::runtime_error("Unsupported sew bit value");
case 0b001:
throw new std::runtime_error("Unsupported sew bit value");
case 0b010:
return softvector::fp_vector_red_op<${vlen}, uint32_t>(V, funct6, funct3, vl, vstart, vtype, vm, vd, vs2, vs1, rm);
case 0b011:
return softvector::fp_vector_red_op<${vlen}, uint64_t>(V, funct6, funct3, vl, vstart, vtype, vm, vd, vs2, vs1, rm);
default:
throw new std::runtime_error("Unsupported sew bit value");
}
}
void fp_vector_red_wv(uint8_t* V, uint8_t funct6, uint8_t funct3, uint64_t vl, uint64_t vstart, softvector::vtype_t vtype, bool vm, uint8_t vd, uint8_t vs2, uint8_t vs1, uint8_t rm, uint8_t sew_val){
switch(sew_val){
case 0b000:
throw new std::runtime_error("Unsupported sew bit value");
case 0b001:
return softvector::fp_vector_red_op<${vlen}, uint32_t, uint16_t>(V, funct6, funct3, vl, vstart, vtype, vm, vd, vs2, vs1, rm);
case 0b010:
return softvector::fp_vector_red_op<${vlen}, uint64_t, uint32_t>(V, funct6, funct3, vl, vstart, vtype, vm, vd, vs2, vs1, rm);
case 0b011: // would require 128 bits vs2 value
default:
throw new std::runtime_error("Unsupported sew bit value");
}
}
<%}%>
uint64_t fetch_count{0};
uint64_t tval{0};