From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by sourceware.org (Postfix) with ESMTP id C9B413858C1F for ; Tue, 15 Feb 2022 22:06:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C9B413858C1F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.crashing.org Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 21FM5CDA016463; Tue, 15 Feb 2022 16:05:12 -0600 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 21FM5B8e016462; Tue, 15 Feb 2022 16:05:11 -0600 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Tue, 15 Feb 2022 16:05:11 -0600 From: Segher Boessenkool To: Michael Meissner , gcc-patches@gcc.gnu.org, David Edelsohn , Bill Schmidt , Peter Bergner , Will Schmidt Subject: Re: [PATCH], PR target/99708 - Define __SIZEOF_FLOAT128__ and __SIZEOF_IBM128__ Message-ID: <20220215220511.GE614@gate.crashing.org> References: <20220215194506.GC614@gate.crashing.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Feb 2022 22:06:14 -0000 On Tue, Feb 15, 2022 at 03:18:30PM -0500, Michael Meissner wrote: > On Tue, Feb 15, 2022 at 01:45:06PM -0600, Segher Boessenkool wrote: > > On Tue, Feb 15, 2022 at 12:49:41PM -0500, Michael Meissner wrote: > > > Define __SIZEOF_FLOAT128__ and __SIZEOF_IBM128__. > > > > > > Define the sizes of the PowerPC specific types __float128 and __ibm128 if those > > > types are enabled. > > > > This is very silly of course, both of these are 16 bytes. Abusing this > > to see if the types exist is at least as silly (there are much better > > mechanisms to do this). > > This is just trying to close out the PR that people asked for. I put many arguments in that PR why this is a futile thing to have. On all older compilers these macros will not be defined, but the types often are. If you are willing to not support older compilers properly anyway, you could just *always* use the types, which will work with most very old compilers as well (and the approach using these propesed predefines will *not*!) This is (not) solving a non-problem. > > So, this facilitates bad habits and bad code. But, whatever, the macros > > are just stating totally obvious and redundant facts, no problem, let's > > just ignore that pepople only want it to abuse it. > > > > > gcc/ > > > PR target/99708 > > > * config/rs6000/rs6000-c.cc (rs6000_target_modify_macros): Define > > > __SIZEOF_FLOAT128__ and __SIZEOF_IBM128__ if we have float128 > > > support. > > > > No. __SIZEOF_IBM128__ should be defined if and only if __ibm128 is > > defined. > > In the current implementation, __ibm128 is only defined if __float128 was > defined. I did have patches 6 months or so to define __ibm128 on any system > with IBM 128-bit long double. But those were never applied to the trunk. > > > This should be tested directly, it should not depend on that some other > > code did what it does today. That would also make the code much more > > obvious. Read that last paragraph again please? This is the only thing that needs changing. > Given __float128 and __ibm128 are defined at the same time, I don't see the > need for a separate target-supports.exp test, and so forth. But if you want > that, I can easily do it. No, I'm asking for it in the code that does the predefine. Not in the testcase, testcases are dirty pretty much always, and it is acceptable there because the scope is so limited. Segher