fix round nearest-even
authorJacob Lifshay <programmerjake@gmail.com>
Wed, 17 May 2023 04:48:04 +0000 (21:48 -0700)
committerJacob Lifshay <programmerjake@gmail.com>
Wed, 17 May 2023 04:48:04 +0000 (21:48 -0700)
openpower/isafunctions/bfp.mdwn

index 44ac78710081efdfaad8aa2523307da11c0b47f0..c6dd2d9fa78c553f5b4fbc9f2969a876c3d387ee 100644 (file)
@@ -291,7 +291,7 @@ section 7.6.2.2
                 if temp = 0 then halfway <- 1
                 else more_than_halfway <- 1
         if rmode = 0b000 then  # Round to Nearest Even
-            round_up <- (even & halfway) | more_than_halfway
+            round_up <- (¬even & halfway) | more_than_halfway
         if rmode = 0b001 then  # Round towards Zero
             round_up <- 0
         if rmode = 0b010 then  # Round towards +Infinity