From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com [68.232.137.252]) by sourceware.org (Postfix) with ESMTPS id E4FA83858D37 for ; Thu, 2 Mar 2023 17:18:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E4FA83858D37 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.98,228,1673942400"; d="scan'208";a="98773643" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 02 Mar 2023 09:18:17 -0800 IronPort-SDR: /uyQTSs4yo7SfA9EBcLVrwclbt9tQLlsdzjieYE+uPs3Df0tVEOv1jIBFiiMrdZPex/etJp4SU vdxvsocA5IYbEoaSKnf5xsto79mKS4k8Bbm8ALdJnaqONHb4lRD0r7yn1ZVkSlXNrXpndl0mxU a29DmGVp1qqtB9LiTZLTiGKnOo7K3DQAQfgk1hhrsq52lO+kF/zS6UAsrm4YpHZQVVIT5nBmUz nUZqwh19JWy7wjapx9+wYlqtz3jHtppDY9FZaKj51feY5w6RORvgmYCA3HR1TOa7cvFhyFG6Tr qx8= Message-ID: <9d103f4d-f11d-6705-8a3f-2d8644e10809@codesourcery.com> Date: Thu, 2 Mar 2023 17:18:11 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH] amdgcn: Add instruction patterns for conditional min/max operations To: Paul-Antoine Arras , References: <1f1f9f15-e12e-ec4e-7b74-ba7bf3b64449@codesourcery.com> Content-Language: en-GB From: Andrew Stubbs In-Reply-To: <1f1f9f15-e12e-ec4e-7b74-ba7bf3b64449@codesourcery.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-11.mgc.mentorg.com (139.181.222.11) To svr-ies-mbx-11.mgc.mentorg.com (139.181.222.11) X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,NICE_REPLY_A,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: On 01/03/2023 16:56, Paul-Antoine Arras wrote: > This patch introduces instruction patterns for conditional min and max > operations (cond_{f|s|u}{max|min}) in the GCN machine description. It > also allows the exec register to be saved in SGPRs to avoid spilling to > memory. > Tested on GCN3 Fiji gfx803. > > OK for trunk? Not quite yet, but it's only a few cosmetic issues, I think. > +(define_insn_and_split "3" > + [(set (match_operand:V_DI 0 "register_operand" "= v") > + (minmaxop:V_DI > + (match_operand:V_DI 1 "gcn_alu_operand" "% v") > + (match_operand:V_DI 2 "gcn_alu_operand" " v"))) > + (clobber (reg:DI VCC_REG))] No need to make it commutative when the two operands have the same constraints. There's a few more instances of this later. > + if ( == smin || == smax) > + emit_insn (gen_vec_cmpdi (vcc, minp ? gen_rtx_LT (VOIDmode, 0, 0) : > + gen_rtx_GT (VOIDmode, 0, 0), operands[1], operands[2])); > + else > + emit_insn (gen_vec_cmpdi (vcc, minp ? gen_rtx_LTU (VOIDmode, 0, 0) : > + gen_rtx_GTU (VOIDmode, 0, 0), operands[1], operands[2])); > + Long lines need to be wrapped, here and elsewhere. Andrew