summaryrefslogtreecommitdiffstats
path: root/include/fpu
diff options
context:
space:
mode:
authorRichard Henderson2020-05-05 19:50:32 +0200
committerRichard Henderson2020-05-19 17:42:49 +0200
commitb7b1ac684fea49c6bfe1ad8b706aed7b09116d15 (patch)
treeee091e98c15572433b580d85f8adc7d1cb22d7e1 /include/fpu
parentsoftfloat: Inline float64 compare specializations (diff)
downloadqemu-b7b1ac684fea49c6bfe1ad8b706aed7b09116d15.tar.gz
qemu-b7b1ac684fea49c6bfe1ad8b706aed7b09116d15.tar.xz
qemu-b7b1ac684fea49c6bfe1ad8b706aed7b09116d15.zip
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)
/*----------------------------------------------------------------------------