Skip to content

Commit 7676382

Browse files
committed
Removed the commented iexp code
1 parent 555b07b commit 7676382

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

src/main/scala/gemmini/AccumulatorScale.scala

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,6 @@ object AccumulatorScale {
386386
}
387387

388388
def iexp[T <: Data](q: T, qln2: T, qln2_inv: T, qb: T, qc: T)(implicit ev: Arithmetic[T]): T = {
389-
/*
390389
import ev._
391390

392391
val zero = q.zero
@@ -403,18 +402,6 @@ object AccumulatorScale {
403402
val q_poly_iexp = qc.mac(qp_iexp + qb, qp_iexp + qb).withWidthOf(q)
404403
// we dont want a rounding shift
405404
// TODO: z overflow
406-
(q_poly_iexp.asUInt.do_>>(z_iexp_saturated.asUInt)).asTypeOf(q) */
407-
import ev._
408-
409-
val zero = q.zero
410-
val one = q.identity
411-
def neg(x: T) = zero-x
412-
413-
val q_sign = Mux(q.zero > q, neg(one), one)
414-
val q_abs = Mux(q.zero > q, neg(q), q)
415-
val q_clipped = Mux(q_abs > neg(qb), neg(qb), q_abs)
416-
val q_poly = qc.mac(q_clipped + qb, q_clipped + qb).withWidthOf(q)
417-
val q_erf = (q_sign * q_poly).withWidthOf(q)
418-
(q * (q_erf + qc)).withWidthOf(q)
405+
(q_poly_iexp.asUInt.do_>>(z_iexp_saturated.asUInt)).asTypeOf(q)
419406
}}
420407

0 commit comments

Comments
 (0)