1
0

Don't canonicalize 32-bit FP results in the various pipelines

It's redundant with the new scheme, so just adds HW for no reason.
This commit is contained in:
Andrew Waterman 2017-03-07 17:26:09 -08:00 committed by Andrew Waterman
parent f505aba1ac
commit 603b8af2eb

View File

@ -383,19 +383,22 @@ class IntToFP(val latency: Int)(implicit p: Parameters) extends FPUModule()(p) {
l2s.io.signedIn := ~in.bits.typ(0) l2s.io.signedIn := ~in.bits.typ(0)
l2s.io.in := intValue l2s.io.in := intValue
l2s.io.roundingMode := in.bits.rm l2s.io.roundingMode := in.bits.rm
mux.data := Cat(UInt((BigInt(1) << (fLen - 32)) - 1), l2s.io.out)
mux.exc := l2s.io.exceptionFlags
fLen match { fLen match {
case 32 => case 32 =>
mux.data := l2s.io.out
mux.exc := l2s.io.exceptionFlags
case 64 => case 64 =>
val l2d = Module(new hardfloat.INToRecFN(xLen, dExpWidth, dSigWidth)) val l2d = Module(new hardfloat.INToRecFN(xLen, dExpWidth, dSigWidth))
l2d.io.signedIn := ~in.bits.typ(0) l2d.io.signedIn := ~in.bits.typ(0)
l2d.io.in := intValue l2d.io.in := intValue
l2d.io.roundingMode := in.bits.rm l2d.io.roundingMode := in.bits.rm
mux.data := Cat(l2d.io.out >> l2s.io.out.getWidth, l2s.io.out)
mux.exc := l2s.io.exceptionFlags
when (!in.bits.single) { when (!in.bits.single) {
mux.data := Cat(UInt((BigInt(1) << (fLen - 64)) - 1), l2d.io.out) mux.data := l2d.io.out
mux.exc := l2d.io.exceptionFlags mux.exc := l2d.io.exceptionFlags
} }
} }
} }
@ -442,20 +445,22 @@ class IntToFP(val latency: Int)(implicit p: Parameters) extends FPUModule()(p) {
mux.data := Mux(isNaNOut, cNaN, Mux(isLHS, in.bits.in1, in.bits.in2)) mux.data := Mux(isNaNOut, cNaN, Mux(isLHS, in.bits.in1, in.bits.in2))
} }
fLen match { fLen match {
case 32 => case 32 =>
case 64 => case 64 =>
when (in.bits.cmd === FCMD_CVT_FF) { when (in.bits.cmd === FCMD_CVT_FF) {
when (in.bits.single) { val d2s = Module(new hardfloat.RecFNToRecFN(dExpWidth, dSigWidth, sExpWidth, sSigWidth))
val d2s = Module(new hardfloat.RecFNToRecFN(dExpWidth, dSigWidth, sExpWidth, sSigWidth)) d2s.io.in := in.bits.in1
d2s.io.in := in.bits.in1 d2s.io.roundingMode := in.bits.rm
d2s.io.roundingMode := in.bits.rm
mux.data := Cat(UInt((BigInt(1) << (fLen - 32)) - 1), d2s.io.out) val s2d = Module(new hardfloat.RecFNToRecFN(sExpWidth, sSigWidth, dExpWidth, dSigWidth))
s2d.io.in := in.bits.in1
s2d.io.roundingMode := in.bits.rm
when (in.bits.single) {
mux.data := Cat(s2d.io.out >> d2s.io.out.getWidth, d2s.io.out)
mux.exc := d2s.io.exceptionFlags mux.exc := d2s.io.exceptionFlags
}.otherwise { }.otherwise {
val s2d = Module(new hardfloat.RecFNToRecFN(sExpWidth, sSigWidth, dExpWidth, dSigWidth))
s2d.io.in := in.bits.in1
s2d.io.roundingMode := in.bits.rm
mux.data := s2d.io.out mux.data := s2d.io.out
mux.exc := s2d.io.exceptionFlags mux.exc := s2d.io.exceptionFlags
} }
@ -494,7 +499,7 @@ class FPUFMAPipe(val latency: Int, expWidth: Int, sigWidth: Int)(implicit p: Par
fma.io.c := in.in3 fma.io.c := in.in3
val res = Wire(new FPResult) val res = Wire(new FPResult)
res.data := Cat(UInt((BigInt(1) << (fLen - (expWidth + sigWidth))) - 1), fma.io.out) res.data := fma.io.out
res.exc := fma.io.exceptionFlags res.exc := fma.io.exceptionFlags
io.out := Pipe(valid, res, latency-1) io.out := Pipe(valid, res, latency-1)
} }