[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 023/102] softfloat: Add flags specific to Inf / Inf and 0 / 0
From: |
Cédric Le Goater |
Subject: |
[PULL 023/102] softfloat: Add flags specific to Inf / Inf and 0 / 0 |
Date: |
Wed, 15 Dec 2021 18:02:38 +0100 |
From: Richard Henderson <richard.henderson@linaro.org>
PowerPC has these flags, and it's easier to compute them here
than after the fact.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20211119160502.17432-5-richard.henderson@linaro.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
include/fpu/softfloat-types.h | 2 ++
fpu/softfloat-parts.c.inc | 16 +++++++++++-----
2 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/include/fpu/softfloat-types.h b/include/fpu/softfloat-types.h
index 56b4cf783544..5a9671e564c6 100644
--- a/include/fpu/softfloat-types.h
+++ b/include/fpu/softfloat-types.h
@@ -154,6 +154,8 @@ enum {
float_flag_output_denormal = 0x0040,
float_flag_invalid_isi = 0x0080, /* inf - inf */
float_flag_invalid_imz = 0x0100, /* inf * 0 */
+ float_flag_invalid_idi = 0x0200, /* inf / inf */
+ float_flag_invalid_zdz = 0x0400, /* 0 / 0 */
};
/*
diff --git a/fpu/softfloat-parts.c.inc b/fpu/softfloat-parts.c.inc
index 3ed793347b18..b8563cd2df8d 100644
--- a/fpu/softfloat-parts.c.inc
+++ b/fpu/softfloat-parts.c.inc
@@ -590,11 +590,13 @@ static FloatPartsN *partsN(div)(FloatPartsN *a,
FloatPartsN *b,
}
/* 0/0 or Inf/Inf => NaN */
- if (unlikely(ab_mask == float_cmask_zero) ||
- unlikely(ab_mask == float_cmask_inf)) {
- float_raise(float_flag_invalid, s);
- parts_default_nan(a, s);
- return a;
+ if (unlikely(ab_mask == float_cmask_zero)) {
+ float_raise(float_flag_invalid | float_flag_invalid_zdz, s);
+ goto d_nan;
+ }
+ if (unlikely(ab_mask == float_cmask_inf)) {
+ float_raise(float_flag_invalid | float_flag_invalid_idi, s);
+ goto d_nan;
}
/* All the NaN cases */
@@ -625,6 +627,10 @@ static FloatPartsN *partsN(div)(FloatPartsN *a,
FloatPartsN *b,
float_raise(float_flag_divbyzero, s);
a->cls = float_class_inf;
return a;
+
+ d_nan:
+ parts_default_nan(a, s);
+ return a;
}
/*
--
2.31.1
- [PULL 012/102] docs: Minor updates on the powernv documentation., (continued)
- [PULL 012/102] docs: Minor updates on the powernv documentation., Cédric Le Goater, 2021/12/15
- [PULL 003/102] target/ppc: Fixed call to deferred exception, Cédric Le Goater, 2021/12/15
- [PULL 013/102] ppc/pnv.c: add a friendly warning when accel=kvm is used, Cédric Le Goater, 2021/12/15
- [PULL 009/102] ivshmem.c: change endianness to LITTLE_ENDIAN, Cédric Le Goater, 2021/12/15
- [PULL 013/102] ppc/pnv.c: add a friendly warning when accel=kvm is used, Cédric Le Goater, 2021/12/15
- [PULL 014/102] docs/system/ppc/powernv.rst: document KVM support status, Cédric Le Goater, 2021/12/15
- [PULL 018/102] docs: Rename ppc-spapr-hcalls.txt to ppc-spapr-hcalls.rst., Cédric Le Goater, 2021/12/15
- [PULL 019/102] Link new ppc-spapr-hcalls.rst file to pseries.rst., Cédric Le Goater, 2021/12/15
- [PULL 015/102] ppc/pnv.c: fix "system-id" FDT when -uuid is set, Cédric Le Goater, 2021/12/15
- [PULL 021/102] softfloat: Add flag specific to Inf - Inf, Cédric Le Goater, 2021/12/15
- [PULL 023/102] softfloat: Add flags specific to Inf / Inf and 0 / 0,
Cédric Le Goater <=
- [PULL 026/102] softfloat: Add flag specific to signaling nans, Cédric Le Goater, 2021/12/15
- [PULL 027/102] target/ppc: Update float_invalid_op_addsub for new flags, Cédric Le Goater, 2021/12/15
- [PULL 025/102] softfloat: Add flag specific to convert non-nan to int, Cédric Le Goater, 2021/12/15
- [PULL 022/102] softfloat: Add flag specific to Inf * 0, Cédric Le Goater, 2021/12/15
- [PULL 017/102] docs: rSTify ppc-spapr-hcalls.txt, Cédric Le Goater, 2021/12/15
- [PULL 024/102] softfloat: Add flag specific to sqrt(-x), Cédric Le Goater, 2021/12/15
- [PULL 028/102] target/ppc: Update float_invalid_op_mul for new flags, Cédric Le Goater, 2021/12/15
- [PULL 016/102] docs: Introducing pseries documentation., Cédric Le Goater, 2021/12/15
- [PULL 037/102] target/ppc: Update fmadd for new flags, Cédric Le Goater, 2021/12/15
- [PULL 031/102] target/ppc: Update float_invalid_cvt for new flags, Cédric Le Goater, 2021/12/15