Fix FEQ flag generation (#479)
FEQ is not a signaling comparison (i.e., qNaN is not an invalid input). Also, minor code cleanup.
This commit is contained in:
parent
fbfa15efea
commit
915697cb09
@ -308,17 +308,15 @@ class FPToInt(implicit p: Parameters) extends FPUModule()(p) {
|
|||||||
val dcmp = Module(new hardfloat.CompareRecFN(maxExpWidth, maxSigWidth))
|
val dcmp = Module(new hardfloat.CompareRecFN(maxExpWidth, maxSigWidth))
|
||||||
dcmp.io.a := in.in1
|
dcmp.io.a := in.in1
|
||||||
dcmp.io.b := in.in2
|
dcmp.io.b := in.in2
|
||||||
dcmp.io.signaling := Bool(true)
|
dcmp.io.signaling := !in.rm(1)
|
||||||
val dcmp_out = (~in.rm & Cat(dcmp.io.lt, dcmp.io.eq)).orR
|
|
||||||
val dcmp_exc = dcmp.io.exceptionFlags
|
|
||||||
|
|
||||||
io.out.bits.toint := Mux(in.rm(0), classify_out, unrec_int)
|
io.out.bits.toint := Mux(in.rm(0), classify_out, unrec_int)
|
||||||
io.out.bits.store := unrec_mem
|
io.out.bits.store := unrec_mem
|
||||||
io.out.bits.exc := Bits(0)
|
io.out.bits.exc := Bits(0)
|
||||||
|
|
||||||
when (in.cmd === FCMD_CMP) {
|
when (in.cmd === FCMD_CMP) {
|
||||||
io.out.bits.toint := dcmp_out
|
io.out.bits.toint := (~in.rm & Cat(dcmp.io.lt, dcmp.io.eq)).orR
|
||||||
io.out.bits.exc := dcmp_exc
|
io.out.bits.exc := dcmp.io.exceptionFlags
|
||||||
}
|
}
|
||||||
when (in.cmd === FCMD_CVT_IF) {
|
when (in.cmd === FCMD_CVT_IF) {
|
||||||
val minXLen = 32
|
val minXLen = 32
|
||||||
|
Loading…
Reference in New Issue
Block a user