Message ID | 88d618dc-0c78-81ed-5b1c-6157b9ba7a30@suse.com |
---|---|
State | Committed |
Commit | c89298404071e3b42eb7e2bfbdbaa45573538b53 |
Headers |
Return-Path: <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D27133835695 for <patchwork@sourceware.org>; Fri, 27 May 2022 08:09:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D27133835695 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1653638945; bh=Y+MXsSsGC23krgPaqgRDmfVgHW8OLj2AnOgZPTo2Tzg=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=U05SS7hrXd+0vVWDQ6+ZAAg0qplFyfZb0YELNDkEqbXUO7PllVqnUpTebCJq5iUu/ KdDyT/MiSRW1WtSrMOqtDwzqWwzLoWQnt0bwPwBUlHXlFKrbu3gB+WufC69lqW+6A6 ip6T0YlJa01y4gBRgsJ4adXZwOvIfW7JdUAB13Vk= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [194.104.109.102]) by sourceware.org (Postfix) with ESMTPS id C06D5382CF33 for <gcc-patches@gcc.gnu.org>; Fri, 27 May 2022 08:05:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C06D5382CF33 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05lp2170.outbound.protection.outlook.com [104.47.17.170]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id de-mta-41-WKBbxruvN066WTYNNt1Rxw-1; Fri, 27 May 2022 10:05:15 +0200 X-MC-Unique: WKBbxruvN066WTYNNt1Rxw-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e2WRz5XxHyX5BtEC/GhbEpdc9UAdVBpT52xocIJ+PycWcIzyQ5i8ItEif1Da+1/izRc787/iED8TN2BMVUirx03PV8cTPgoPm5A0pZiXmR5I+xVln714RKYBlzOakrOwC2otHmYGrncJyAFvNFgsaNRX+C/oY+eqa38r6Z7V1jSjOGDH64eXKZ/9TNnXaVDT2qIM+HKedbAR/c4XbhUCUtpx3SJ/AJPLg7N11Xfmp0S/lPonnwPLggylhm7rHwemocW3tLuo74hDnX2VIpci3FM7dJSKp0cFp6V7kgAq2J0ZCKwEidkOy56aCHMawSWllxOrgS1kcIu/x6ubfDLDrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Y+MXsSsGC23krgPaqgRDmfVgHW8OLj2AnOgZPTo2Tzg=; b=EUgW/4J26jnj9FUkTtP/RzMhrhxjJJ7U/Ca17R0RrKNKgoqoOrHdKXBS6qaSWbha7fAcxIt1iz0SH3BSIwOCgGotLYwB1yJ07NW+Louw5b5m/39i22G9twRGGpIGkzwvdTzuDmWuTW8Sqx5usmpY5DYU6bkUt7Vc9vPHB429/e6JbG0dC0cDR8ODxJSucCSh0Wy49KiN2oTIGeY95J2VV5zruMN10iEIUGpep0Wt01o6QFUylLAViBOdXap/sH7Hk3DySQK0xPZiPyVxqzCHo+xRq4Z28AvcrunkTBiTgr2FFxXODmEhv0/pzzIEJw/BnEwUCc5iIS/4Tys8aDQE8A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Received: from VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) by PA4PR04MB7821.eurprd04.prod.outlook.com (2603:10a6:102:c5::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.13; Fri, 27 May 2022 08:05:14 +0000 Received: from VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::dfa:a64a:432f:e26b]) by VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::dfa:a64a:432f:e26b%7]) with mapi id 15.20.5293.013; Fri, 27 May 2022 08:05:14 +0000 Message-ID: <88d618dc-0c78-81ed-5b1c-6157b9ba7a30@suse.com> Date: Fri, 27 May 2022 10:05:12 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Content-Language: en-US To: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org> Subject: [PATCH] x86: correct bmi2_umul<mode><dwi>3_1's MEM_P() uses Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: AM5PR0601CA0037.eurprd06.prod.outlook.com (2603:10a6:203:68::23) To VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8054ba37-03af-4de9-3916-08da3fb7a113 X-MS-TrafficTypeDiagnostic: PA4PR04MB7821:EE_ X-Microsoft-Antispam-PRVS: <PA4PR04MB78215A10B46605A3DEAD947FB3D89@PA4PR04MB7821.eurprd04.prod.outlook.com> X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Sg7F6sl/RPlzoQc4Jvg20h4VHdYsmDzHxxA1oD9pgiRdDh44b1/idp0njRe6H1iwgxFYV9qk5+1aImGjR/HBA3UI556VNGWbD0FDiMBvpXrV6puiZk/bJrZaqkiOzHNI785oizEklMlGfRKTeEwBSBEjZ9P2Ch2OKX2qE2gq1nTyyNxn3JDB1bLQnikLJo3D8UlyhFEu52h/2NPoz0nvOE8w51BmzOIo3Vl52qOQABvFxW6sgtS1aIcBc7FM9zf250Cv5ByT1HoJz1gJhRKskV4WjFCoB0hX0ydxvjY0BneNEvN7ZdO2uqcdKOEz2uA0NQAe534EvNVePdOUbRqvQrBNQ2xyiI7yQj4JzVpK/hwrSducPJpiVgmbYsjFhFs3iLhwrahp5t6jtfQFqkmUcUAzqZm3Z3JwT9mFaA+QkiEsQ35lKpr2Ze7DEFaAqnW9yuasd9gOlUNWEjkkrXJJ0886ldGQZikPVjNV73aJGPSKSsMbqzCayK+wtjbN4DwtHdUlrrhXnLum6wwPsgO/HToy4PKWhu16RgmdOOZ4i6ed1b24Bii9UawVQ4bP2iVTal4aMEir2mIktRmml2yrOdhJy80Bxz40B8A4G3z8LMWrIbDbWvP1TE9qZWMi9Mm/sJRb7vSvQQ+Cz07LLMNrK/QjRJIuSmL6cVAgQgbYNTd9t59WrtBSpHFCfFQTYQchkM6s8JN0jV4HNOmM2wbID0hggvfY4ZTaABDwhN9aM8UkYd9E5ZYf8X7OTAO2gRNP X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR04MB6560.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(36756003)(31696002)(2906002)(86362001)(6916009)(186003)(31686004)(2616005)(4744005)(26005)(38100700002)(8936002)(4326008)(5660300002)(6512007)(66946007)(66556008)(66476007)(8676002)(6506007)(316002)(6486002)(508600001)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?m+aSfCTED4LH2QJCmt0HgKijNTQc?= =?utf-8?q?xEY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xTyV/VI3aKoy6FQdn7pfQLfdCY84PTLX7exEmRj2G36CnY0rKD96M2XOhq?= =?utf-8?q?lXMCDCMVs/j35nAkNK8iZv6t9eb1/bMwdauEBoqhwcbvNJSZOgcxWQia5aNUjaSxm?= =?utf-8?q?ncJ77OWUkpwCOHJ8O/HzKgUFlis3WgJUeR818Ph+a5vfLAADxfd75RtSVW0xAIeGm?= =?utf-8?q?SYWSJipOEV75oYN7Sl3Re5+Qpu3wUH0gPCmoJuOZm1yY06ldnYnhowYfw4mhjXfHn?= =?utf-8?q?ihpx+c81/56ozZUXwHqQgwkjJTv2gbN0oWZg2turQ84MGJ2upwvGt+IcDlP2J6u0S?= =?utf-8?q?w7fDEfLxMEFs2wXkLRc2t3xgXwB4DMLqwD6HYvDMlpqIPWTMQkObaRwC0xvnNAWx9?= =?utf-8?q?ncj/uKPzw4OQBV+uuq/5PvSZtHdijg8IZ0HfHpv5J34/wsYyGCMWyaUwJnztY2wo6?= =?utf-8?q?SyOxJjBb8z0t/HtYUVpffAQ5LeA/gRIb+NAum3JC6C/pZ04yl1NHjK43a84yUEzUR?= =?utf-8?q?Cz9b6pEfSi6V4dpL5Xn6V5LR7Y3oaYc58nnuPTE6AaGMyW0A0RS4rs+PmetfG9ibn?= =?utf-8?q?k4LrWuQe0mmwNNuB+FcAP8Xc+KcKJIdKdKhYzibQ2PPZyOMp36TOQL6K7MuXdOOkM?= =?utf-8?q?/cUvlMynVR0W/xl86w34ZgCVjXOmsjLtxsvW2wcWGG1MMv0HOjUll/gA279WN3kIJ?= =?utf-8?q?ypQXNwVDBdZC8qs8I49w0LRDRtTuo5KVlI9rYTNQu1OoRuZx7+Qu+71XkwnQMcJLs?= =?utf-8?q?yW4b/tf9ZPBB+4vYRG2IOSfeU4Tv2o/A=3D=3D?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8054ba37-03af-4de9-3916-08da3fb7a113 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6560.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 May 2022 08:05:14.1553 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /+Vw8laTxXv44mFPfiNg8WHn1KjFkMUisyBkYH/b7OEaMQKHlcrV+90wzQKO2mx6nsikxu8A3qe8YflPquC9ew== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7821 X-Spam-Status: No, score=-3031.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Jan Beulich via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Jan Beulich <jbeulich@suse.com> Cc: hubicka@ucw.cz Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> |
Series |
x86: correct bmi2_umul<mode><dwi>3_1's MEM_P() uses
|
|
Commit Message
Jan Beulich
May 27, 2022, 8:05 a.m. UTC
It's pretty clear that the operand numbers in the MEM_P() checks are off by one, perhaps due to a copy-and-paste oversight (unlike in most other places here we're dealing with two outputs). --- What I don't understand is why operand 2 is "nonimmediate_operand", not "register_operand" (which afaict would eliminate the need for these MEM_P() checks). This would then also extend to e.g. the subsequent umul<mode><dwi>3_1 and mul<mode><dwi>3_1 (and apparently quite a few more).
Comments
On Fri, May 27, 2022 at 10:05 AM Jan Beulich <jbeulich@suse.com> wrote: > > It's pretty clear that the operand numbers in the MEM_P() checks are > off by one, perhaps due to a copy-and-paste oversight (unlike in most > other places here we're dealing with two outputs). > --- > What I don't understand is why operand 2 is "nonimmediate_operand", not > "register_operand" (which afaict would eliminate the need for these > MEM_P() checks). This would then also extend to e.g. the subsequent > umul<mode><dwi>3_1 and mul<mode><dwi>3_1 (and apparently quite a few > more). Because they are commutative (due to % operand modifier) and reload can put memory operand into each operand. Patch is OK with the appropriate ChangeLog entry. Thanks, Uros. > > --- a/gcc/config/i386/i386.md > +++ b/gcc/config/i386/i386.md > @@ -8465,7 +8465,7 @@ > (zero_extend:<DWI> (match_dup 3))) > (match_operand:QI 4 "const_int_operand" "n"))))] > "TARGET_BMI2 && INTVAL (operands[4]) == <MODE_SIZE> * BITS_PER_UNIT > - && !(MEM_P (operands[1]) && MEM_P (operands[2]))" > + && !(MEM_P (operands[2]) && MEM_P (operands[3]))" > "mulx\t{%3, %0, %1|%1, %0, %3}" > [(set_attr "type" "imulx") > (set_attr "prefix" "vex") >
On 27.05.2022 10:57, Uros Bizjak wrote: > On Fri, May 27, 2022 at 10:05 AM Jan Beulich <jbeulich@suse.com> wrote: >> >> It's pretty clear that the operand numbers in the MEM_P() checks are >> off by one, perhaps due to a copy-and-paste oversight (unlike in most >> other places here we're dealing with two outputs). >> --- >> What I don't understand is why operand 2 is "nonimmediate_operand", not >> "register_operand" (which afaict would eliminate the need for these >> MEM_P() checks). This would then also extend to e.g. the subsequent >> umul<mode><dwi>3_1 and mul<mode><dwi>3_1 (and apparently quite a few >> more). > > Because they are commutative (due to % operand modifier) and reload > can put memory operand into each operand. > > Patch is OK with the appropriate ChangeLog entry. Thanks, and yes, I did notice I failed to add a ChangeLog entry right after sending (being a result of such no longer be required in binutils, which I work more frequently with), sorry. This is what I did add already: gcc/ 2022-05-XX Jan Beulich <jbeulich@suse.com> * config/i386/i386.md (bmi2_umul<mode><dwi>3_1): Correct MEM_P() arguments. Jan
--- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -8465,7 +8465,7 @@ (zero_extend:<DWI> (match_dup 3))) (match_operand:QI 4 "const_int_operand" "n"))))] "TARGET_BMI2 && INTVAL (operands[4]) == <MODE_SIZE> * BITS_PER_UNIT - && !(MEM_P (operands[1]) && MEM_P (operands[2]))" + && !(MEM_P (operands[2]) && MEM_P (operands[3]))" "mulx\t{%3, %0, %1|%1, %0, %3}" [(set_attr "type" "imulx") (set_attr "prefix" "vex")