summaryrefslogtreecommitdiffstats
path: root/fpu
diff options
context:
space:
mode:
authorSong Gao2022-09-30 04:45:10 +0200
committerSong Gao2022-10-17 04:28:35 +0200
commit3cf71969095a99f840cd4b3f4aae696ce44b8078 (patch)
tree4e7c32f19d11e2168c1e922a8bf40acc3955b9ff /fpu
parenttarget/loongarch: Fix fnm{sub/add}_{s/d} set wrong flags (diff)
downloadqemu-3cf71969095a99f840cd4b3f4aae696ce44b8078.tar.gz
qemu-3cf71969095a99f840cd4b3f4aae696ce44b8078.tar.xz
qemu-3cf71969095a99f840cd4b3f4aae696ce44b8078.zip
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>
Diffstat (limited to 'fpu')
-rw-r--r--fpu/softfloat-parts.c.inc1
1 files changed, 1 insertions, 0 deletions
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;