aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2020-05-05 10:33:18 -0700
committerRichard Henderson <richard.henderson@linaro.org>2020-05-19 08:42:26 -0700
commit5da2d2d8e53d80e92a61720ea995c86b33cbf25d (patch)
tree2695825d03b36956cdf193f0ffb65116eb2fa51b /include
parent71bfd65c5fcd72f8af2735905415c7ce4220f6dc (diff)
softfloat: Inline float32 compare specializations
Replace the float32 compare specializations with inline functions that call the standard float32_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')
-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 7f84235122..4d1af6ab45 100644
--- a/include/fpu/softfloat.h
+++ b/include/fpu/softfloat.h
@@ -343,14 +343,6 @@ float32 float32_muladd(float32, float32, float32, int, float_status *status);
float32 float32_sqrt(float32, float_status *status);
float32 float32_exp2(float32, float_status *status);
float32 float32_log2(float32, float_status *status);
-int float32_eq(float32, float32, float_status *status);
-int float32_le(float32, float32, float_status *status);
-int float32_lt(float32, float32, float_status *status);
-int float32_unordered(float32, float32, float_status *status);
-int float32_eq_quiet(float32, float32, float_status *status);
-int float32_le_quiet(float32, float32, float_status *status);
-int float32_lt_quiet(float32, float32, float_status *status);
-int float32_unordered_quiet(float32, float32, float_status *status);
FloatRelation float32_compare(float32, float32, float_status *status);
FloatRelation float32_compare_quiet(float32, float32, float_status *status);
float32 float32_min(float32, float32, float_status *status);
@@ -425,6 +417,47 @@ static inline float32 float32_set_sign(float32 a, int sign)
return make_float32((float32_val(a) & 0x7fffffff) | (sign << 31));
}
+static inline bool float32_eq(float32 a, float32 b, float_status *s)
+{
+ return float32_compare(a, b, s) == float_relation_equal;
+}
+
+static inline bool float32_le(float32 a, float32 b, float_status *s)
+{
+ return float32_compare(a, b, s) <= float_relation_equal;
+}
+
+static inline bool float32_lt(float32 a, float32 b, float_status *s)
+{
+ return float32_compare(a, b, s) < float_relation_equal;
+}
+
+static inline bool float32_unordered(float32 a, float32 b, float_status *s)
+{
+ return float32_compare(a, b, s) == float_relation_unordered;
+}
+
+static inline bool float32_eq_quiet(float32 a, float32 b, float_status *s)
+{
+ return float32_compare_quiet(a, b, s) == float_relation_equal;
+}
+
+static inline bool float32_le_quiet(float32 a, float32 b, float_status *s)
+{
+ return float32_compare_quiet(a, b, s) <= float_relation_equal;
+}
+
+static inline bool float32_lt_quiet(float32 a, float32 b, float_status *s)
+{
+ return float32_compare_quiet(a, b, s) < float_relation_equal;
+}
+
+static inline bool float32_unordered_quiet(float32 a, float32 b,
+ float_status *s)
+{
+ return float32_compare_quiet(a, b, s) == float_relation_unordered;
+}
+
#define float32_zero make_float32(0)
#define float32_half make_float32(0x3f000000)
#define float32_one make_float32(0x3f800000)