public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org>
To: newlib-cvs@sourceware.org
Subject: [newlib-cygwin/main] RISC-V: Use the new libm code if possible
Date: Wed, 22 Feb 2023 11:21:29 +0000 (GMT)	[thread overview]
Message-ID: <20230222112129.C5B96385843D@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=97d483c2f81c0865bead701f4d2824a21fae4938

commit 97d483c2f81c0865bead701f4d2824a21fae4938
Author:     Hau Hsu <hau.hsu@sifive.com>
AuthorDate: Wed Feb 22 09:59:07 2023 +0800
Commit:     Corinna Vinschen <corinna@vinschen.de>
CommitDate: Wed Feb 22 12:20:57 2023 +0100

    RISC-V: Use the new libm code if possible
    
    Set  __OBSOLETE_MATH_DEFAULT to 0 if 'd' extension is supported (i.e.
    __riscv_flen == 64).
    
    Base on the comment for  __OBSOLETE_MATH_DEFAULT:
    
    > ... it assumes that the toolchain has ISO C99 support (hexfloat
    > literals, standard fenv semantics), the target has IEEE-754 conforming
    > binary32 float and binary64 double (not mixed endian) representation,
    > standard SNaN representation, double and single precision arithmetics
    > has similar latency and it has no legacy SVID matherr support, only
    > POSIX errno and fenv exception based error handling.
    
    Signed-off-by: Hau Hsu <hau.hsu@sifive.com>

Diff:
---
 newlib/libc/include/machine/ieeefp.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/newlib/libc/include/machine/ieeefp.h b/newlib/libc/include/machine/ieeefp.h
index 9bb8af02f455..a29557a6d00c 100644
--- a/newlib/libc/include/machine/ieeefp.h
+++ b/newlib/libc/include/machine/ieeefp.h
@@ -221,6 +221,11 @@
 #ifdef __riscv_flen
 # define _SUPPORTS_ERREXCEPT
 #endif
+#if __riscv_flen == 64
+# define __OBSOLETE_MATH_DEFAULT 0
+#else
+# define __OBSOLETE_MATH_DEFAULT 1
+#endif
 #endif
 
 #ifdef __i960__

                 reply	other threads:[~2023-02-22 11:21 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=20230222112129.C5B96385843D@sourceware.org \
    --to=corinna@sourceware.org \
    --cc=newlib-cvs@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).