From: Jacob Lifshay Date: Thu, 4 May 2023 04:55:07 +0000 (-0700) Subject: fix fcvt pseudocode X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9046dad33eba10697d4727db91968bf945410108;p=libreriscv.git fix fcvt pseudocode --- diff --git a/openpower/sv/int_fp_mv/moves_and_conversions.mdwn b/openpower/sv/int_fp_mv/moves_and_conversions.mdwn index d51f68b23..9355c451b 100644 --- a/openpower/sv/int_fp_mv/moves_and_conversions.mdwn +++ b/openpower/sv/int_fp_mv/moves_and_conversions.mdwn @@ -494,7 +494,7 @@ Section 7.1 of the ECMAScript / JavaScript range_max <- bfp_CONVERT_FROM_UI64(0xFFFF_FFFF_FFFF_FFFF) js_mask <- 0xFFFF_FFFF_FFFF_FFFF - if CVM[2] = 1 or FPSCR.RN = 0b01 then + if (CVM[2] = 1) | (FPSCR.RN = 0b01) then rnd <- bfp_ROUND_TO_INTEGER_TRUNC(src) else if FPSCR.RN = 0b00 then rnd <- bfp_ROUND_TO_INTEGER_NEAR_EVEN(src) @@ -533,7 +533,7 @@ Section 7.1 of the ECMAScript / JavaScript # has 64 bits, and the sum of those is strictly less than the 128 # bits of the intermediate result. limit <- bfp_CONVERT_FROM_UI128([1] * 128) - if IsInf(rnd) or IsNaN(rnd) then + if IsInf(rnd) | IsNaN(rnd) then result <- [0] * 64 else if bfp_COMPARE_GT(bfp_ABSOLUTE(rnd), limit) then result <- [0] * 64 @@ -565,7 +565,7 @@ Section 7.1 of the ECMAScript / JavaScript FPSCR.FPRF <- undefined FPSCR.FR <- inc_flag FPSCR.FI <- xx_flag - if IsNaN(src) or not bfp_COMPARE_EQ(src, result_bfp) then + if IsNaN(src) | ¬bfp_COMPARE_EQ(src, result_bfp) then overflow <- 1 # signals SO only when OE = 1 else FPSCR.FR <- 0 @@ -653,7 +653,7 @@ Special Registers altered: range_max <- bfp_CONVERT_FROM_UI64(0xFFFF_FFFF_FFFF_FFFF) js_mask <- 0xFFFF_FFFF_FFFF_FFFF - if CVM[2] = 1 or FPSCR.RN = 0b01 then + if (CVM[2] = 1) | (FPSCR.RN = 0b01) then rnd <- bfp_ROUND_TO_INTEGER_TRUNC(src) else if FPSCR.RN = 0b00 then rnd <- bfp_ROUND_TO_INTEGER_NEAR_EVEN(src) @@ -692,7 +692,7 @@ Special Registers altered: # has 64 bits, and the sum of those is strictly less than the 128 # bits of the intermediate result. limit <- bfp_CONVERT_FROM_UI128([1] * 128) - if IsInf(rnd) or IsNaN(rnd) then + if IsInf(rnd) | IsNaN(rnd) then result <- [0] * 64 else if bfp_COMPARE_GT(bfp_ABSOLUTE(rnd), limit) then result <- [0] * 64 @@ -724,7 +724,7 @@ Special Registers altered: FPSCR.FPRF <- undefined FPSCR.FR <- inc_flag FPSCR.FI <- xx_flag - if IsNaN(src) or not bfp_COMPARE_EQ(src, result_bfp) then + if IsNaN(src) | ¬bfp_COMPARE_EQ(src, result_bfp) then overflow <- 1 # signals SO only when OE = 1 else FPSCR.FR <- 0