From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 508033858D33 for ; Wed, 22 Feb 2023 11:29:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 508033858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1677065363; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=lDKAnAAH2fKN2CVoBS8Pf0iCL5qEDKJTrLaNrDcVQeU=; b=FuqCFKrp6lyo3zo4743zODPJSH6Y0GNJVX8A2PrMsOSQ1+QwurPhnTEzdFhXOFRExwhYcu XiUK8CbVoJkVs6XHiYok/afW907UCV2ZuOhDQt6TW+oFKlVYNJvDhFiC5Hi2J1YOqtvfCg SBRKoiYxa8Ugj0kzhdKSlIJpb6XrLak= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-402-iDGdDIAOOmm3dTSnPyv_FA-1; Wed, 22 Feb 2023 06:29:20 -0500 X-MC-Unique: iDGdDIAOOmm3dTSnPyv_FA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6999B28004E2; Wed, 22 Feb 2023 11:29:20 +0000 (UTC) Received: from calimero.vinschen.de (unknown [10.39.192.118]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3E0C0C15BA0; Wed, 22 Feb 2023 11:29:20 +0000 (UTC) Received: by calimero.vinschen.de (Postfix, from userid 500) id 188A6A80C86; Wed, 22 Feb 2023 12:29:19 +0100 (CET) Date: Wed, 22 Feb 2023 12:29:19 +0100 From: Corinna Vinschen To: Hau Hsu Cc: kito.cheng@sifive.com, newlib@sourceware.org Subject: Re: [PATCH 1/1] RISC-V: Use the new libm code if possible Message-ID: Reply-To: newlib@sourceware.org Mail-Followup-To: Hau Hsu , kito.cheng@sifive.com, newlib@sourceware.org References: <20230222015907.43288-1-hau.hsu@sifive.com> MIME-Version: 1.0 In-Reply-To: <20230222015907.43288-1-hau.hsu@sifive.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Feb 22 09:59, Hau Hsu wrote: > 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 > --- > 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 9bb8af02f..a29557a6d 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__ > -- > 2.39.0 Pushed. Thanks, Corinna