From patchwork Wed Jul 5 08:00:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 115997 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp1702824vqx; Wed, 5 Jul 2023 01:01:15 -0700 (PDT) X-Google-Smtp-Source: APBJJlGfbvV+sTRTI2jd7eLxZZ6k1G99s5voRhT0prFwjgmtYYuZV9eudAZql8zog0TkXKWZP0x7 X-Received: by 2002:aa7:da13:0:b0:51e:fb9:7615 with SMTP id r19-20020aa7da13000000b0051e0fb97615mr1360818eds.13.1688544074834; Wed, 05 Jul 2023 01:01:14 -0700 (PDT) Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id s3-20020aa7c543000000b0051df1fef473si6270043edr.549.2023.07.05.01.01.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jul 2023 01:01:14 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=pLZe9tG+; arc=fail (signature failed); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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 824513858414 for ; Wed, 5 Jul 2023 08:01:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 824513858414 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1688544072; bh=FXeX7A42ZeGjvjI2lrP18cCKhyFJZRMzRZuUECvmTPg=; 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=pLZe9tG+5HdvqsNofBM3gvIRcSgerxBKtLPVS8R3ALBg+JLBC3/LJenJ+DeP8yt4y HjBddYWBHCQUf4TG5bgio48TTKpv91mh+6RcXiMwdX+q9aYW5D/n0ZmmZzRF4V0j6h G/me0cvukg2cjL1lXJHTzj+mUDx5dshKPZ2UBklM= 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-db5eur01on2070.outbound.protection.outlook.com [40.107.15.70]) by sourceware.org (Postfix) with ESMTPS id EC9123858CD1 for ; Wed, 5 Jul 2023 08:00:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EC9123858CD1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fAF9KRvWXhiOOEbEXRivp9cf70+ViQSYE6u3T5zFLlmCna+7dVGUgyO7lvBPrY2Ql2yWP9tGQWd55aNCGAHH0d7Z2tFkby4opxzxe30iYVUwM1njKrV+2gp2cFiPguRGAKO0vKOUVkHisAtFx4PskuWxtGTzV0yL9+/R6M5mIi+nKIZu5cknk2o0VEqZIx/w0g24dIBMHmDvNpJ2hymhKZlcOyeZ3rfL9IMIamqphruez3limgADO+QaljPc/S6MnD2sxYXLmSNoXcARaHiJiYoZJeLxkcu+pHFDlLSIl7/QIP1WNvca86oXOwixDVdHA18TZjUw3fsHSB/yl19/1g== 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=FXeX7A42ZeGjvjI2lrP18cCKhyFJZRMzRZuUECvmTPg=; b=cVm4MOqjxvu9kek3xCgP6K9hk6twOZ+g+ApBQXXoVwrNssqbhYBp01LtRZAvWFwZR4gbcCAMmGVkRppI15G7mOqqUyUERpyjc1gHJCJEHNldcePomfaQRbz/QKRkh9EtCtaj9y5/CiyM6/eUof3wkLxrzRYBoDQRMhFcDAuYdl4K23MfUzv/OyC34P27/IJws6ZJglfdMhkXo0R5JBPoJvNKiY7q/KIR6ybFXaqbjIARdWWR3MVEoJwzHDCsOw79UFgioTLuDSjtJAC4YdDP0XwpayU4bOP/Ft5HqNZHt67hcAoAeEmbA5M4zdWENLKCnas/NCYl7vDxLpQ0AuwUMA== 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 AM9PR04MB8713.eurprd04.prod.outlook.com (2603:10a6:20b:43c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Wed, 5 Jul 2023 08:00:25 +0000 Received: from DU2PR04MB8790.eurprd04.prod.outlook.com ([fe80::9bd3:48c9:ff58:9880]) by DU2PR04MB8790.eurprd04.prod.outlook.com ([fe80::9bd3:48c9:ff58:9880%4]) with mapi id 15.20.6544.024; Wed, 5 Jul 2023 08:00:25 +0000 Message-ID: <9406368b-8b88-9da9-a89c-1c610eb22f66@suse.com> Date: Wed, 5 Jul 2023 10:00:23 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: [PATCH 1/2] x86: correct / simplify @vec_extract_hi_ and vec_extract_hi_v32qi Content-Language: en-US To: "gcc-patches@gcc.gnu.org" Cc: Hongtao Liu , Kirill Yukhin References: <2d4f6176-9005-c1da-d5dc-56c35c3ed673@suse.com> In-Reply-To: <2d4f6176-9005-c1da-d5dc-56c35c3ed673@suse.com> X-ClientProxiedBy: FR0P281CA0094.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a9::14) To DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM9PR04MB8713:EE_ X-MS-Office365-Filtering-Correlation-Id: cdff2442-86b7-49d4-b75f-08db7d2de3b1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zTm5hnF7kz1gND57aN4R5Y2faBBa6BiZdaWCxA7vs6XUOnjCdRA0Sie49TcgmYtrtXVxqnK1EdPcp7Jvz+NDd6ssLHTcP+Z9sF8wQBf0y5N4t7DD1RMZUTv/6ZTBohDixghO46nNHxBGGGRmgVprejQZm0m6Xolee06NAx2tEgoEeB+q8cfGKpH6m/gQ1KgqMAzkP3l0O38Q047ATzyZ0zFoei4BKmOczsXm40FgluSvUj4M/tR45k8lHI8IPIP0LhM2fhQbmmtVlL9pQSRJdBICnb/IzOcC/Z6AvQCiIQHgvTx5GzhXeb7CjkpgeO6TuToeSr5o6MEeOl7rmUcXA6uxxOnA+lIHVjKhpdG/HVBIbozF+1jkGIbuBsO5vG7AstkRZfI9+rt3AkM5IEsy8kA/49h23+GB09HSIpGus1vndWicdTFjcedmM7fzRQcyMky/yYfhWIy+dI7JToDaUJh2ruQgST5F/fRwEhFiyYwDPobMMtcfqICG2j4LNwmBVcBPi4rgXM5W7E7mRcZ1woppq3oHSMwrC8Vde/4RGduA8tddSIox1rGJRltyFEGRwO88QOV0e8U5IB1kubuQXbNuTaYrameR3eBfk2+ghoYumiEzQRCBfnI8Do/RCJqg8bOlF+OiA5lEpZNoXaW2Cg== 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)(39860400002)(136003)(366004)(376002)(346002)(451199021)(6916009)(38100700002)(4326008)(66946007)(66556008)(66476007)(2616005)(186003)(86362001)(36756003)(31696002)(6486002)(6512007)(6506007)(26005)(478600001)(54906003)(31686004)(8936002)(8676002)(5660300002)(2906002)(316002)(83380400001)(41300700001)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?9GzWxzo1zulYeAL8ehHx7Aiv9wOp?= =?utf-8?q?Gzb93y+KRVeqgfPWBuJt5i5BY/jY3X8vSdqpo8Fss2f4YdqVG39OWCxLOKS35F7mZ?= =?utf-8?q?hvOoGKPNt7oBfG6TLwH5GfnIwYzdnMzFly3y9IUp1gU7KR4X2ccsbN8RPtZQujCXs?= =?utf-8?q?N179FnqyqMz/pIVXm1XgAKC/WkpZQnE8KfKQ67ALIg63RDmb0ia403Rqca1H3tVdO?= =?utf-8?q?5J59D7TOsfWCP7LtbjjEP/JHFFdDeGgi5NEbV5ay8RPgW3SrHPje6tZGP0Lpk2kTC?= =?utf-8?q?YPEvR9PXuN1+FF8wXNpRzTmIHmituiT8tDhbt5UmCfBG/wbq3/YO30r/IOTQNCbjN?= =?utf-8?q?UtTIBQs+5z9dDh38YfMqjeAlMzEv7u0o9yt9M6pxlNGJv80ugwiaHQrqN0MKHJQ/2?= =?utf-8?q?L6aSAlOdyIpKwZFd+yB95T+jOFJekE2xmjdxu5tvUBWkiVMy135GFgNUL9ieGesrV?= =?utf-8?q?lErRaBqP8EzYmbqPiquywMbLeWybR8Qrvf13Rn+oJZegb6f60ACxfISFsjk2azt/X?= =?utf-8?q?aABnLaLR1zX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ioSdEzuaBQRKADMRi2/ZEln55aoQbdViy5ILxT4?= =?utf-8?q?oslA7bbvCB7s8r3bXVnjW+Hi5zK2Q4qBRNCv6mv8ujWmXQudSm66glioWpwKd6KO6?= =?utf-8?q?mPmsTw0aaw4t?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: cdff2442-86b7-49d4-b75f-08db7d2de3b1 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2023 08:00:25.1252 (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: eeNZIKZZdgokWcVSQ//0hqNzyNb6zILkrnGlRrsaDGmJfBDAnkwj3YbMDGkMOQJzT6n6Rlu+DkyS8PMfdbBLdQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8713 X-Spam-Status: No, score=-3027.3 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770566792228559035?= X-GMAIL-MSGID: =?utf-8?q?1770566792228559035?= The middle alternative each was unusable without enabling AVX512DQ (in addition to AVX512VL), which is entirely unrelated here. The last alternative is usable with AVX512VL only (due to type restrictions on what may be put in the upper 16 YMM registers), and hence is pointlessly forcing 512-bit mode (without actually reflecting that in the "mode" attribute). gcc/ * config/i386/sse.md (@vec_extract_hi_): Drop last alternative. Switch new last alternative's "isa" attribute to "avx512vl". (vec_extract_hi_v32qi): Likewise. --- Like elsewhere I suspect "prefix_extra" is bogus here and should be dropped. Is "sselog1" actually appropriate here? Extracts are special forms of moves after all, not logical operations. Even "sseshuf1" would seem to come closer. --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -12029,9 +12029,9 @@ "operands[1] = gen_lowpart (mode, operands[1]);") (define_insn "@vec_extract_hi_" - [(set (match_operand: 0 "nonimmediate_operand" "=xm,vm,vm") + [(set (match_operand: 0 "nonimmediate_operand" "=xm,vm") (vec_select: - (match_operand:V16_256 1 "register_operand" "x,v,v") + (match_operand:V16_256 1 "register_operand" "x,v") (parallel [(const_int 8) (const_int 9) (const_int 10) (const_int 11) (const_int 12) (const_int 13) @@ -12039,13 +12039,12 @@ "TARGET_AVX" "@ vextract%~128\t{$0x1, %1, %0|%0, %1, 0x1} - vextracti32x4\t{$0x1, %1, %0|%0, %1, 0x1} - vextracti32x4\t{$0x1, %g1, %0|%0, %g1, 0x1}" + vextracti32x4\t{$0x1, %1, %0|%0, %1, 0x1}" [(set_attr "type" "sselog1") (set_attr "prefix_extra" "1") (set_attr "length_immediate" "1") - (set_attr "isa" "*,avx512dq,avx512f") - (set_attr "prefix" "vex,evex,evex") + (set_attr "isa" "*,avx512vl") + (set_attr "prefix" "vex,evex") (set_attr "mode" "OI")]) (define_insn_and_split "vec_extract_lo_v64qi" @@ -12144,9 +12143,9 @@ "operands[1] = gen_lowpart (V16QImode, operands[1]);") (define_insn "vec_extract_hi_v32qi" - [(set (match_operand:V16QI 0 "nonimmediate_operand" "=xm,vm,vm") + [(set (match_operand:V16QI 0 "nonimmediate_operand" "=xm,vm") (vec_select:V16QI - (match_operand:V32QI 1 "register_operand" "x,v,v") + (match_operand:V32QI 1 "register_operand" "x,v") (parallel [(const_int 16) (const_int 17) (const_int 18) (const_int 19) (const_int 20) (const_int 21) @@ -12158,13 +12157,12 @@ "TARGET_AVX" "@ vextract%~128\t{$0x1, %1, %0|%0, %1, 0x1} - vextracti32x4\t{$0x1, %1, %0|%0, %1, 0x1} - vextracti32x4\t{$0x1, %g1, %0|%0, %g1, 0x1}" + vextracti32x4\t{$0x1, %1, %0|%0, %1, 0x1}" [(set_attr "type" "sselog1") (set_attr "prefix_extra" "1") (set_attr "length_immediate" "1") - (set_attr "isa" "*,avx512dq,avx512f") - (set_attr "prefix" "vex,evex,evex") + (set_attr "isa" "*,avx512vl") + (set_attr "prefix" "vex,evex") (set_attr "mode" "OI")]) ;; NB: *vec_extract_0 must be placed before *vec_extracthf.