From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id C5B96385843D; Wed, 22 Feb 2023 11:21:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C5B96385843D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1677064889; bh=W8Kk+2PlsJuOexd5X9vSfo56gEdmIT5OAdG/tdr3JQs=; h=From:To:Subject:Date:From; b=kdWnft5/ugAwmkgZHXccYg7GH47Eq8+AcUOEhip+IeTXBAAuTehNSgVgJE99Pjo6L QQYS0m/eZEQCG5hWdpYb+5ME5G+aaTdAfvtpT9zRN8xVJ5ON53mJcSaTHLKG0MkgNW lLW6gFZJVypBMBIE9gniMmAP4ohRlk6LI13WcGfY= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: newlib-cvs@sourceware.org Subject: [newlib-cygwin/main] RISC-V: Use the new libm code if possible X-Act-Checkin: newlib-cygwin X-Git-Author: Hau Hsu X-Git-Refname: refs/heads/main X-Git-Oldrev: 2229f42400b992669a99cba9b42b600b0ba01b7f X-Git-Newrev: 97d483c2f81c0865bead701f4d2824a21fae4938 Message-Id: <20230222112129.C5B96385843D@sourceware.org> Date: Wed, 22 Feb 2023 11:21:29 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D97d483c2f81= c0865bead701f4d2824a21fae4938 commit 97d483c2f81c0865bead701f4d2824a21fae4938 Author: Hau Hsu AuthorDate: Wed Feb 22 09:59:07 2023 +0800 Commit: Corinna Vinschen CommitDate: Wed Feb 22 12:20:57 2023 +0100 RISC-V: Use the new libm code if possible =20 Set __OBSOLETE_MATH_DEFAULT to 0 if 'd' extension is supported (i.e. __riscv_flen =3D=3D 64). =20 Base on the comment for __OBSOLETE_MATH_DEFAULT: =20 > ... 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. =20 Signed-off-by: Hau Hsu 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/mac= hine/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 =3D=3D 64 +# define __OBSOLETE_MATH_DEFAULT 0 +#else +# define __OBSOLETE_MATH_DEFAULT 1 +#endif #endif =20 #ifdef __i960__