aboutsummaryrefslogtreecommitdiff
path: root/gcc/real.h
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2022-08-26 16:57:09 +0200
committerAldy Hernandez <aldyh@redhat.com>2022-08-26 20:45:30 +0200
commit1d3145360f95910f0661da0364b91dc7962d44fa (patch)
tree50409866b00ccbc4796f8c9551667faeaf3d4d39 /gcc/real.h
parent33cae277637d569d66518b6805a84444b8d66e9c (diff)
downloadgcc-1d3145360f95910f0661da0364b91dc7962d44fa.zip
gcc-1d3145360f95910f0661da0364b91dc7962d44fa.tar.gz
gcc-1d3145360f95910f0661da0364b91dc7962d44fa.tar.bz2
Add real_iszero to real.*
We have real_isnegzero but no real_iszero. We could memcmp with 0, but that's just ugly. gcc/ChangeLog: * real.cc (real_iszero): New. * real.h (real_iszero): New.
Diffstat (limited to 'gcc/real.h')
-rw-r--r--gcc/real.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/real.h b/gcc/real.h
index e01f9ed..ec78e8a 100644
--- a/gcc/real.h
+++ b/gcc/real.h
@@ -295,6 +295,12 @@ extern bool real_isneg (const REAL_VALUE_TYPE *);
/* Determine whether a floating-point value X is minus zero. */
extern bool real_isnegzero (const REAL_VALUE_TYPE *);
+/* Determine whether a floating-point value X is plus or minus zero. */
+extern bool real_iszero (const REAL_VALUE_TYPE *);
+
+/* Determine whether a floating-point value X is zero with SIGN. */
+extern bool real_iszero (const REAL_VALUE_TYPE *, bool sign);
+
/* Test relationships between reals. */
extern bool real_identical (const REAL_VALUE_TYPE *, const REAL_VALUE_TYPE *);
extern bool real_equal (const REAL_VALUE_TYPE *, const REAL_VALUE_TYPE *);