From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com [68.232.141.98]) by sourceware.org (Postfix) with ESMTPS id DC93A3858D33 for ; Sat, 21 Jan 2023 13:28:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DC93A3858D33 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.97,235,1669104000"; d="scan'208";a="95245451" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 21 Jan 2023 05:28:02 -0800 IronPort-SDR: BS3Ttp0NViCznRo0wylkPT8GzlncIokI9Z1VynipHMrZMNXhkmcf67xxKh95l4VUCP0Ya/E9yQ PJvpF1jylcjytDFNkXV2z2VnqthYb0IFJvb8zFmUW3R9Os6zMGmZEtRT1RTuoTC0frFz2VESmJ za4IgijkhiZ0t3jYg3xVy9nSQERim7mnyzuj3s0+QN8/IaKYi9YfWDLSE3y5IXaHJ2UyhBmaon ixVdLQbMdS/DEzlwsl5ivNz6YcWJVCgKXfGN3g2hFHJ3ECvrkqtucPlgmn2XMAz/N8NXytvI1P b5M= Message-ID: Date: Sat, 21 Jan 2023 14:27:51 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [Patch] install.texi: Bump newlib version for nvptx + gcn Content-Language: en-US To: Gerald Pfeifer , Tobias Burnus CC: gcc-patches , Tom de Vries , Thomas Schwinge , =?UTF-8?Q?Martin_Li=c5=a1ka?= , Matthias Klose References: <11d635d0-9798-5344-934b-969cb01974ba@codesourcery.com> From: Tobias Burnus In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: quoted-printable X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-15.mgc.mentorg.com (139.181.222.15) To svr-ies-mbx-12.mgc.mentorg.com (139.181.222.12) X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,NICE_REPLY_A,RCVD_IN_MSPIKE_H2,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: Hi Gerald, On 21.01.23 12:58, Gerald Pfeifer wrote: > Is it maybe a little tough to bump the minimal requirement to something > only released yesterday? Or is this not an issue looking at the use cases= ? > (Genuine question. Maybe nothing to worry at all.) On the technical side, the newer newlib version is not yet required. But it looks as if it soon makes a lot of sense to have it: For the AMGCN stack builtins, they currently expand to the same registers and offset calculations as hard-coded in newlib (older version or if the builtin is not available). =E2=80=93 If the stack allocation is changed to non-threadprivate, this will change the location. With the builtins, just recompiling newlib (+libgomp) will work (API preserved but not ABI). [Andrew to provide the stack patch; then me for the 2-line patch to enable OpenMP's reverse offload.] (Hen-egg problem in terms of compilation as newlib is compiled by GCC. Probably only detectable by running it on the offload device and checking whether it fails - not practical for a cross-compiler build.) For AMDGCN's vectorization functions: Those can lead to a significant perfo= rmance advantage. I know that newlib only used some builtins if they are available= . I think AMDGCN will emit code using the new libm functions, which in turn newlib only generates if GCC supports certain new builtins. (hen-egg proble= m, if my assumptions are correct.) [I think Kwok will provide this patch - he did implement the funcs in newli= b.] nvptx: Thomas' patch for libgfortran(*) effectively requires the newer newl= ib - albeit one could imaging that there could be a configure check. [(*) "nvptx, libgfortran: Switch out of "minimal" mode", approved but awaiting approval of another patch)] Thus: As nvptx/amdgcn is (mostly) about offloading code, newlib is compiled usual= ly alongside GCC (e.g. in SUSE, Debian/Ubuntu, ...); additionally, there is static linki= ng such that mixing old vs. new libraries is less likely. Hence, requiring the newest ve= rsion of newlib together with the newest compiler shouldn't be a problem in my opinion. And the if documented now, it cannot be forgotten by the time the pending p= atches get committed... ;-) > And, this predates your patch, in one instance we refer to Newlib (upper > case9, in the other to newlib (lower case). Would it make sense to > converge to one? Maybe, but the question is what to use? The project's webpage has on the fi= rst page: "patch submissions to Newlib" and "automate the testing of newlib". As uppercase, we have: gcc/d/implement-d.texi:@code{CRuntime_Newlib} is set when Newlib is the def= ault C library. gcc/doc/install.texi:Use Newlib (4.3.0 or newer). gcc/doc/invoke.texi:This option requires Newlib Nano IO, so GCC must be con= figured with gcc/doc/invoke.texi:Newlib. gcc/doc/invoke.texi:Specify the PRU MCU variant to use. Check Newlib for t= he exact list of gcc/doc/sourcebuild.texi:Target supports Newlib. gcc/doc/sourcebuild.texi:the code size of Newlib formatted I/O functions. gcc/po/gcc.pot:"Newlib Nano IO." (Add a missing "Requires " to complete the sentence.) and as lowercase: gcc/doc/install.texi:Specifies that @samp{newlib} is gcc/doc/install.texi:@samp{newlib}. gcc/doc/install.texi:RTEMS configurations, which currently use newlib. The= option is denotes a configure argument.) gcc/doc/invoke.texi:newlib board library linking. The default is @code{or1= ksim}. gcc/doc/invoke.texi:select linker and preprocessor options for use with new= lib. gcc/doc/sourcebuild.texi:@item newlib (Side remark: While some @sample{newlib} in install.texi refer to a value t= o a configure argument, in the quote above it refers to the library itself.) gcc/po/gcc.pot:msgid "Configure the newlib board specific runtime. The def= ault is or1ksim." gcc/po/gcc.pot:"This used to select linker and preprocessor options for use= with newlib." libstdc++-v3/doc/xml/manual/configure.xml: vintage (2.3 and newer), 'g= nu' is automatically selected. On newlib-based libstdc++-v3/doc/xml/manual/configure.xml: systems ('--with_newl= ib=3Dyes') and OpenBSD, 'newlib' is libstdc++-v3/doc/xml/manual/evolution.xml:A new clocale model for new= lib is available. Thoughts? Thanks for the comments! Tobias ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=C3=9Fe 201= , 80634 M=C3=BCnchen; Gesellschaft mit beschr=C3=A4nkter Haftung; Gesch=C3= =A4ftsf=C3=BChrer: Thomas Heurung, Frank Th=C3=BCrauf; Sitz der Gesellschaf= t: M=C3=BCnchen; Registergericht M=C3=BCnchen, HRB 106955