summaryrefslogtreecommitdiff
path: root/gcc/real.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/real.h')
-rw-r--r--gcc/real.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/real.h b/gcc/real.h
index 530a88659f7..a91061ef54d 100644
--- a/gcc/real.h
+++ b/gcc/real.h
@@ -294,6 +294,13 @@ do { REAL_VALUE_TYPE in = (IN); /* Make sure it's not in a register. */\
#define REAL_VALUE_TO_TARGET_LONG_DOUBLE(a, b) REAL_VALUE_TO_TARGET_DOUBLE (a, b)
#endif
+/* Compare two floating-point objects for bitwise identity.
+ This is not the same as comparing for equality on IEEE hosts:
+ -0.0 equals 0.0 but they are not identical, and conversely
+ two NaNs might be identical but they cannot be equal. */
+#define REAL_VALUES_IDENTICAL(x, y) \
+ (!bcmp ((char *) &(x), (char *) &(y), sizeof (REAL_VALUE_TYPE)))
+
/* Compare two floating-point values for equality. */
#ifndef REAL_VALUES_EQUAL
#define REAL_VALUES_EQUAL(x, y) ((x) == (y))