From patchwork Fri Jul 14 09:42:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 120376 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a6b2:0:b0:3e4:2afc:c1 with SMTP id c18csp2383859vqm; Fri, 14 Jul 2023 02:43:04 -0700 (PDT) X-Google-Smtp-Source: APBJJlFqdtWa/pYpjVtUZyW60qjXYRziHpNb7ZNhFiiOJCSRSomoD37qsA74IJ/qTzaH7xeOu/GS X-Received: by 2002:aa7:da4d:0:b0:51d:d3d4:d02f with SMTP id w13-20020aa7da4d000000b0051dd3d4d02fmr4352188eds.8.1689327784266; Fri, 14 Jul 2023 02:43:04 -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 n16-20020aa7db50000000b0051de30928d6si8415977edt.658.2023.07.14.02.43.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jul 2023 02:43:04 -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=jrVdMo9a; 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 17BFD3858418 for ; Fri, 14 Jul 2023 09:43:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 17BFD3858418 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1689327783; bh=coD9S7+wt0k4FDwT6DtnEIJg0FcURtWPZ0H+pcMySKI=; h=Date:To:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=jrVdMo9a98cghqUd0FIBmSLAjRDvEX0iPBGTciqyhg1i9LJ/8RteYJOprXbwphc04 aHF0PDe/3alfBooB2N9c82YBqcm+vGXC0Pox2dQfazLCgUCLwASSIvMe7ohmseGoB1 SShW/3Zis1CDNn/LtAiGSE3D3rhgfMMjUb0pf2hQ= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2075.outbound.protection.outlook.com [40.107.241.75]) by sourceware.org (Postfix) with ESMTPS id 263423858C53 for ; Fri, 14 Jul 2023 09:42:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 263423858C53 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LQqf7ambjbEeAcrNTHp42Uac3mlu7IOVVr4UgkzvwcI0ReLJfEk5tm9k7/TA98gLmzGJHo0DcEJWfENs5ZpIu2wxTjjBuUVK7LaXHA+19hanRxmx06Ftjh0L1urACBDeLup8Pk3TrZkJm/igCveh6KZ+U6lKy1xHSpohVKhKUY02ZfCBB1I6V5TEknRewNEFjtAKNx891DIE8ituSEhD9yz2jPxU6CTr7zAmk79OjgtBDxO93kJUdFJTNJBDXYFhpQCMy7xezxoDG7LTS/HeCvYcAkZLbTaPRJb1BOtEHa6yVX38QEfMY/Rs7wU94JGcM8z71b7hl1q6gIMdJoGgxg== 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=coD9S7+wt0k4FDwT6DtnEIJg0FcURtWPZ0H+pcMySKI=; b=S9gEcVb35AK+3NB5ydDOTv5FcnE4Z7GlTxaRlj2B6OxacHY+tWRlgb3OI6KUZyBVaprXH92VhNSiwh5tYFPVHDb5ddXSdEzXz+q4YwfYhsXnOFv1xP04WZoaYLWmUxoJ1MbTP6d7AwypBjmX4/99NMqYulGi0/eUeuVzhSe1+ozf4P0fVZpcVcalNUAzDFQawakgHJu+OwnpO+J38On1xqXmDRGwCjc1XXIvNiiUHH9Zsy/X++bPi0jk54GQ+ndk8Yhn8JoDsUWa2z6tAsZCwr1zJtUYjSpFsd2/CsTOl/R5lOT6g6iKRuqY9nBFeQducw/XUr6uggAd+TDuY/S6ug== 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 AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21) by AM9PR04MB8810.eurprd04.prod.outlook.com (2603:10a6:20b:409::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.17; Fri, 14 Jul 2023 09:42:13 +0000 Received: from AS8PR04MB8788.eurprd04.prod.outlook.com ([fe80::cbc0:69aa:c9a2:198e]) by AS8PR04MB8788.eurprd04.prod.outlook.com ([fe80::cbc0:69aa:c9a2:198e%7]) with mapi id 15.20.6565.016; Fri, 14 Jul 2023 09:42:13 +0000 Message-ID: Date: Fri, 14 Jul 2023 11:42:11 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Content-Language: en-US To: "gcc-patches@gcc.gnu.org" Cc: Hongtao Liu , Kirill Yukhin Subject: [PATCH] x86: avoid maybe_gen_...() X-ClientProxiedBy: FR0P281CA0246.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:af::11) To AS8PR04MB8788.eurprd04.prod.outlook.com (2603:10a6:20b:42f::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8788:EE_|AM9PR04MB8810:EE_ X-MS-Office365-Filtering-Correlation-Id: 1a9fbb26-a251-4eb3-2e16-08db844e9a42 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2ptS64EXSysKFs8igDFAZsrH1rdbHTIgXLY8HXyzzmruXBDi5q9br7qa7TBPsfu2u85SPXYm7ucLNQb3h4oG+aetaVoddGGYVPxRRiU/HJWqOI7xFo/u4qCcSMj+WL681jgvsNcm+4/lS95p3jSyUABMzVR238j0rvBn19zoWq2VPY8uHYksySXYf7WnNHnqhz5gZLlEJQYntMSrCGUswC/s2o54Ov6IyQp3LTdSKdPaqRbZe62kOD/bqpvezM/9a/HhcO7SBIRlwRuOLVUQneN3tLhzbr4bZzi8Iy3ZuuUANB/c2uoT8u501Y1bVSy2+4dtdGrMjd3s8HoejYajlEcKR5BQ7Fhb609/AXQ/Vkkuzx3gB5UJKGZq/iBzhS1OXQ3r83Az4VIAjUGaOTOwag15gRFM3YjQtag4Oy/JsF+GUzKYL71HGYWrApfuqCbwWk2PiD6rM1msfAwqETB71VqGtwWsAVwbVjgkywM3CkduR46WiSpZTfDezoM+PDj768tCaN9gwESg7SoiKiwzZfDQDMyg5/3t3hjqMThWV6SFU1CDJoPPPvja9/tVoak+Nbm9Un3lE/YATsDLWSKClr3PhjbRFRMgCTD0xJVu2Qq8wDGpyJ1pzsYdWx9nOsOp/LsyGjBeGxTFHBm/GbHXzg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR04MB8788.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(39860400002)(136003)(396003)(366004)(376002)(346002)(451199021)(6916009)(2616005)(6506007)(54906003)(66476007)(38100700002)(66946007)(4326008)(66556008)(478600001)(6512007)(86362001)(36756003)(6486002)(186003)(26005)(31696002)(8676002)(8936002)(5660300002)(31686004)(316002)(2906002)(41300700001)(83380400001)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?VhCuiRnxqH0BjRmylpBm7cXUr6fH?= =?utf-8?q?k2seevpzwfjZ4pVMbQrhL/0/DKuwXbZpdGVtt4FEvxp7bycRQYWN/jPbmt5e0EKvG?= =?utf-8?q?IHu5Marsr5HWVJiv2S4GkrUoPkvCBO0ZDcHaaMLGfjR8FwjVmkatowLc4sCADlQfV?= =?utf-8?q?ai1BU5YGWdq+lEBvuHDwmhK86OZdGbyVYjaj1H+hoXxRnHQg57XqL/KB2wcNVQOAU?= =?utf-8?q?Yoamj11Z49zOwQx282BvNDd1Xy2d2udIffIWSpnCH7QchjjAs40m/iGVow/WM/8n4?= =?utf-8?q?+u/UIQOU6IQ4VJ5ppc7snbwLME1TTJ8uNPDtU/UcGCm6j3cwTy2E6F1TCEZ8gLABM?= =?utf-8?q?o9P1PYVyLW41+tAJL7EiFOYTaK0Jxb76/Ycgy91UrhfzV9QQh43yH9t79uwtWPpfm?= =?utf-8?q?HxFEf8oJXkJfs6d7qr5+Lg4Y2uhVF+puH8ObKplGxLafItuy0PwOhAUw+3GyJDgYE?= =?utf-8?q?4ZXRSK95gnMbczV8XVsZ/THqGoHcUXrz7mbzxhJo0AnfGwvJfvtohD1QXJbm3jo9S?= =?utf-8?q?avkfdDuelXgzocSX2Eggbk7lkVgs7acmTmq4Ut4p9Z3rVMqwVHnIoOcz8QmEiYw2x?= =?utf-8?q?YlQwWTdMC2ld/UcUHlsSApK1DPVF0sNtCj/JVzMI94F6Rg/2yyVE/y+SyXV230T1Y?= =?utf-8?q?mvEeXY1+fnEGcgxz1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orOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1a9fbb26-a251-4eb3-2e16-08db844e9a42 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8788.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2023 09:42:13.4025 (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: tvP3AHiFkgiMjBnDGvlr4yO9EfzMNFR3nqHo4tQFV55x/oAuv9QO8ilGG8Pl6kVMvyHi9z7JYOA6Xor6i3L3AQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8810 X-Spam-Status: No, score=-3027.2 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: 1771388570729136074 X-GMAIL-MSGID: 1771388570729136074 In the (however unlikely) event that no insn can be found for the requested mode, using maybe_gen_...() without (really) checking its result for being a null rtx would lead to silent bad code generation. gcc/ * config/i386/i386-expand.cc (ix86_expand_vector_init_duplicate): Use gen_vec_set_0. (ix86_expand_vector_extract): Use gen_vec_extract_lo / gen_vec_extract_hi. (expand_vec_perm_broadcast_1): Use gen_vec_interleave_high / gen_vec_interleave_low. Rename local variable. --- a/gcc/config/i386/i386-expand.cc +++ b/gcc/config/i386/i386-expand.cc @@ -15456,8 +15456,7 @@ ix86_expand_vector_init_duplicate (bool { tmp1 = force_reg (GET_MODE_INNER (mode), val); tmp2 = gen_reg_rtx (mode); - emit_insn (maybe_gen_vec_set_0 (mode, tmp2, - CONST0_RTX (mode), tmp1)); + emit_insn (gen_vec_set_0 (mode, tmp2, CONST0_RTX (mode), tmp1)); tmp1 = gen_lowpart (mode, tmp2); } else @@ -17419,9 +17418,9 @@ ix86_expand_vector_extract (bool mmx_ok, ? gen_reg_rtx (V16HFmode) : gen_reg_rtx (V16BFmode)); if (elt < 16) - emit_insn (maybe_gen_vec_extract_lo (mode, tmp, vec)); + emit_insn (gen_vec_extract_lo (mode, tmp, vec)); else - emit_insn (maybe_gen_vec_extract_hi (mode, tmp, vec)); + emit_insn (gen_vec_extract_hi (mode, tmp, vec)); ix86_expand_vector_extract (false, target, tmp, elt & 15); return; } @@ -17435,9 +17434,9 @@ ix86_expand_vector_extract (bool mmx_ok, ? gen_reg_rtx (V8HFmode) : gen_reg_rtx (V8BFmode)); if (elt < 8) - emit_insn (maybe_gen_vec_extract_lo (mode, tmp, vec)); + emit_insn (gen_vec_extract_lo (mode, tmp, vec)); else - emit_insn (maybe_gen_vec_extract_hi (mode, tmp, vec)); + emit_insn (gen_vec_extract_hi (mode, tmp, vec)); ix86_expand_vector_extract (false, target, tmp, elt & 7); return; } @@ -22501,18 +22500,18 @@ expand_vec_perm_broadcast_1 (struct expa if (d->testing_p) return true; - rtx (*maybe_gen) (machine_mode, int, rtx, rtx, rtx); + rtx (*gen_interleave) (machine_mode, int, rtx, rtx, rtx); if (elt >= nelt2) { - maybe_gen = maybe_gen_vec_interleave_high; + gen_interleave = gen_vec_interleave_high; elt -= nelt2; } else - maybe_gen = maybe_gen_vec_interleave_low; + gen_interleave = gen_vec_interleave_low; nelt2 /= 2; dest = gen_reg_rtx (vmode); - emit_insn (maybe_gen (vmode, 1, dest, op0, op0)); + emit_insn (gen_interleave (vmode, 1, dest, op0, op0)); vmode = V4SImode; op0 = gen_lowpart (vmode, dest);