From: Kito Cheng <kito.cheng@sifive.com>
To: newlib@sourceware.org, kito.cheng@gmail.com
Cc: Kito Cheng <kito.cheng@sifive.com>
Subject: [PATCH 1/2] RISC-V: NaN should return 0 for finite[f]
Date: Wed, 28 Oct 2020 23:41:26 +0800 [thread overview]
Message-ID: <20201028154127.41565-1-kito.cheng@sifive.com> (raw)
---
newlib/libm/machine/riscv/s_finite.c | 2 +-
newlib/libm/machine/riscv/sf_finite.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/newlib/libm/machine/riscv/s_finite.c b/newlib/libm/machine/riscv/s_finite.c
index f5336e5dc..1f1f2244d 100644
--- a/newlib/libm/machine/riscv/s_finite.c
+++ b/newlib/libm/machine/riscv/s_finite.c
@@ -44,7 +44,7 @@
int finite(double x)
{
long fclass = _fclass_d (x);
- return (fclass & FCLASS_INF) == 0;
+ return (fclass & (FCLASS_INF | FCLASS_NAN)) == 0;
}
#else
#include "../../common/s_finite.c"
diff --git a/newlib/libm/machine/riscv/sf_finite.c b/newlib/libm/machine/riscv/sf_finite.c
index f1cf5c6ce..a17b0fa36 100644
--- a/newlib/libm/machine/riscv/sf_finite.c
+++ b/newlib/libm/machine/riscv/sf_finite.c
@@ -41,7 +41,7 @@
int finitef(float x)
{
long fclass = _fclass_f (x);
- return (fclass & FCLASS_INF) == 0;
+ return (fclass & (FCLASS_INF | FCLASS_NAN)) == 0;
}
#else
#include "../../common/sf_finite.c"
--
2.28.0
next reply other threads:[~2020-10-28 15:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-28 15:41 Kito Cheng [this message]
2020-10-28 15:41 ` [PATCH 2/2] RISC-V: Fix wrong including file in s_isinf.c Kito Cheng
2020-10-29 8:41 ` [PATCH 1/2] RISC-V: NaN should return 0 for finite[f] Corinna Vinschen
2020-10-29 9:46 ` Kito Cheng
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=20201028154127.41565-1-kito.cheng@sifive.com \
--to=kito.cheng@sifive.com \
--cc=kito.cheng@gmail.com \
--cc=newlib@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).