From 3cf71969095a99f840cd4b3f4aae696ce44b8078 Mon Sep 17 00:00:00 2001 From: Song Gao Date: Fri, 30 Sep 2022 10:45:10 +0800 Subject: [PATCH] softfloat: logB(0) should raise divideByZero exception logB(0) should raise divideByZero exception from IEEE 754-2008 spec 7.3 Suggested-by: Richard Henderson Signed-off-by: Song Gao Reviewed-by: Richard Henderson Message-Id: <20220930024510.800005-4-gaosong@loongson.cn> --- fpu/softfloat-parts.c.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/fpu/softfloat-parts.c.inc b/fpu/softfloat-parts.c.inc index a9f268fcab..247400031c 100644 --- a/fpu/softfloat-parts.c.inc +++ b/fpu/softfloat-parts.c.inc @@ -1436,6 +1436,7 @@ static void partsN(log2)(FloatPartsN *a, float_status *s, const FloatFmt *fmt) parts_return_nan(a, s); return; case float_class_zero: + float_raise(float_flag_divbyzero, s); /* log2(0) = -inf */ a->cls = float_class_inf; a->sign = 1;