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 360C73858D33 for ; Tue, 10 May 2022 23:07:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 360C73858D33 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 24AN16aS031208; Tue, 10 May 2022 23:07:43 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3fywur41va-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 May 2022 23:07:43 +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 24AN5bK6014295; Tue, 10 May 2022 23:07:43 GMT Received: from ppma03wdc.us.ibm.com (ba.79.3fa9.ip4.static.sl-reverse.com [169.63.121.186]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3fywur41uy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 May 2022 23:07:43 +0000 Received: from pps.filterd (ppma03wdc.us.ibm.com [127.0.0.1]) by ppma03wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 24AMx5QR030542; Tue, 10 May 2022 23:07:42 GMT Received: from b03cxnp08027.gho.boulder.ibm.com (b03cxnp08027.gho.boulder.ibm.com [9.17.130.19]) by ppma03wdc.us.ibm.com with ESMTP id 3fwgd9ga4u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 May 2022 23:07:42 +0000 Received: from b03ledav001.gho.boulder.ibm.com (b03ledav001.gho.boulder.ibm.com [9.17.130.232]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 24AN7fYZ12059060 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 May 2022 23:07:41 GMT Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9D9A56E065; Tue, 10 May 2022 23:07:41 +0000 (GMT) Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1C8BC6E05B; Tue, 10 May 2022 23:07:41 +0000 (GMT) Received: from [9.160.179.82] (unknown [9.160.179.82]) by b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTP; Tue, 10 May 2022 23:07:40 +0000 (GMT) Message-ID: <3a52445c-face-46eb-bc61-07f9d9cc79ca@linux.ibm.com> Date: Tue, 10 May 2022 18:07:40 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: rs6000: Prefer assigning the MMA vector operands to altivec registers [PR105556] Content-Language: en-US From: Peter Bergner To: Segher Boessenkool Cc: David Edelsohn , GCC Patches References: <20220510223516.GP25951@gate.crashing.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: pRKYtJv1ClLugddjq_OFxXAWlAIOlVsS X-Proofpoint-GUID: QH-OpQ38s81ihmCBoGkkwlyBcnDVci55 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-05-10_07,2022-05-10_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=707 clxscore=1015 bulkscore=0 lowpriorityscore=0 impostorscore=0 mlxscore=0 priorityscore=1501 adultscore=0 phishscore=0 suspectscore=0 malwarescore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2205100096 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham 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, 10 May 2022 23:07:45 -0000 On 5/10/22 5:46 PM, Peter Bergner wrote: >> Out of interest, did you try using v,?wa (so just two alternatives, not >> four)? Or did you think it wouldresult in measurably worse code? Or >> did you decide it is not such bad backend code size explosion after >> all :-) > > I have not tried that, but I will and see what happens. > I'm slightly worried that since 'v' is part of 'wa', then saying > '?wa' might just cancel the 'v' usage, but I'll see how it works. > If it works and simplifies the patch, great! I'll report back. So using 'v','?wa' for both vector operands does give us the code we want for this loop. Yea! However, looking closer, that 2 alternative version isn't quite as "optimal" as the version with 4 alternatives 'v','v','?d','?d' and 'v','?d','v','?d'. That's because the 2 alt version is an all or nothing thing, you either get both 'v' operands or you potentially get both 'd'. The 4 alt version is more fine grained and has alternatives where one gets a 'v' for sure and the other a 'd'. That said, if even one operand is forced into a 'd' register, then our chances of good performance are lost, so the fact we can get one in a 'v' probably doesn't matter and given it's cleaner code with fewer alternatives, let's go with 'v','?wa'. Ok with you? I'll kick off a bootstrap and regtest with that change. Peter