aboutsummaryrefslogtreecommitdiff
path: root/fpu/softfloat.c
diff options
context:
space:
mode:
authorDavid Hildenbrand <david@redhat.com>2021-05-17 16:27:36 +0200
committerRichard Henderson <richard.henderson@linaro.org>2021-06-03 13:59:34 -0700
commitceebc129e51ea3aa8dc81321046ed42432c49511 (patch)
tree97d913cb2bd7d28af0e553e46e6e7bc15a8f5393 /fpu/softfloat.c
parente1c4667a9b91b1500e47f4cbb4e43a36136e6d29 (diff)
softfloat: Implement float128_(min|minnum|minnummag|max|maxnum|maxnummag)
The float128 implementation is straight-forward. Unfortuantely, we don't have any tests we can simply adjust/unlock. Signed-off-by: David Hildenbrand <david@redhat.com> Message-Id: <20210517142739.38597-24-david@redhat.com> [rth: Update for changed parts_minmax return value] Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'fpu/softfloat.c')
-rw-r--r--fpu/softfloat.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/fpu/softfloat.c b/fpu/softfloat.c
index ef750e1e95..4fee5a6cb7 100644
--- a/fpu/softfloat.c
+++ b/fpu/softfloat.c
@@ -3324,6 +3324,18 @@ static float64 float64_minmax(float64 a, float64 b, float_status *s, int flags)
return float64_round_pack_canonical(pr, s);
}
+static float128 float128_minmax(float128 a, float128 b,
+ float_status *s, int flags)
+{
+ FloatParts128 pa, pb, *pr;
+
+ float128_unpack_canonical(&pa, a, s);
+ float128_unpack_canonical(&pb, b, s);
+ pr = parts_minmax(&pa, &pb, s, flags);
+
+ return float128_round_pack_canonical(pr, s);
+}
+
#define MINMAX_1(type, name, flags) \
type type##_##name(type a, type b, float_status *s) \
{ return type##_minmax(a, b, s, flags); }
@@ -3340,6 +3352,7 @@ MINMAX_2(float16)
MINMAX_2(bfloat16)
MINMAX_2(float32)
MINMAX_2(float64)
+MINMAX_2(float128)
#undef MINMAX_1
#undef MINMAX_2