Skip to content

Commit

Permalink
fix(FloatAdder): fix f16 add 0
Browse files Browse the repository at this point in the history
  • Loading branch information
HeiHuDie authored and xiaofeibao-xjtu committed Nov 26, 2024
1 parent 548dbea commit ae267c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/scala/yunsuan/fpu/FloatAdder.scala
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,9 @@ private[fpu] class FloatAdderF32F16MixedPipeline(val is_print:Boolean = false,va
}.elsewhen(RegEnable(fp_a_is_zero & fp_b_is_zero, fire)){
float_adder_result := Cat(RegEnable(Mux(io.round_mode==="b010".U & EOP | (fp_a_to32.head(1).asBool & !EOP),1.U,0.U), fire),0.U(31.W))
}.elsewhen(RegEnable(fp_a_is_zero, fire)){
float_adder_result := RegEnable(Cat(io.is_sub ^ fp_b_to32.head(1),fp_b_to32(30,0)), fire)
float_adder_result := RegEnable(Cat(0.U(16.W),Cat(io.is_sub ^ io.fp_b(15),io.fp_b(14,0))), fire)
}.elsewhen(RegEnable(fp_b_is_zero, fire)){
float_adder_result := RegEnable(fp_a_to32, fire)
float_adder_result := RegEnable(io.fp_a, fire)
}.otherwise{
float_adder_result := out_fp32_to_fp16_or_fp32_reg
}
Expand Down

0 comments on commit ae267c8

Please sign in to comment.