From patchwork Thu Aug 3 08:12:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 130386 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f41:0:b0:3e4:2afc:c1 with SMTP id v1csp989903vqx; Thu, 3 Aug 2023 01:15:38 -0700 (PDT) X-Google-Smtp-Source: APBJJlFT7WREC8P8N1mCEeiiUwcNQ5OmTnOmQCgl+zFD2J+eEod4v1bZzkKbOMX5L2ytAz+Y7rNP X-Received: by 2002:a17:906:8444:b0:993:e752:1a6f with SMTP id e4-20020a170906844400b00993e7521a6fmr6905949ejy.6.1691050537829; Thu, 03 Aug 2023 01:15:37 -0700 (PDT) Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id m21-20020a1709066d1500b00992d6fae2bfsi12145499ejr.953.2023.08.03.01.15.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 01:15:37 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=N6C0uY+W; arc=fail (signature failed); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BF5763855583 for ; Thu, 3 Aug 2023 08:14:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BF5763855583 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1691050483; bh=q97dgJcKaznDaiT0AcgXdXUVvbNbn77jPctO9i1S91I=; h=Date:Subject:To:Cc:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=N6C0uY+W/3wCPtMXG9axfjbkhl2Eukfgh6NFvNi/gAm3ljD+IFcrH8/lwXqnegqwf T6hP16fWf/mCVT0cuR3dn8QedHT4RzwyKy+q5ux5UMXvBolyct2BMVGmrVETqQKQ6K z0hDh7hAZiU3SP88IwM8Ugwrdl0YIR+9yry3WDeE= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on2050.outbound.protection.outlook.com [40.107.15.50]) by sourceware.org (Postfix) with ESMTPS id E53613857345 for ; Thu, 3 Aug 2023 08:12:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E53613857345 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Rm8y3OOMEb8GE3ksQ2yAxYnYw8ye30Tb9Ba1sVnnH9DP4lN+uAYsdYi3OvpHVhouNTYPdxTTYtsT+5GZZO/jZenp2CCFB33U8a8lq7OqTzRQt7DPn8LkEAd8y1C5FXlTdeWxHzvxVRZ344G9cODORr8cqI2gyil++GdGLub4P/0XrH42qBdYDSWHPuuElKbepK/qXFqbFP+JVL9PKXlvWb1I80L3VmmJP9IIS//lRBSJUMFYIGTJqc99ksR2i8mUg3DPUiLKcfeLuU7mFpVNdh3t1dUVooRiSQ6o64Zsf77z8oa+TNWfg1rcFglxdgNQE3e1vyz6EqHsI5q2dZ3QFw== 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=q97dgJcKaznDaiT0AcgXdXUVvbNbn77jPctO9i1S91I=; b=eqeJzTaFoYzBAKzcGl+iRqn3NaMZfYIJltHvoC+3QvDLIkjIanQj0FSgifn7rxBBvZb0eaQSGRKXdf/llawVno3klMKHbattJ2bbpKJD2I6+SGzYydM3yDft7qOY49OQr3teDkkql/57a8ALIDS90Lji71YEDV9+RYh+7ezTgMnac3P1/NEai1jcedUaQdWKq64hkKGGav01oLqjGYN6PgFnRjV6h0PuKsd1mQh1i6KJwGH8ssXrBKT0aCYrxpavbPlniGUz6gUzP3sAPhttPebYrzdQMW+cxOl0EhU3aASIqWbTnr3SXDrdJZAMUGExT28NGHxR6js+l++Me8d1hQ== 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 DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23) by VE1PR04MB7359.eurprd04.prod.outlook.com (2603:10a6:800:1a0::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.47; Thu, 3 Aug 2023 08:12:07 +0000 Received: from DU2PR04MB8790.eurprd04.prod.outlook.com ([fe80::e5cf:5743:ab60:b14e]) by DU2PR04MB8790.eurprd04.prod.outlook.com ([fe80::e5cf:5743:ab60:b14e%5]) with mapi id 15.20.6631.046; Thu, 3 Aug 2023 08:12:07 +0000 Message-ID: <5a5fae9d-e240-c808-702b-93871e39be47@suse.com> Date: Thu, 3 Aug 2023 10:12:04 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.13.1 Subject: [PATCH 05/10] x86: replace/correct bogus "prefix_extra" Content-Language: en-US To: "gcc-patches@gcc.gnu.org" Cc: Uros Bizjak , Hongtao Liu , Jan Hubicka , Kirill Yukhin References: <9bef986f-7441-c4a9-5bfd-7bbed0a3d950@suse.com> In-Reply-To: <9bef986f-7441-c4a9-5bfd-7bbed0a3d950@suse.com> X-ClientProxiedBy: FR0P281CA0236.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:b2::8) To DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|VE1PR04MB7359:EE_ X-MS-Office365-Filtering-Correlation-Id: 1da7d35b-4ffc-4afa-f63b-08db93f953ea X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ShBe5If0N20gl5LKRds2ZodGBjAY8Hz4aLWncb11cr2MVt0NLeRBcJnkj7mxx10AMyt9jM0GrdrdjJQCPJCO1HehAG4qhlxfHB5ooUlXf0x6mg7AItJppx2bTiS64stMA5vYA6H2V+eThtuSQR7d+fxrHNDfBIlu6ADQOuLUO02b5cKVJG3RpsrSdBlgjUai+1E3KeLcWfeEIB8lQHadnQh/bD8q1KpGDF7TLLQE09jwgIUwbpNBQ1vHPsYRMkMiZmn7TUC6GD4GIZzv4W2/JMb+RO89mZA2moTeCV1QepVM65H+4czfid0Aa4FdcpQjEDItp44/fdaxpv3Oewf7mKkjF/Pyc2YFtFy2qZDRnU9c7Tae/QtaMCS6MtyNRTE4hnv3I3Gp2zyX4PRmepJ2V99lCHJHQBXbjSzpi/Z3NiKM63jYhr/b3ALzQqtcBPrB8u2DrJtCrznfQjp7zdrmc5wWexHCQYrKDz+J9BS2WcL/lgHWA9HauChpjcvL6N47iRA0vycQPGwQkd1LGwPhXQGG19tLRy1pDpPTwMAOKkOdPU+KEH8ZppRnVv0nasSz05vgKC9ZS/drFynWMUXNMm56GbqC+fWWydkNZ/Ngd0qGeaVHEbqJ3xGk18XjpJL4kmuCi30Q9XlcMrPc3+HTHg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU2PR04MB8790.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(396003)(376002)(346002)(136003)(366004)(39860400002)(451199021)(41300700001)(66556008)(316002)(2906002)(4326008)(6916009)(66946007)(66476007)(8936002)(8676002)(5660300002)(38100700002)(26005)(36756003)(186003)(6506007)(86362001)(2616005)(31696002)(6512007)(478600001)(54906003)(6486002)(6666004)(31686004)(66899021)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?DzthuH9OoVUrNLO5v58tGa7LpF2B?= =?utf-8?q?yOnwAv3pidei5DNFZCK+S7EwYa4G1IbmYp5uN/gypARMr2ck6hRssTuiX1lXhFSck?= =?utf-8?q?RGLeVL6MSuoef0sT/Mxle59gblOYky3Yz/jdE3u4/Vh15Lgy7hGmLyVY1XoZ17gRG?= =?utf-8?q?ApszvpOhoIoTvU7IK5udzcWVaNK1iug03hd4GDrA6yLqNz9QgYtnItW0d/sE1LXMw?= =?utf-8?q?QF5gN76LZQdYbNvUuKeFw++67dgAO470xI5qmhXtv5bkHEmHjoWEwHCCSsMpZqAYZ?= =?utf-8?q?Fqk7z26Ww1ZI/7RUCVpXoDQ1EvBp0wOoa0X8NiLUgopzW4Kr9SltB31CHHYRIwKOq?= =?utf-8?q?v6s+lwLz+swkFHeHB9DgD+EssmUPjLtuDPzlHcCXXrVft2bH84D/Bfq0gf5yXETqu?= =?utf-8?q?Egp0RuB/0WIjlnN3Zyx+iZSco9dIYHPrNSe2+mN8ZpjW0oSpQlVfHyAWiuvGu1z0/?= =?utf-8?q?KsvVO9448HQ9jP32EtzJUUsh/h7NROHR4DTbYL2lFSOGKm1H0WDzvC2ZrafTFGtLv?= =?utf-8?q?0jtjD9ObgvW/BqVCN18hLp41xqm73gMl+Y+JF5W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I6YvUCuddmPihUE/Zq1gz3zw666TTmmoQd9aSu?= =?utf-8?q?28QSEB8ieiEVbJACMv2Z63UeMLsOUaAn1SLsubL6J3IiMWnpp1UrOJyZh75k2Vyv4?= =?utf-8?q?E7mV90vH/g2A?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1da7d35b-4ffc-4afa-f63b-08db93f953ea X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Aug 2023 08:12:06.9391 (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: S4mGbgv/WCRzZV8gI6ZTqIiEFbj+oMHjuMWzrQQRHSiavOfLiMtRSVaVzdQuB2sypfNtLvqNRYTwQP9D86pcyQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7359 X-Spam-Status: No, score=-3027.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jan Beulich via Gcc-patches From: Jan Beulich Reply-To: Jan Beulich Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773195008808074987 X-GMAIL-MSGID: 1773195008808074987 In the rdrand and rdseed cases "prefix_0f" is meant instead. For mmx_floatv2siv2sf2 1 is correct only for the first alternative. For the integer min/max cases 1 uniformly applies to legacy and VEX encodings (the UB and SW variants are dealt with separately anyway). Same for {,V}MOVNTDQA. Unlike {,V}PEXTRW, which has two encoding forms, {,V}PINSRW only has a single form in 0f space. (In *vec_extract note that the dropped part if the condition also referenced non-existing alternative 2.) Of the integer compare insns, only the 64-bit element forms are encoded in 0f38 space. gcc/ * config/i386/i386.md (@rdrand): Add "prefix_0f". Drop "prefix_extra". (@rdseed): Likewise. * config/i386/mmx.md (3 [smaxmin and umaxmin cases]): Adjust "prefix_extra". * config/i386/sse.md (@vec_set_0): Likewise. (*sse4_1_3): Likewise. (*avx2_eq3): Likewise. (avx2_gt3): Likewise. (_pinsr): Likewise. (*vec_extract): Likewise. (_movntdqa): Likewise. --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -25943,7 +25943,7 @@ "TARGET_RDRND" "rdrand\t%0" [(set_attr "type" "other") - (set_attr "prefix_extra" "1")]) + (set_attr "prefix_0f" "1")]) (define_insn "@rdseed" [(set (match_operand:SWI248 0 "register_operand" "=r") @@ -25953,7 +25953,7 @@ "TARGET_RDSEED" "rdseed\t%0" [(set_attr "type" "other") - (set_attr "prefix_extra" "1")]) + (set_attr "prefix_0f" "1")]) (define_expand "pause" [(set (match_dup 0) --- a/gcc/config/i386/mmx.md +++ b/gcc/config/i386/mmx.md @@ -2483,7 +2483,7 @@ vp\t{%2, %1, %0|%0, %1, %2}" [(set_attr "isa" "noavx,noavx,avx") (set_attr "type" "sseiadd") - (set_attr "prefix_extra" "1,1,*") + (set_attr "prefix_extra" "1") (set_attr "prefix" "orig,orig,vex") (set_attr "mode" "TI")]) @@ -2532,7 +2532,7 @@ vpb\t{%2, %1, %0|%0, %1, %2}" [(set_attr "isa" "noavx,noavx,avx") (set_attr "type" "sseiadd") - (set_attr "prefix_extra" "1,1,*") + (set_attr "prefix_extra" "1") (set_attr "prefix" "orig,orig,vex") (set_attr "mode" "TI")]) @@ -2561,7 +2561,7 @@ vp\t{%2, %1, %0|%0, %1, %2}" [(set_attr "isa" "noavx,noavx,avx") (set_attr "type" "sseiadd") - (set_attr "prefix_extra" "1,1,*") + (set_attr "prefix_extra" "1") (set_attr "prefix" "orig,orig,vex") (set_attr "mode" "TI")]) @@ -2623,7 +2623,7 @@ vpw\t{%2, %1, %0|%0, %1, %2}" [(set_attr "isa" "noavx,noavx,avx") (set_attr "type" "sseiadd") - (set_attr "prefix_extra" "1,1,*") + (set_attr "prefix_extra" "1") (set_attr "prefix" "orig,orig,vex") (set_attr "mode" "TI")]) --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -11064,7 +11064,7 @@ (const_string "1") (const_string "*"))) (set (attr "prefix_extra") - (if_then_else (eq_attr "alternative" "5,6,7,8,9") + (if_then_else (eq_attr "alternative" "5,6,9") (const_string "1") (const_string "*"))) (set (attr "length_immediate") @@ -16779,7 +16779,7 @@ vp\t{%2, %1, %0|%0, %1, %2}" [(set_attr "isa" "noavx,noavx,avx") (set_attr "type" "sseiadd") - (set_attr "prefix_extra" "1,1,*") + (set_attr "prefix_extra" "1") (set_attr "prefix" "orig,orig,vex") (set_attr "mode" "TI")]) @@ -16813,7 +16813,10 @@ "TARGET_AVX2 && !(MEM_P (operands[1]) && MEM_P (operands[2]))" "vpcmpeq\t{%2, %1, %0|%0, %1, %2}" [(set_attr "type" "ssecmp") - (set_attr "prefix_extra" "1") + (set (attr "prefix_extra") + (if_then_else (eq (const_string "mode") (const_string "V4DImode")) + (const_string "1") + (const_string "*"))) (set_attr "prefix" "vex") (set_attr "mode" "OI")]) @@ -17048,7 +17051,10 @@ "TARGET_AVX2" "vpcmpgt\t{%2, %1, %0|%0, %1, %2}" [(set_attr "type" "ssecmp") - (set_attr "prefix_extra" "1") + (set (attr "prefix_extra") + (if_then_else (eq (const_string "mode") (const_string "V4DImode")) + (const_string "1") + (const_string "*"))) (set_attr "prefix" "vex") (set_attr "mode" "OI")]) @@ -18843,7 +18849,7 @@ (const_string "*"))) (set (attr "prefix_extra") (if_then_else - (and (not (match_test "TARGET_AVX")) + (ior (eq_attr "prefix" "evex") (match_test "GET_MODE_NUNITS (mode) == 8")) (const_string "*") (const_string "1"))) @@ -20004,8 +20010,7 @@ (set_attr "prefix_data16" "1") (set (attr "prefix_extra") (if_then_else - (and (eq_attr "alternative" "0,2") - (eq (const_string "mode") (const_string "V8HImode"))) + (eq (const_string "mode") (const_string "V8HImode")) (const_string "*") (const_string "1"))) (set_attr "length_immediate" "1") @@ -22349,7 +22354,7 @@ "%vmovntdqa\t{%1, %0|%0, %1}" [(set_attr "isa" "noavx,noavx,avx") (set_attr "type" "ssemov") - (set_attr "prefix_extra" "1,1,*") + (set_attr "prefix_extra" "1") (set_attr "prefix" "orig,orig,maybe_evex") (set_attr "mode" "")])