aboutsummaryrefslogtreecommitdiff
path: root/include/fpu
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2020-05-05 10:50:32 -0700
committerRichard Henderson <richard.henderson@linaro.org>2020-05-19 08:42:49 -0700
commitb7b1ac684fea49c6bfe1ad8b706aed7b09116d15 (patch)
treeee091e98c15572433b580d85f8adc7d1cb22d7e1 /include/fpu
parent0673ecdf6cb2b1445a85283db8cbacb251c46516 (diff)
softfloat: Inline float128 compare specializations
Replace the float128 compare specializations with inline functions that call the standard float128_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')
-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 281f0fd971..cfb3cda46b 100644
--- a/include/fpu/softfloat.h
+++ b/include/fpu/softfloat.h
@@ -901,14 +901,6 @@ float128 float128_mul(float128, float128, float_status *status);
float128 float128_div(float128, float128, float_status *status);
float128 float128_rem(float128, float128, float_status *status);
float128 float128_sqrt(float128, float_status *status);
-int float128_eq(float128, float128, float_status *status);
-int float128_le(float128, float128, float_status *status);
-int float128_lt(float128, float128, float_status *status);
-int float128_unordered(float128, float128, float_status *status);
-int float128_eq_quiet(float128, float128, float_status *status);
-int float128_le_quiet(float128, float128, float_status *status);
-int float128_lt_quiet(float128, float128, float_status *status);
-int float128_unordered_quiet(float128, float128, float_status *status);
FloatRelation float128_compare(float128, float128, float_status *status);
FloatRelation float128_compare_quiet(float128, float128, float_status *status);
int float128_is_quiet_nan(float128, float_status *status);
@@ -964,6 +956,47 @@ static inline int float128_is_any_nan(float128 a)
((a.low != 0) || ((a.high & 0xffffffffffffLL) != 0));
}
+static inline bool float128_eq(float128 a, float128 b, float_status *s)
+{
+ return float128_compare(a, b, s) == float_relation_equal;
+}
+
+static inline bool float128_le(float128 a, float128 b, float_status *s)
+{
+ return float128_compare(a, b, s) <= float_relation_equal;
+}
+
+static inline bool float128_lt(float128 a, float128 b, float_status *s)
+{
+ return float128_compare(a, b, s) < float_relation_equal;
+}
+
+static inline bool float128_unordered(float128 a, float128 b, float_status *s)
+{
+ return float128_compare(a, b, s) == float_relation_unordered;
+}
+
+static inline bool float128_eq_quiet(float128 a, float128 b, float_status *s)
+{
+ return float128_compare_quiet(a, b, s) == float_relation_equal;
+}
+
+static inline bool float128_le_quiet(float128 a, float128 b, float_status *s)
+{
+ return float128_compare_quiet(a, b, s) <= float_relation_equal;
+}
+
+static inline bool float128_lt_quiet(float128 a, float128 b, float_status *s)
+{
+ return float128_compare_quiet(a, b, s) < float_relation_equal;
+}
+
+static inline bool float128_unordered_quiet(float128 a, float128 b,
+ float_status *s)
+{
+ return float128_compare_quiet(a, b, s) == float_relation_unordered;
+}
+
#define float128_zero make_float128(0, 0)
/*----------------------------------------------------------------------------