Skip to content

Commit

Permalink
fix(i2f): fix underflow and overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
HeiHuDie authored and huxuan0307 committed Nov 25, 2024
1 parent 16e5728 commit 548dbea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/scala/yunsuan/scalar/IntToFP.scala
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ class IntToFP_postnorm(val expWidth: Int, val precision: Int) extends Module {

nv := false.B
dz := false.B
of := !in_sign && flow
uf := in_sign && flow
of := flow
uf := false.B
nx := flow || ix

io.result := Mux(flow, Mux(rmin, Cat(in_sign, FloatPoint.maxNormExp(expWidth).U(expWidth.W), ~0.U((precision-1).W)),
Expand Down

0 comments on commit 548dbea

Please sign in to comment.