softfloat: logB(0) should raise divideByZero exception

logB(0) should raise divideByZero exception from IEEE 754-2008 spec 7.3

Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Song Gao <gaosong@loongson.cn>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220930024510.800005-4-gaosong@loongson.cn>
This commit is contained in:
Song Gao 2022-09-30 10:45:10 +08:00
parent 153620126a
commit 3cf7196909
No known key found for this signature in database
GPG Key ID: 40A2FFF239263EDF

View File

@ -1436,6 +1436,7 @@ static void partsN(log2)(FloatPartsN *a, float_status *s, const FloatFmt *fmt)
parts_return_nan(a, s); parts_return_nan(a, s);
return; return;
case float_class_zero: case float_class_zero:
float_raise(float_flag_divbyzero, s);
/* log2(0) = -inf */ /* log2(0) = -inf */
a->cls = float_class_inf; a->cls = float_class_inf;
a->sign = 1; a->sign = 1;