From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dedi548.your-server.de (dedi548.your-server.de [85.10.215.148]) by sourceware.org (Postfix) with ESMTPS id A16763858D28 for ; Tue, 10 Oct 2023 05:26:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A16763858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embedded-brains.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embedded-brains.de Received: from sslproxy06.your-server.de ([78.46.172.3]) by dedi548.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qq5G6-000Cb7-5n; Tue, 10 Oct 2023 07:26:18 +0200 Received: from [82.100.198.138] (helo=mail.embedded-brains.de) by sslproxy06.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qq5G6-000IDi-1W; Tue, 10 Oct 2023 07:26:18 +0200 Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id B2AB5480041; Tue, 10 Oct 2023 07:26:17 +0200 (CEST) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavis, port 10032) with ESMTP id YTsq5W60Armn; Tue, 10 Oct 2023 07:26:17 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 4E655480164; Tue, 10 Oct 2023 07:26:17 +0200 (CEST) X-Virus-Scanned: amavis at zimbra.eb.localhost Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavis, port 10026) with ESMTP id h_hN4EpYdbkM; Tue, 10 Oct 2023 07:26:17 +0200 (CEST) Received: from [10.10.171.34] (unknown [10.10.171.34]) by mail.embedded-brains.de (Postfix) with ESMTPSA id DB76B480041; Tue, 10 Oct 2023 07:26:16 +0200 (CEST) Message-ID: <9a1432c3-9fe7-4389-bf48-927ad22e8935@embedded-brains.de> Date: Tue, 10 Oct 2023 07:26:16 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] RISC-V: Support Zfinx/Zdinx extension. Content-Language: en-US To: Kito Cheng , newlib@sourceware.org, kito.cheng@gmail.com Cc: Jesse Huang References: <20230726100319.45915-1-kito.cheng@sifive.com> From: Sebastian Huber In-Reply-To: <20230726100319.45915-1-kito.cheng@sifive.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Authenticated-Sender: smtp-embedded@poldi-networks.de X-Virus-Scanned: Clear (ClamAV 0.103.10/27056/Mon Oct 9 09:40:11 2023) X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,SPF_HELO_NONE,SPF_PASS,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 26.07.23 12:03, Kito Cheng via Newlib wrote: > Zfinx/Zdinx are new extensions ratified in 2022, it similar to F/D=20 > extensions, support hard float operation for single/double precision,=20 > but the difference between Zfinx/Zdinx and F/D is Zfinx/Zdinx is=20 > operating under general purpose registers rather than dedicated=20 > floating-point registers. This patch improve the hard float support=20 > detection for RISC-V port, so that Zfinx/Zdinx can have better/right=20 > performance. Co-authored-by: Jesse Huang This patch probably broke the RTEMS build of Newlib: ../../../../../gnu-mirror-gcc-d04fe55/newlib/libm/machine/riscv/fesetroun= d.c:=20 In function 'fesetround': ../../../../../gnu-mirror-gcc-d04fe55/newlib/libm/machine/riscv/fesetroun= d.c:56:12:=20 error: 'FE_RMODE_MASK' undeclared (first use in this function) 56 | round &=3D FE_RMODE_MASK; | ^~~~~~~~~~~~~ ../../../../../gnu-mirror-gcc-d04fe55/newlib/libm/machine/riscv/fesetroun= d.c:56:12:=20 note: each undeclared identifier is reported only once for each function=20 it appears in make[6]: *** [Makefile:48845: libm/machine/riscv/libm_a-fesetround.o]=20 Error 1 make[6]: *** Waiting for unfinished jobs.... ../../../../../gnu-mirror-gcc-d04fe55/newlib/libm/complex/cprojl.c: In=20 function 'cprojl': ../../../../../gnu-mirror-gcc-d04fe55/newlib/libm/complex/cprojl.c:60:18:= =20 warning: implicit declaration of function 'copysignl'; did you mean=20 'copysignf'? [-Wimplicit-function-declaration] 60 | IMAG_PART(w) =3D copysignl(0.0L, cimagl(z)); | ^~~~~~~~~ | copysignf make[6]: Leaving directory=20 '/tmp/sh/b-rsb/riscv-rtems6-gcc-d04fe55-newlib-fe5886a-x86_64-linux-gnu-1= /build/riscv-rtems6/rv32imaf/ilp32f/newlib' We have #if defined(__riscv_f) || defined(__riscv_zfinx) [...] /* Per "The RISC-V Instruction Set Manual: Volume I: User-Level ISA: * Version 2.1", Section 8.2, "Floating-Point Control and Status * Register": * * Rounding Mode Mnemonic Meaning Meaning * ------------- ---------------- ------- * 000 RNE Round to Nearest, ties to Even * 001 RTZ Round towards Zero * 010 RDN Round Down (towards =E2=88=92=E2=88=9E= ) * 011 RUP Round Up (towards +=E2=88=9E) * 100 RMM Round to Nearest, ties to Max Magnit= ude * 101 Invalid. Reserved for future use. * 110 Invalid. Reserved for future use. * 111 In instruction=E2=80=99s rm field, s= elects=20 dynamic rounding mode; * In Rounding Mode register, Invalid */ #define FE_TONEAREST_MM 0x00000004 #define FE_UPWARD 0x00000003 #define FE_DOWNWARD 0x00000002 #define FE_TOWARDZERO 0x00000001 #define FE_TONEAREST 0x00000000 #define FE_RMODE_MASK 0x7 vs. int fesetround(int round) { #ifdef __RISCV_HARD_FLOAT /* Mask round to be sure only valid rounding bits are set */ round &=3D FE_RMODE_MASK; --=20 embedded brains GmbH Herr Sebastian HUBER Dornierstr. 4 82178 Puchheim Germany email: sebastian.huber@embedded-brains.de phone: +49-89-18 94 741 - 16 fax: +49-89-18 94 741 - 08 Registergericht: Amtsgericht M=C3=BCnchen Registernummer: HRB 157899 Vertretungsberechtigte Gesch=C3=A4ftsf=C3=BChrer: Peter Rasmussen, Thomas= D=C3=B6rfler Unsere Datenschutzerkl=C3=A4rung finden Sie hier: https://embedded-brains.de/datenschutzerklaerung/