From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id E6BAC3858D29 for ; Fri, 17 Sep 2021 15:14:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E6BAC3858D29 Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 18HEsarX012384; Fri, 17 Sep 2021 11:14:40 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3b4vu5h403-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 17 Sep 2021 11:14:39 -0400 Received: from m0187473.ppops.net (m0187473.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 18HEsjX1013132; Fri, 17 Sep 2021 11:14:39 -0400 Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0a-001b2d01.pphosted.com with ESMTP id 3b4vu5h3yu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 17 Sep 2021 11:14:39 -0400 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 18HEuwNC015431; Fri, 17 Sep 2021 15:14:38 GMT Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by ppma02dal.us.ibm.com with ESMTP id 3b0m3dwc6d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 17 Sep 2021 15:14:38 +0000 Received: from b01ledav002.gho.pok.ibm.com (b01ledav002.gho.pok.ibm.com [9.57.199.107]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 18HFEbRe17957326 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 17 Sep 2021 15:14:37 GMT Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A559E124060; Fri, 17 Sep 2021 15:14:37 +0000 (GMT) Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4A596124052; Fri, 17 Sep 2021 15:14:37 +0000 (GMT) Received: from Bills-MacBook-Pro.local (unknown [9.211.85.128]) by b01ledav002.gho.pok.ibm.com (Postfix) with ESMTP; Fri, 17 Sep 2021 15:14:37 +0000 (GMT) Reply-To: wschmidt@linux.ibm.com Subject: Re: [PATCH 04/18] rs6000: Handle some recent MMA builtin changes To: Segher Boessenkool Cc: gcc-patches@gcc.gnu.org, dje.gcc@gmail.com References: <06bf6e3615041d8bf6192eb1a681227e1bbc82d9.1630511334.git.wschmidt@linux.ibm.com> <20210916233856.GP1583@gate.crashing.org> From: Bill Schmidt Message-ID: <867f3321-f967-5b06-a84c-6a90065892b7@linux.ibm.com> Date: Fri, 17 Sep 2021 10:14:36 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <20210916233856.GP1583@gate.crashing.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: e9ARQX5h6HC9cZdWhFgokWWVxL9pVEjF X-Proofpoint-GUID: DnlPyS0VOyzTbtOtt1JOByKoT_pUamt7 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.391,FMLib:17.0.607.475 definitions=2021-09-17_06,2021-09-17_02,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 suspectscore=0 impostorscore=0 malwarescore=0 phishscore=0 lowpriorityscore=0 clxscore=1015 spamscore=0 mlxscore=0 mlxlogscore=999 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109030001 definitions=main-2109170095 X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP 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: Fri, 17 Sep 2021 15:14:42 -0000 Thanks!  I'll remove the elses in the committed patch, along with a TODO comment for the additional factoring opportunity for when I get to that stage. Thanks for all the reviews! Bill On 9/16/21 6:38 PM, Segher Boessenkool wrote: > Hi! > > On Wed, Sep 01, 2021 at 11:13:40AM -0500, Bill Schmidt wrote: >> Peter Bergner recently added two new builtins __builtin_vsx_lxvp and >> __builtin_vsx_stxvp. These happened to break a pattern in MMA builtins that >> I had been using to automate gimple folding of MMA builtins. Previously, >> every MMA function that could be folded had an associated internal function >> that it was folded into. The LXVP/STXVP builtins are just folded directly >> into memory operations. >> >> Instead of relying on this pattern, this patch adds a new attribute to >> builtins called "mmaint," which is set for all MMA builtins that have an >> associated internal builtin. The naming convention that adds _INTERNAL to >> the builtin index name remains. >> >> The rest of the patch is just duplicating Peter's patch, using the new >> builtin infrastructure. >> * config/rs6000/rs6000-call.c >> (rs6000_gimple_fold_new_mma_builtin): Handle RS6000_BIF_LXVP and >> RS6000_BIF_STXVP. > It is fine to end a changelog line in a colon. > >> + else if (fncode == RS6000_BIF_LXVP) >> + { >> + push_gimplify_context (true); >> + tree offset = gimple_call_arg (stmt, 0); >> + tree ptr = gimple_call_arg (stmt, 1); >> + tree lhs = gimple_call_lhs (stmt); >> + if (TREE_TYPE (TREE_TYPE (ptr)) != vector_pair_type_node) >> + ptr = build1 (VIEW_CONVERT_EXPR, >> + build_pointer_type (vector_pair_type_node), ptr); >> + tree mem = build_simple_mem_ref (build2 (POINTER_PLUS_EXPR, >> + TREE_TYPE (ptr), ptr, offset)); >> + gimplify_assign (lhs, mem, &new_seq); >> + pop_gimplify_context (NULL); >> + gsi_replace_with_seq (gsi, new_seq, true); >> + return true; >> + } > Fwiw, all those cases return, so those "else" are not needed. Also it > would be nice if this could be factored a bit better, hrm. > > Is that "if" in there useful? Maybe add a helper function for it, then? > > Anyway: okay for trunk. Thanks! > > > Segher