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 3B3893858D28 for ; Fri, 3 Mar 2023 21:36:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3B3893858D28 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 323LZj41022404; Fri, 3 Mar 2023 15:35:46 -0600 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 323LZi2k022403; Fri, 3 Mar 2023 15:35:44 -0600 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Fri, 3 Mar 2023 15:35:44 -0600 From: Segher Boessenkool To: Michael Meissner , gcc-patches@gcc.gnu.org, "Kewen.Lin" , David Edelsohn , Peter Bergner , Will Schmidt Subject: Re: [PATCH 2/2] Rework 128-bit complex multiply and divide. Message-ID: <20230303213544.GJ25951@gate.crashing.org> References: 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=-2.9 required=5.0 tests=BAYES_00,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,KAM_SHORT,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! On Fri, Feb 03, 2023 at 12:53:05AM -0500, Michael Meissner wrote: > This patch reworks how the complex multiply and divide built-in functions are > done. > I tested all 3 patchs for PR target/107299 on: Is this part of the proposed commit message? As Ke Wen pointed out, it is wrong. Most of your mail does not belong in a commit message at all, but some probably does? Please do this clearer with future patches. > * config/rs6000/rs6000.cc (create_complex_muldiv): Delete. > (init_float128_ieee): Delete code to switch complex multiply and divide > for long double. I like this kind of patch :-) > +/* Internal function to return the built-in function id for the complex > + multiply operation for a given mode. */ > + > +static inline built_in_function > +complex_multiply_builtin_code (machine_mode mode) > +{ > + return (built_in_function) (BUILT_IN_COMPLEX_MUL_MIN + mode > + - MIN_MODE_COMPLEX_FLOAT); > +} There should be an assert that the mode is as expected gcc_assert (IN_RANGE (mode, MIN_MODE_COMPLEX_FLOAT, MAX_MODE_COMPLEX_FLOAT)); or such. Using more temporaries should make this simpler as well, obviate the need for explicit casts, and make everything fit on short lines. > +static inline built_in_function > +complex_divide_builtin_code (machine_mode mode) > +{ > + return (built_in_function) (BUILT_IN_COMPLEX_DIV_MIN + mode > + - MIN_MODE_COMPLEX_FLOAT); > +} Ditto ofc. > --- /dev/null > +++ b/gcc/testsuite/gcc.target/powerpc/divic3-1.c > @@ -0,0 +1,18 @@ > +/* { dg-do compile { target { powerpc*-*-* } } } */ Leave the target clause out. > +/* { dg-require-effective-target powerpc_p8vector_ok } */ > +/* { dg-require-effective-target longdouble128 } */ > +/* { dg-require-effective-target ppc_float128_sw } */ > +/* { dg-options "-O2 -mpower8-vector -mabi=ieeelongdouble -Wno-psabi" } */ It would be nice if you did not try to add -mpower8-vector in more testcases :-( Is -Wno-psabi needed here? What is the error you get without it / on which configurations? Cargo-culting hiding the warnings makes you see fewer warnings, but that is the opposite of a good idea. > +/* { dg-final { scan-assembler "bl __divtc3" } } */ This name depends on what object format and ABI is in use (some have an extra leading underscore, or a dot, or whatever). Segher