From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id AAC5B3857824 for ; Wed, 5 Oct 2022 16:01:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AAC5B3857824 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.95,161,1661846400"; d="scan'208";a="84048401" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa3.mentor.iphmx.com with ESMTP; 05 Oct 2022 08:01:01 -0800 IronPort-SDR: EpxWz0MfEIhTJsnt+xgue49BkNce/hCRfK5urNk890GH7LWT9wf3E1yaRTKkN2P3YoBLtJU7nE SB3vZp4iX7iX+UOSldZCPYxZ97Dz2oBj5VG+v0sM+a5IMvYLsScQGGWKhMRy2Owq3DF7afCqRu uWAMZC9q9dpzj4m5sE/tskifQHhtRqewtaOxJucIkj8Fa0qE41HC1roaeT21vlf7rx5IrxMcKf uA6P2QaljTQAD5xjZgaOqLimxVTcEWVnMvVIs9GmZH2wXaF/f9JGW9HTRZzwxmGkSR6oEqnUAJ NsE= Date: Wed, 5 Oct 2022 16:00:55 +0000 From: Joseph Myers X-X-Sender: jsm28@digraph.polyomino.org.uk To: Letu Ren CC: , Subject: Re: [PATCH] stdlib/strfrom: Add copysign to fix NAN issue on riscv (BZ #29501) In-Reply-To: <20221005111353.3921-1-fantasquex@gmail.com> Message-ID: References: <20221005111353.3921-1-fantasquex@gmail.com> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-13.mgc.mentorg.com (139.181.222.13) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-3110.8 required=5.0 tests=BAYES_00,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=no 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 Wed, 5 Oct 2022, Letu Ren via Libc-alpha wrote: > Since glibc ought to be consistent here between types and architectures, this > patch adds copysign to fix this problem if the string is NAN. This patch > leverge Macro instead of creating a function under sysdeps directory > because there is only one place which needs a keep-sign conversion. We avoid architecture-specific conditionals in architecture-independent code as far as possible. The way to handle this kind of thing is a sysdeps header containing an inline function to convert from float to double while preserving NaN signs. -- Joseph S. Myers joseph@codesourcery.com