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

index c6dd2d9fa78c553f5b4fbc9f2969a876c3d387ee..9bbef89b418f730e9f9d284cc81b6f12326b2af3 100644 (file)
@@ -339,6 +339,10 @@ section 7.6.2.2
 
         if IsNaN(x) | IsNaN(y) then
             return 0b0
+        if IsInf(x) & IsInf(y) then
+            return x.sign = y.sign
+        if IsInf(x) | IsInf(y) then
+            return 0b0
         if IsZero(x) & IsZero(y) then
             return 0b1
         if IsZero(x) | IsZero(y) then
@@ -357,6 +361,12 @@ section 7.6.2.2
 
         if IsNaN(x) | IsNaN(y) then
             return 0b0
+        if IsInf(x) & IsInf(y) then
+            return ¬IsNeg(x) & IsNeg(y)
+        if IsInf(x) then
+            return ¬IsNeg(x)
+        if IsInf(y) then
+            return IsNeg(y)
         if IsZero(x) & IsZero(y) then
             return 0b0
         if IsZero(x) then
@@ -379,6 +389,12 @@ section 7.6.2.2
 
         if IsNaN(x) | IsNaN(y) then
             return 0b0
+        if IsInf(x) & IsInf(y) then
+            return IsNeg(x) & ¬IsNeg(y)
+        if IsInf(x) then
+            return IsNeg(x)
+        if IsInf(y) then
+            return ¬IsNeg(y)
         if IsZero(x) & IsZero(y) then
             return 0b0
         if IsZero(x) then