public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-6859] libfortran: Provide fallback __issignalingl for IBM extended long double Date: Tue, 25 Jan 2022 11:50:18 +0000 (GMT) [thread overview] Message-ID: <20220125115018.4F9093857C7B@sourceware.org> (raw) https://gcc.gnu.org/g:480caa1f4ab1f138435239d67ffe3126c5e27b2b commit r12-6859-g480caa1f4ab1f138435239d67ffe3126c5e27b2b Author: Jakub Jelinek <jakub@redhat.com> Date: Tue Jan 25 12:48:35 2022 +0100 libfortran: Provide fallback __issignalingl for IBM extended long double On Mon, Jan 17, 2022 at 12:11:59AM +0100, FX via Gcc-patches wrote: > This patch is the third in my “signaling NaN” series. > For targets with IEEE support but without the issignaling macro in libc > (i.e., everywhere except glibc), this allows us to provide a fallback > implementation. This doesn't seem to handle the powerpc* IBM double double long double. __LDBL_IS_IEC_60559__ isn't defined for this type, because it is far from an IEEE754 type, but it has signaling NaNs - as can be seen in glibc libc/sysdeps/ieee754/ldbl-128ibm/s_issignalingl.c the type is a pair of doubles and whether it is a sNaN or qNaN is determined by whether the first double is a sNaN or qNaN. 2022-01-25 Jakub Jelinek <jakub@redhat.com> * ieee/issignaling_fallback.h (__issignalingl): Define for IBM extended long double are returning __issignaling on the first double. Diff: --- libgfortran/ieee/issignaling_fallback.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/libgfortran/ieee/issignaling_fallback.h b/libgfortran/ieee/issignaling_fallback.h index 4632bc510f7..5b9e1c88d6f 100644 --- a/libgfortran/ieee/issignaling_fallback.h +++ b/libgfortran/ieee/issignaling_fallback.h @@ -137,6 +137,19 @@ __issignalingl (long double x) return ret || (((exi & 0x7fff) == 0x7fff) && (hxi > 0xc0000000)); } +#elif (__LDBL_DIG__ == 31) + +/* Long double is 128-bit IBM extended type. */ + +static inline int +__issignalingl (long double x) +{ + union { long double value; double parts[2]; } u; + + u.value = x; + return __issignaling (u.parts[0]); +} + #elif (__LDBL_DIG__ == 33) && __LDBL_IS_IEC_60559__ /* Long double is 128-bit type. */
reply other threads:[~2022-01-25 11:50 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220125115018.4F9093857C7B@sourceware.org \ --to=jakub@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).