fix fcvttg FPSCR.FR computation
authorJacob Lifshay <programmerjake@gmail.com>
Fri, 19 May 2023 03:56:40 +0000 (20:56 -0700)
committerJacob Lifshay <programmerjake@gmail.com>
Fri, 19 May 2023 03:58:41 +0000 (20:58 -0700)
openpower/sv/int_fp_mv/moves_and_conversions.mdwn

index c735a6944edad433a8682aefe5309a34a801e6b1..f0207cc57d7397946545319cf0d3b96d0d93c532 100644 (file)
@@ -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)