aboutsummaryrefslogtreecommitdiff
path: root/include/fpu/softfloat.h
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2020-05-05 10:40:23 -0700
committerRichard Henderson <richard.henderson@linaro.org>2020-05-19 08:42:45 -0700
commit0673ecdf6cb2b1445a85283db8cbacb251c46516 (patch)
tree84dbaf6c8278f71e43beaaa716cea6bd2d5658cf /include/fpu/softfloat.h
parent5da2d2d8e53d80e92a61720ea995c86b33cbf25d (diff)
softfloat: Inline float64 compare specializations
Replace the float64 compare specializations with inline functions that call the standard float64_compare{,_quiet} functions. Use bool as the return type. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'include/fpu/softfloat.h')
-rw-r--r--include/fpu/softfloat.h49
1 files changed, 41 insertions, 8 deletions
diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h
index 4d1af6ab45..281f0fd971 100644
--- a/include/fpu/softfloat.h
+++ b/include/fpu/softfloat.h
@@ -532,14 +532,6 @@ float64 float64_rem(float64, float64, float_status *status);
float64 float64_muladd(float64, float64, float64, int, float_status *status);
float64 float64_sqrt(float64, float_status *status);
float64 float64_log2(float64, float_status *status);
-int float64_eq(float64, float64, float_status *status);
-int float64_le(float64, float64, float_status *status);
-int float64_lt(float64, float64, float_status *status);
-int float64_unordered(float64, float64, float_status *status);
-int float64_eq_quiet(float64, float64, float_status *status);
-int float64_le_quiet(float64, float64, float_status *status);
-int float64_lt_quiet(float64, float64, float_status *status);
-int float64_unordered_quiet(float64, float64, float_status *status);
FloatRelation float64_compare(float64, float64, float_status *status);
FloatRelation float64_compare_quiet(float64, float64, float_status *status);
float64 float64_min(float64, float64, float_status *status);
@@ -615,6 +607,47 @@ static inline float64 float64_set_sign(float64 a, int sign)
| ((int64_t)sign << 63));
}
+static inline bool float64_eq(float64 a, float64 b, float_status *s)
+{
+ return float64_compare(a, b, s) == float_relation_equal;
+}
+
+static inline bool float64_le(float64 a, float64 b, float_status *s)
+{
+ return float64_compare(a, b, s) <= float_relation_equal;
+}
+
+static inline bool float64_lt(float64 a, float64 b, float_status *s)
+{
+ return float64_compare(a, b, s) < float_relation_equal;
+}
+
+static inline bool float64_unordered(float64 a, float64 b, float_status *s)
+{
+ return float64_compare(a, b, s) == float_relation_unordered;
+}
+
+static inline bool float64_eq_quiet(float64 a, float64 b, float_status *s)
+{
+ return float64_compare_quiet(a, b, s) == float_relation_equal;
+}
+
+static inline bool float64_le_quiet(float64 a, float64 b, float_status *s)
+{
+ return float64_compare_quiet(a, b, s) <= float_relation_equal;
+}
+
+static inline bool float64_lt_quiet(float64 a, float64 b, float_status *s)
+{
+ return float64_compare_quiet(a, b, s) < float_relation_equal;
+}
+
+static inline bool float64_unordered_quiet(float64 a, float64 b,
+ float_status *s)
+{
+ return float64_compare_quiet(a, b, s) == float_relation_unordered;
+}
+
#define float64_zero make_float64(0)
#define float64_half make_float64(0x3fe0000000000000LL)
#define float64_one make_float64(0x3ff0000000000000LL)