From 382ad5d3438ea8e717793440f5f00d3bbe983f11 Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Tue, 16 May 2023 21:48:57 -0700 Subject: [PATCH] fix fp comparison --- openpower/isafunctions/bfp.mdwn | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/openpower/isafunctions/bfp.mdwn b/openpower/isafunctions/bfp.mdwn index c6dd2d9f..9bbef89b 100644 --- a/openpower/isafunctions/bfp.mdwn +++ b/openpower/isafunctions/bfp.mdwn @@ -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 -- 2.30.2