From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 3C7F63857C55 for ; Thu, 9 Mar 2023 16:11:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3C7F63857C55 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 329FwHAW032414; Thu, 9 Mar 2023 16:11:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=pp1; bh=H4BPESZz9ZwWR3zpxRp4DdGoRLASxX+Rqxo3BUPmlzQ=; b=Z0ATdmnCKte5DKkREZXdlBjt8KsXl2GU58wiKIEIKw+5d2fXIdydYJNblrCXJRMUsVIY 5Bn12sqm/zTm8ikQy3zGpoCyL6GYC3pJY9M9C9LrLfJV+5dICrD+Amah1AJNldhgN7Xl QTNq0ymXnGlNdqIe/krmgNlICB6fNs4qES12MjMiw9ni6c8KLlsQ8nvyVEx9B/mzim9H AJsGRC5JHljYzP2qbFC90VcGo5Ejs3PkRLcSAVndFQzAFgsExXKMvp20H0LX59RlsoEP 2LX/I3sg04YvdsRFJwthmvSvbdtLEg6xI5SDUtc11hqnFuqg0ZeIkQ0UvL6mOuO4aSyL 8g== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3p7gvrknnw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 09 Mar 2023 16:11:40 +0000 Received: from m0098416.ppops.net (m0098416.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 329FLoew032238; Thu, 9 Mar 2023 16:11:39 GMT Received: from ppma04dal.us.ibm.com (7a.29.35a9.ip4.static.sl-reverse.com [169.53.41.122]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3p7gvrknnj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 09 Mar 2023 16:11:39 +0000 Received: from pps.filterd (ppma04dal.us.ibm.com [127.0.0.1]) by ppma04dal.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 329FkIDo011849; Thu, 9 Mar 2023 16:11:39 GMT Received: from smtprelay02.wdc07v.mail.ibm.com ([9.208.129.120]) by ppma04dal.us.ibm.com (PPS) with ESMTPS id 3p6gbvcbk9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 09 Mar 2023 16:11:39 +0000 Received: from smtpav02.wdc07v.mail.ibm.com (smtpav02.wdc07v.mail.ibm.com [10.39.53.229]) by smtprelay02.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 329GBbdc20513392 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 9 Mar 2023 16:11:37 GMT Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 36C855805D; Thu, 9 Mar 2023 16:11:37 +0000 (GMT) Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 681B35805F; Thu, 9 Mar 2023 16:11:36 +0000 (GMT) Received: from toto.the-meissners.org (unknown [9.65.233.34]) by smtpav02.wdc07v.mail.ibm.com (Postfix) with ESMTPS; Thu, 9 Mar 2023 16:11:36 +0000 (GMT) Date: Thu, 9 Mar 2023 11:11:34 -0500 From: Michael Meissner To: Segher Boessenkool Cc: 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: Mail-Followup-To: Michael Meissner , Segher Boessenkool , gcc-patches@gcc.gnu.org, "Kewen.Lin" , David Edelsohn , Peter Bergner , Will Schmidt References: <20230303213544.GJ25951@gate.crashing.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230303213544.GJ25951@gate.crashing.org> X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 5z6SUdUYS1zwuc1U0dsqK3eFE6NPysA9 X-Proofpoint-ORIG-GUID: SwBXKS4g4aY8G2HoA18jnassc7spADsb X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-09_08,2023-03-09_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 clxscore=1015 priorityscore=1501 impostorscore=0 adultscore=0 spamscore=0 lowpriorityscore=0 mlxscore=0 mlxlogscore=532 malwarescore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2303090127 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,KAM_SHORT,RCVD_IN_MSPIKE_H2,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 Fri, Mar 03, 2023 at 03:35:44PM -0600, Segher Boessenkool wrote: > 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. Ok. > 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. Ok. > > +/* { 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 :-( Yep. > 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). Yes it is needed if GCC is configured against an older GLIBC before the full IEEE 128-bit support was added. For example, on my big endian test system, you get warnings if you switch the floating point format. I would imagine it would also fail on little endian system with older libraries. -- Michael Meissner, IBM PO Box 98, Ayer, Massachusetts, USA, 01432 email: meissner@linux.ibm.com