From: Jacob Lifshay Date: Fri, 19 May 2023 03:56:40 +0000 (-0700) Subject: fix fcvttg FPSCR.FR computation X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=96230fdb1d6404b7ea1ea46488e0f8fa4ec075b1;p=libreriscv.git fix fcvttg FPSCR.FR computation --- diff --git a/openpower/sv/int_fp_mv/moves_and_conversions.mdwn b/openpower/sv/int_fp_mv/moves_and_conversions.mdwn index c735a6944..f0207cc57 100644 --- a/openpower/sv/int_fp_mv/moves_and_conversions.mdwn +++ b/openpower/sv/int_fp_mv/moves_and_conversions.mdwn @@ -559,8 +559,10 @@ Section 7.1 of the ECMAScript / JavaScript overflow <- 1 # signals SO only when OE = 1 vxcvi_flag <- 1 xx_flag <- 0 - else if ¬bfp_COMPARE_EQ(src, result_bfp) then - xx_flag <- 1 + inc_flag <- 0 + else + xx_flag <- ¬bfp_COMPARE_EQ(src, result_bfp) + inc_flag <- bfp_COMPARE_GT(bfp_ABSOLUTE(result_bfp), bfp_ABSOLUTE(src)) if vxsnan_flag = 1 then SetFX(FPSCR.VXSNAN) if vxcvi_flag = 1 then SetFX(FPSCR.VXCVI) @@ -724,8 +726,10 @@ Special Registers altered: overflow <- 1 # signals SO only when OE = 1 vxcvi_flag <- 1 xx_flag <- 0 - else if ¬bfp_COMPARE_EQ(src, result_bfp) then - xx_flag <- 1 + inc_flag <- 0 + else + xx_flag <- ¬bfp_COMPARE_EQ(src, result_bfp) + inc_flag <- bfp_COMPARE_GT(bfp_ABSOLUTE(result_bfp), bfp_ABSOLUTE(src)) if vxsnan_flag = 1 then SetFX(FPSCR.VXSNAN) if vxcvi_flag = 1 then SetFX(FPSCR.VXCVI)