From 0c9730f3d3e4014e1696bcedeafdcd3db536a37f Mon Sep 17 00:00:00 2001 From: qinjun-li Date: Thu, 5 Sep 2024 17:38:41 +0800 Subject: [PATCH] [rocketv] All vector floating-point operations use the dynamic rounding mode. --- rocketv/src/FPU.scala | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/rocketv/src/FPU.scala b/rocketv/src/FPU.scala index e8e11979f..9f4d20407 100644 --- a/rocketv/src/FPU.scala +++ b/rocketv/src/FPU.scala @@ -379,10 +379,9 @@ class FPU(val parameter: FPUParameter) def isOneOf(x: UInt, s: Seq[UInt]): Bool = VecInit(s.map(x === _)).asUInt.orR // we don't currently support round-max-magnitude (rm=4) - io.core.illegal_rm := isOneOf(io.core.inst(14, 12), Seq(5.U, 6.U)) || io.core.inst( - 14, - 12 - ) === 7.U && io.core.fcsr_rm >= 5.U + io.core.illegal_rm := + (isOneOf(io.core.inst(14, 12), Seq(5.U, 6.U)) && io.core.inst(6, 0) =/= "b1010111".U) || + io.core.inst(14, 12) === 7.U && io.core.fcsr_rm >= 5.U if (cfg.divSqrt) { val divSqrt_inValid = mem_reg_valid && (mem_ctrl.div || mem_ctrl.sqrt) && !divSqrt_inFlight