public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Siddhesh Poyarekar <siddhesh@sourceware.org>
To: libc-alpha@sourceware.org
Cc: adhemerval.zanella@linaro.org, fweimer@redhat.com,
	joseph@codesourcery.com
Subject: [PATCH v2 1/5] x86 long double: Support pseudo numbers in fpclassifyl
Date: Wed, 23 Dec 2020 17:25:58 +0530	[thread overview]
Message-ID: <20201223115602.3472627-2-siddhesh@sourceware.org> (raw)
In-Reply-To: <20201223115602.3472627-1-siddhesh@sourceware.org>

Also move sysdeps/i386/fpu/s_fpclassifyl.c to
sysdeps/x86/fpu/s_fpclassifyl.c and remove
sysdeps/x86_64/fpu/s_fpclassifyl.c
---
 sysdeps/{i386 => x86}/fpu/s_fpclassifyl.c | 4 ++++
 sysdeps/x86_64/fpu/s_fpclassifyl.c        | 2 --
 2 files changed, 4 insertions(+), 2 deletions(-)
 rename sysdeps/{i386 => x86}/fpu/s_fpclassifyl.c (87%)
 delete mode 100644 sysdeps/x86_64/fpu/s_fpclassifyl.c

diff --git a/sysdeps/i386/fpu/s_fpclassifyl.c b/sysdeps/x86/fpu/s_fpclassifyl.c
similarity index 87%
rename from sysdeps/i386/fpu/s_fpclassifyl.c
rename to sysdeps/x86/fpu/s_fpclassifyl.c
index 501312f51e..a48b7685c4 100644
--- a/sysdeps/i386/fpu/s_fpclassifyl.c
+++ b/sysdeps/x86/fpu/s_fpclassifyl.c
@@ -34,6 +34,10 @@ __fpclassifyl (long double x)
     retval = FP_ZERO;
   else if (ex == 0 && (hx & 0x80000000) == 0)
     retval = FP_SUBNORMAL;
+  /* Pseudo-normals, i.e. pseudo-zero, pseudo-infinity and un-normals.  They
+     behave like NaNs, so categorize them as such.  */
+  else if ((hx & 0x80000000) == 0)
+    retval = FP_NAN;
   else if (ex == 0x7fff)
     retval = ((hx & 0x7fffffff) | lx) != 0 ? FP_NAN : FP_INFINITE;
 
diff --git a/sysdeps/x86_64/fpu/s_fpclassifyl.c b/sysdeps/x86_64/fpu/s_fpclassifyl.c
deleted file mode 100644
index 856854b0f5..0000000000
--- a/sysdeps/x86_64/fpu/s_fpclassifyl.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#include <sysdeps/i386/fpu/s_fpclassifyl.c>
-
-- 
2.29.2


  reply	other threads:[~2020-12-23 11:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-23 11:55 [PATCH v2 0/5] x86 pseudo-normal numbers Siddhesh Poyarekar
2020-12-23 11:55 ` Siddhesh Poyarekar [this message]
2020-12-23 17:59   ` [PATCH v2 1/5] x86 long double: Support pseudo numbers in fpclassifyl Adhemerval Zanella
2020-12-23 11:55 ` [PATCH v2 2/5] x86 long double: Support pseudo numbers in isnanl Siddhesh Poyarekar
2020-12-23 18:03   ` Adhemerval Zanella
2020-12-23 11:56 ` [PATCH v2 3/5] Partially revert 681900d29683722b1cb0a8e565a0585846ec5a61 Siddhesh Poyarekar
2020-12-23 12:09   ` Florian Weimer
2020-12-23 11:56 ` [PATCH v2 4/5] x86 long double: Consider pseudo numbers as signaling Siddhesh Poyarekar
2020-12-23 18:14   ` Adhemerval Zanella
2020-12-23 11:56 ` [PATCH v2 5/5] x86 long double: Add tests for pseudo normal numbers Siddhesh Poyarekar

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=20201223115602.3472627-2-siddhesh@sourceware.org \
    --to=siddhesh@sourceware.org \
    --cc=adhemerval.zanella@linaro.org \
    --cc=fweimer@redhat.com \
    --cc=joseph@codesourcery.com \
    --cc=libc-alpha@sourceware.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: link
Be 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).