From patchwork Fri Mar 1 06:27:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "demin.han" X-Patchwork-Id: 208667 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2097:b0:108:e6aa:91d0 with SMTP id gs23csp893517dyb; Thu, 29 Feb 2024 22:31:17 -0800 (PST) X-Forwarded-Encrypted: i=4; AJvYcCU+mwBw7HNM+1vtOSqLXsaH55qpOZ4/v+WhqxkhhsybDFscKti4x8AoxCL/kT8vjy/rmNn5JflIwVUtl4PNEiZ/0kaPKQ== X-Google-Smtp-Source: AGHT+IHu2FZgMgZoSiFICBzF0+dcxaB2lTle1Vj7GkoJF2WK96d2e61tWKdPlYN6YjYq9LSMYjVO X-Received: by 2002:a05:622a:1743:b0:42e:c136:1c79 with SMTP id l3-20020a05622a174300b0042ec1361c79mr1074695qtk.27.1709274677432; Thu, 29 Feb 2024 22:31:17 -0800 (PST) ARC-Seal: i=3; a=rsa-sha256; t=1709274677; cv=pass; d=google.com; s=arc-20160816; b=kMvBic46QsuG4nqCcTyymk722g8dfnSRjdJt9c0u6BlKmrUGSikHSS1VLwI2N8G6t3 4CbVP8Uf5KiSJKJw1EwIgtRvbE5BzBDt+aY2Wlup4/KYTufQHMcEZTiP3sq9oF3c1A3m 8MzbV5kH29ijfK/k4n6iOXM+oQ/gAJNo/8HDvVBQW7o5wrNYPBd8MBeZsYEuvoXJpdsg 7XY6amMoUn6srx6nQBjM1BnJvNqUDcwI3s2mgtOMu9MmxirqGzWGooflQ8k6g82I6KLn SsV8KO2KNUUxRIoENl64omKT0Lh/KIFNE5dCUhuMGm4Wb+yDJez+AomSNeo/FHYOxwL1 sgdA== ARC-Message-Signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version :content-transfer-encoding:references:in-reply-to:message-id:date :subject:cc:to:from:arc-filter:dmarc-filter:delivered-to; bh=hQKBptBU6q+q5mYulUrIBZkGcHB8giwXf8ZrNNfC8sA=; fh=AkWPpvwPhOnqU3cJUjz+pCLfr011jkgzwHdP+JYf2bQ=; b=n4O5IseqNgyp4CE0NsmT3/lki/NJqjAP31AtgVv6GxkmWy60TB9amvkSKtfI5HfTcp TG1TVUJTC1MCxeBEjr3RQdZJztVQKVu7JiNIYg7x/Y8YKOyE4zWB78kXQQZWkaFrOPfd hglz9QFEeIUkgO8oU5TE6ro4S9FVi4zAditGSOmf1FxMx5qqbgEg3jj3I2d6QuVfDlr7 Lhb2RUoJ0dZneqO9kToKuaPUfLfxJHZotREbHIsiwV9zl6W8oT42dITU0XpQUqGrA7Wk n6upM4WBjiaPC7JUsmyIRNdYNdrK2bB/ywWUlBa9QidyZBZDD74zTFZ/uVbPIRHJ54lq fcpg==; dara=google.com ARC-Authentication-Results: i=3; mx.google.com; arc=pass (i=2); 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" Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id w1-20020a05622a134100b0042ec43966a6si1789260qtk.264.2024.02.29.22.31.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 22:31:17 -0800 (PST) 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; arc=pass (i=2); 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" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EEA183858409 for ; Fri, 1 Mar 2024 06:31:16 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from CHN02-SH0-obe.outbound.protection.partner.outlook.cn (mail-sh0chn02on2102.outbound.protection.partner.outlook.cn [139.219.146.102]) by sourceware.org (Postfix) with ESMTPS id 30E033858402 for ; Fri, 1 Mar 2024 06:28:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 30E033858402 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=starfivetech.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=starfivetech.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 30E033858402 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=139.219.146.102 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1709274494; cv=pass; b=TQ2kPHgmm4voVG5WXeNXT2+lvdSZcp2HITO62DB/TFsLcFqU+R3Y7y5z23E2NBmeCeDDHSMg5oPDH5Icm9+LvRvzVy+3NxnVgocoOmh9lB5BBAXbgRKK37NnOGQFgeC8wxNX/VZWFn/rjK9Se+A+HlqPGK3Clj4v6TZUbwnPCVk= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1709274494; c=relaxed/simple; bh=HMYzqyH8mldUhSmhqFUQVCfNJvEXhewk4Y6H153ddRU=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=UkVnN3cCtwxRsBaaulZPBlRXT/AKOR7oS4mnbOzckVFHtdcVHIsbWS18Y/2zy87dF7BMnyt7XqFwCs7ZT+2zoHSBEOvnquKEzKKrKu0lns8T4e4iTQA64a1YZ9vNdW8AFrFmd2x448Jr9GZ1U5Wi4WLzXWCG8Za+Q6ZTu5FvF5I= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=md6jw7hTchEQKdfyr2yVEM1y6e+b731HBlGkw8z02PYRno3/Q3NMFBH7PGjTosmaK7wXA9po9Sct/bPtlP80rDZRpZQ5YxH7ZX+ukImum3S3DIXOyiBWmXEANu4GxSQkeUxLeEWwSdswCmcJZPmCDXzIekRCD4mNgr/llOBGhqOAmgfnzNva5FK8gXypSEYhUkWlTxyvQvVrNuNxtrDJGiZMvaZ+ODnpW1R/OlHjaeEz6jP8+1ggUvmvDwzc8X9lqGtIISnNmwB2CFYieQnZk+9//mdvFAkHO7xSpjxm1W6KkQ9A0154jkVinrtByVG3rjw3OD5Izhl5JQw5nxTWZg== 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=hQKBptBU6q+q5mYulUrIBZkGcHB8giwXf8ZrNNfC8sA=; b=cJuJ6dJFfnAP/6E4Xp1uES0Io3c8OZ9o4quJIDNEpnED9yN+qD7FonMPvJxbPmWfxnc0ppyH6gARszOarmJ9WGNr9SAKckrtxdi4XQ5bYFln0pyvCMDixNlwKvSqQaIoIlMaAJrvWWfQK8/3rVBTkEO7Br4eVdJMZhUEdIsfvjAhaBRPhbrmyNNH7w8pUlHjiOPO6C4vX5osHHG6vqocmeDWx0syQ2vrUzWOo0h1CFX1Qs1tinAFxAJZ72uMe+5KbOUH4ZA182aokO394Lg3M2Z6Aehec3a4RsKRAnh89s3vQhtew9KhNfhDoDUGcR/7v+vkIaAUOrs0PQZfl4n+Hw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=starfivetech.com; dmarc=pass action=none header.from=starfivetech.com; dkim=pass header.d=starfivetech.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=starfivetech.com; Received: from ZQ0PR01MB1063.CHNPR01.prod.partner.outlook.cn (2406:e500:c550:d::13) by ZQ0PR01MB1080.CHNPR01.prod.partner.outlook.cn (2406:e500:c550:d::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.47; Fri, 1 Mar 2024 06:27:51 +0000 Received: from ZQ0PR01MB1063.CHNPR01.prod.partner.outlook.cn ([fe80::21d1:48e1:7ca0:1d76]) by ZQ0PR01MB1063.CHNPR01.prod.partner.outlook.cn ([fe80::21d1:48e1:7ca0:1d76%4]) with mapi id 15.20.7270.047; Fri, 1 Mar 2024 06:27:51 +0000 From: "demin.han" To: gcc-patches@gcc.gnu.org Cc: juzhe.zhong@rivai.ai, kito.cheng@gmail.com, pan2.li@intel.com, jeffreyalaw@gmail.com Subject: [PATCH 4/5] RISC-V: Remove integer vector eqne pattern Date: Fri, 1 Mar 2024 14:27:10 +0800 Message-ID: <20240301062711.207137-5-demin.han@starfivetech.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240301062711.207137-1-demin.han@starfivetech.com> References: <20240301062711.207137-1-demin.han@starfivetech.com> X-ClientProxiedBy: BJSPR01CA0023.CHNPR01.prod.partner.outlook.cn (2406:e500:c211:c::35) To ZQ0PR01MB1063.CHNPR01.prod.partner.outlook.cn (2406:e500:c550:d::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: ZQ0PR01MB1063:EE_|ZQ0PR01MB1080:EE_ X-MS-Office365-Filtering-Correlation-Id: fc18a36c-5375-48c9-c6da-08dc39b8b893 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dPSQuXrm2cqgkQJVTR7S5cbCapCzvMPbNwtejQrg/5kUcA+ErLVahB92JaOAu5VeAehXAkixfrfWdl0z+IWADiBCQ4LheIvnUew8ouU9dYPvUl2GjUPeO7awsE8qbqdjaJCQ1d61/W8AW9lSN1Z+BBTrUM4sxjd9YEFDlv6gb0Wo82RF/CWlCBhWbegirvf5AukAXVp4/25jTB7MNtfisNTQ1KMN5+CNyVQZy/DINlCAR6MMCUUl9jQqofK61IJoCkT1RGKEmFBu9QlHSiRi7QUoy+UQFYcclHdNjXZvZx4YjTqAaHHShJ/uo2SPx/gpzhUzGmWGPA7mzQo8HGDAs1iuk9PVnYgov6IcLMmgnIIKQzoYI1NbYMgwToZwxDViemJPHcB3nlgxEBkNJg3MWdnXQgiDBLz53y6Wp5kOMLinpf8+GjdL9mIZHHk7Yt/hZTFoce8y4zbUPlMaLTn54q3svoEFxmD3SCEBDnnFFUh/3VTmO49dlnAb1PmgEUjK7Py/l2VSlnZmNLYY784v/B6vKdZBzGhDL/8/TVp4RpH/h3Q2qxh2SSwZlAVNUCkFRV3pRm0+GUs4Izu9yDkVJ9nxkaHTCI0DCpANW8jpNJGbJP8O4XZUALhHCWufspob X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:ZQ0PR01MB1063.CHNPR01.prod.partner.outlook.cn; PTR:; CAT:NONE; SFS:(13230031)(41320700004)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: BJGonB5IG3dl7ChgwQs8z5+Shr69QfKk1NpkzlAJDxgGTGY9T3oKXhCgCR26AX/j2ZTFc/bNUc+tpr/WM+ou+j3fVbBVvM9oVokLGVeVmQvnyTpY8AWKbjKEUr8a1aS1B0vASOmGtUKI0t1HvihGsJ5F+fED6KB06CH1sA5RTY7C5lakO7xS2bpoQj2MpHLXbRmFrhAsYGyBoCB7jrusazFM3XoGxhopFbmHrldtoMExle/DPEBJHN+UFdWyWWzLUbs71VD5to8a3fRXqmvdiPtQKctnmRvYb210PM8iLNQHezoXrLrSThFWvcsIx7mfPi0y77p9L21/wUbG4fx5Ae3zj3E2ERwS36eQVCL6+mkPEWBfmlurUGvlwmNNlM6lBhe6c4BXR5cFaKDLetOTYhyO/U2MWPiOVu9YJaU+SFi4Vfh3+9/tbUpAIaAp0hSz+Lkt0epiMCKo9XuVAxgldkuuvDUFkDJO4Tsx6z7WybAd9EuWXCu9OfldUwHi9pHqtbtGCSuCTJzvHKr8wWYDUKHgbFPdmBNSFquuf20TEuQp/lryIGn29kf3c7UuSai3tXjnEP5KAs/GziKgOEMBUVESU6p3hGQhBV1bGq4mN1485JzFV83jcGxl2gEbtUZ/42buYg8QlszXn0vA6N3jWhQWLhBJBDjKZMjQ17L9N9d7IvA1JfVDkiZmpQoVd08wgDoBXx7+bbitdVAVP5adYKwQPUs1RzorTyuxCx/FbN1qIHCJwThvFWdxuiXrWTTg3FwTJYy57O5fcBVVutk7qCQpiF06P/8+EBmmCpO+mHL8aRnueqJofwbFNjV7cFSGTQrJRcVNRRu0aOcwEQ0Tgo13cr+6SkyCbaVgtXMldEaHF4m8GSXDB6DLV57Vop/7Nd1LNUSoVQp1UHmwdTpAtZzyW3j+cQSS3bo0xpoJHzghnc/T9W8YqIbvFDL8bHsY1xXv8toKIuvdZZMZcaRzx2jEv7r3AiwYCXxY6hBWsxulNc3vVJiExXembcqKGm5CHniI/sKFLpIs+NyP+UOgnuaPaWoitCSdA9rHk8gCUXBXSrYpaT7QGsTznGSdo+FfHZ+c3Wpm69rkScWAdOaLzrTS1gsqXs5UB/9kO8evv3QVdrs/7/PZyjM+t+XcliDzWWCxr/GFv4Qqa3gF5GhpWj8iSF+ac/V7Tq31qAlUhdkjWr13AHIfJf4DKGTYyuLJUhpcNi/gZA/pGKYCbxpmUlIpUeMUpneb9aDU6xLvU0P4YU7Bk2UDCen2h896etVni57j3yg79ULw7+U+pBl6w0z2/1JgcIKS5+2JjvWvegzOpUXTRqKPX1CSP+BKeEIm66SXQKdBqnBIyh+kf8TozviHxsSp86avcLvAyU8UvuqbRmR/eKP9A+EHC8Tq7Av+kv8deY1AIRp9Qo5lb7o+hbNOtfiSLStn9zGPHm2JPHoc9lsT7Tggrv4Q9e5icPAEoq52EpOnrb2nMC7Rn9N3TgKTYjevLhP12roD+Kp3qMjxYT0Ki1uDbN7/ibbOyqn99YdvwW55fTuhWFhYOu5WmvViJ131Wv/J7DvqzHOV3cM/wVJCrkLVF7diQsgdZXKB3HZVnxrrzmHIGEkGTvJJTw== X-OriginatorOrg: starfivetech.com X-MS-Exchange-CrossTenant-Network-Message-Id: fc18a36c-5375-48c9-c6da-08dc39b8b893 X-MS-Exchange-CrossTenant-AuthSource: ZQ0PR01MB1063.CHNPR01.prod.partner.outlook.cn X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Mar 2024 06:27:51.4636 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 06fe3fa3-1221-43d3-861b-5a4ee687a85c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: U5BcmMfvYmSm5OGUvwz+0QgiKMrZLunOKFQs2pvIwhm6sa98iwla1GVHbYbw43E4BGzHMdNlFFjNovIsLZnk/zzPdVkEkJsHmwC+Me4ZlyA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: ZQ0PR01MB1080 X-Spam-Status: No, score=-13.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792304404195535201 X-GMAIL-MSGID: 1792304404195535201 We can unify eqne and other comparison operations. Tested on RV32 and RV64. gcc/ChangeLog: * config/riscv/predicates.md (comparison_except_eqge_operator): Only exclue ge (comparison_except_ge_operator): Ditto * config/riscv/riscv-string.cc (expand_rawmemchr): Use cmp pattern (expand_strcmp): Ditto * config/riscv/riscv-vector-builtins-bases.cc: Remvoe eqne cond * config/riscv/vector.md (@pred_eqne_scalar): Remove eqne patterns (*pred_eqne_scalar_merge_tie_mask): Ditto (*pred_eqne_scalar): Ditto (*pred_eqne_scalar_narrow): Ditto (*pred_eqne_extended_scalar_merge_tie_mask): Ditto (*pred_eqne_extended_scalar): Ditto (*pred_eqne_extended_scalar_narrow): Ditto Signed-off-by: demin.han Signed-off-by: demin.han _scalar" (match_operand 8 "const_int_operand") (reg:SI VL_REGNUM) (reg:SI VTYPE_REGNUM)] UNSPEC_VPREDICATE) - (match_operator: 3 "comparison_except_eqge_operator" + (match_operator: 3 "comparison_except_ge_operator" [(match_operand:V_VLSI_QHS 4 "register_operand") (vec_duplicate:V_VLSI_QHS (match_operand: 5 "register_operand"))]) @@ -4689,7 +4689,7 @@ (define_insn "*pred_cmp_scalar_merge_tie_mask" (match_operand 7 "const_int_operand" " i") (reg:SI VL_REGNUM) (reg:SI VTYPE_REGNUM)] UNSPEC_VPREDICATE) - (match_operator: 2 "comparison_except_eqge_operator" + (match_operator: 2 "comparison_except_ge_operator" [(match_operand:V_VLSI_QHS 3 "register_operand" " vr") (vec_duplicate:V_VLSI_QHS (match_operand: 4 "register_operand" " r"))]) @@ -4714,7 +4714,7 @@ (define_insn "*pred_cmp_scalar" (match_operand 8 "const_int_operand" " i, i, i, i") (reg:SI VL_REGNUM) (reg:SI VTYPE_REGNUM)] UNSPEC_VPREDICATE) - (match_operator: 3 "comparison_except_eqge_operator" + (match_operator: 3 "comparison_except_ge_operator" [(match_operand:V_VLSI_QHS 4 "register_operand" " vr, vr, vr, vr") (vec_duplicate:V_VLSI_QHS (match_operand: 5 "register_operand" " r, r, r, r"))]) @@ -4736,7 +4736,7 @@ (define_insn "*pred_cmp_scalar_narrow" (match_operand 8 "const_int_operand" " i, i, i, i, i") (reg:SI VL_REGNUM) (reg:SI VTYPE_REGNUM)] UNSPEC_VPREDICATE) - (match_operator: 3 "comparison_except_eqge_operator" + (match_operator: 3 "comparison_except_ge_operator" [(match_operand:V_VLSI_QHS 4 "register_operand" " vr, 0, 0, vr, vr") (vec_duplicate:V_VLSI_QHS (match_operand: 5 "register_operand" " r, r, r, r, r"))]) @@ -4747,92 +4747,6 @@ (define_insn "*pred_cmp_scalar_narrow" (set_attr "mode" "") (set_attr "spec_restriction" "none,thv,thv,none,none")]) -(define_expand "@pred_eqne_scalar" - [(set (match_operand: 0 "register_operand") - (if_then_else: - (unspec: - [(match_operand: 1 "vector_mask_operand") - (match_operand 6 "vector_length_operand") - (match_operand 7 "const_int_operand") - (match_operand 8 "const_int_operand") - (reg:SI VL_REGNUM) - (reg:SI VTYPE_REGNUM)] UNSPEC_VPREDICATE) - (match_operator: 3 "equality_operator" - [(vec_duplicate:V_VLSI_QHS - (match_operand: 5 "register_operand")) - (match_operand:V_VLSI_QHS 4 "register_operand")]) - (match_operand: 2 "vector_merge_operand")))] - "TARGET_VECTOR" - {}) - -(define_insn "*pred_eqne_scalar_merge_tie_mask" - [(set (match_operand: 0 "register_operand" "=vm") - (if_then_else: - (unspec: - [(match_operand: 1 "register_operand" " 0") - (match_operand 5 "vector_length_operand" " rK") - (match_operand 6 "const_int_operand" " i") - (match_operand 7 "const_int_operand" " i") - (reg:SI VL_REGNUM) - (reg:SI VTYPE_REGNUM)] UNSPEC_VPREDICATE) - (match_operator: 2 "equality_operator" - [(vec_duplicate:V_VLSI_QHS - (match_operand: 4 "register_operand" " r")) - (match_operand:V_VLSI_QHS 3 "register_operand" " vr")]) - (match_dup 1)))] - "TARGET_VECTOR" - "vms%B2.vx\t%0,%3,%4,v0.t" - [(set_attr "type" "vicmp") - (set_attr "mode" "") - (set_attr "merge_op_idx" "1") - (set_attr "vl_op_idx" "5") - (set (attr "ma") (symbol_ref "riscv_vector::get_ma(operands[6])")) - (set (attr "avl_type_idx") (const_int 7))]) - -;; We don't use early-clobber for LMUL <= 1 to get better codegen. -(define_insn "*pred_eqne_scalar" - [(set (match_operand: 0 "register_operand" "=vr, vr, &vr, &vr") - (if_then_else: - (unspec: - [(match_operand: 1 "vector_mask_operand" "vmWc1,vmWc1,vmWc1,vmWc1") - (match_operand 6 "vector_length_operand" " rK, rK, rK, rK") - (match_operand 7 "const_int_operand" " i, i, i, i") - (match_operand 8 "const_int_operand" " i, i, i, i") - (reg:SI VL_REGNUM) - (reg:SI VTYPE_REGNUM)] UNSPEC_VPREDICATE) - (match_operator: 3 "equality_operator" - [(vec_duplicate:V_VLSI_QHS - (match_operand: 5 "register_operand" " r, r, r, r")) - (match_operand:V_VLSI_QHS 4 "register_operand" " vr, vr, vr, vr")]) - (match_operand: 2 "vector_merge_operand" " vu, 0, vu, 0")))] - "TARGET_VECTOR && riscv_vector::cmp_lmul_le_one (mode)" - "vms%B3.vx\t%0,%4,%5%p1" - [(set_attr "type" "vicmp") - (set_attr "mode" "") - (set_attr "spec_restriction" "thv,thv,rvv,rvv")]) - -;; We use early-clobber for source LMUL > dest LMUL. -(define_insn "*pred_eqne_scalar_narrow" - [(set (match_operand: 0 "register_operand" "=vm, vr, vr, &vr, &vr") - (if_then_else: - (unspec: - [(match_operand: 1 "vector_mask_operand" " 0,vmWc1,vmWc1,vmWc1,vmWc1") - (match_operand 6 "vector_length_operand" " rK, rK, rK, rK, rK") - (match_operand 7 "const_int_operand" " i, i, i, i, i") - (match_operand 8 "const_int_operand" " i, i, i, i, i") - (reg:SI VL_REGNUM) - (reg:SI VTYPE_REGNUM)] UNSPEC_VPREDICATE) - (match_operator: 3 "equality_operator" - [(vec_duplicate:V_VLSI_QHS - (match_operand: 5 "register_operand" " r, r, r, r, r")) - (match_operand:V_VLSI_QHS 4 "register_operand" " vr, 0, 0, vr, vr")]) - (match_operand: 2 "vector_merge_operand" " vu, vu, 0, vu, 0")))] - "TARGET_VECTOR && riscv_vector::cmp_lmul_gt_one (mode)" - "vms%B3.vx\t%0,%4,%5%p1" - [(set_attr "type" "vicmp") - (set_attr "mode" "") - (set_attr "spec_restriction" "none,thv,thv,none,none")]) - ;; Handle GET_MODE_INNER (mode) = DImode. We need to split them since ;; we need to deal with SEW = 64 in RV32 system. (define_expand "@pred_cmp_scalar" @@ -4845,7 +4759,7 @@ (define_expand "@pred_cmp_scalar" (match_operand 8 "const_int_operand") (reg:SI VL_REGNUM) (reg:SI VTYPE_REGNUM)] UNSPEC_VPREDICATE) - (match_operator: 3 "comparison_except_eqge_operator" + (match_operator: 3 "comparison_except_ge_operator" [(match_operand:V_VLSI_D 4 "register_operand") (vec_duplicate:V_VLSI_D (match_operand: 5 "reg_or_int_operand"))]) @@ -4875,39 +4789,6 @@ (define_expand "@pred_cmp_scalar" DONE; }) -(define_expand "@pred_eqne_scalar" - [(set (match_operand: 0 "register_operand") - (if_then_else: - (unspec: - [(match_operand: 1 "vector_mask_operand") - (match_operand 6 "vector_length_operand") - (match_operand 7 "const_int_operand") - (match_operand 8 "const_int_operand") - (reg:SI VL_REGNUM) - (reg:SI VTYPE_REGNUM)] UNSPEC_VPREDICATE) - (match_operator: 3 "equality_operator" - [(vec_duplicate:V_VLSI_D - (match_operand: 5 "reg_or_int_operand")) - (match_operand:V_VLSI_D 4 "register_operand")]) - (match_operand: 2 "vector_merge_operand")))] - "TARGET_VECTOR" -{ - enum rtx_code code = GET_CODE (operands[3]); - if (riscv_vector::sew64_scalar_helper ( - operands, - /* scalar op */&operands[5], - /* vl */operands[6], - mode, - riscv_vector::has_vi_variant_p (code, operands[5]), - [] (rtx *operands, rtx boardcast_scalar) { - emit_insn (gen_pred_cmp (operands[0], operands[1], - operands[2], operands[3], operands[4], boardcast_scalar, - operands[6], operands[7], operands[8])); - }, - (riscv_vector::avl_type) INTVAL (operands[8]))) - DONE; -}) - (define_insn "*pred_cmp_scalar_merge_tie_mask" [(set (match_operand: 0 "register_operand" "=vm") (if_then_else: @@ -4918,7 +4799,7 @@ (define_insn "*pred_cmp_scalar_merge_tie_mask" (match_operand 7 "const_int_operand" " i") (reg:SI VL_REGNUM) (reg:SI VTYPE_REGNUM)] UNSPEC_VPREDICATE) - (match_operator: 2 "comparison_except_eqge_operator" + (match_operator: 2 "comparison_except_ge_operator" [(match_operand:V_VLSI_D 3 "register_operand" " vr") (vec_duplicate:V_VLSI_D (match_operand: 4 "register_operand" " r"))]) @@ -4932,30 +4813,6 @@ (define_insn "*pred_cmp_scalar_merge_tie_mask" (set (attr "ma") (symbol_ref "riscv_vector::get_ma(operands[6])")) (set (attr "avl_type_idx") (const_int 7))]) -(define_insn "*pred_eqne_scalar_merge_tie_mask" - [(set (match_operand: 0 "register_operand" "=vm") - (if_then_else: - (unspec: - [(match_operand: 1 "register_operand" " 0") - (match_operand 5 "vector_length_operand" " rK") - (match_operand 6 "const_int_operand" " i") - (match_operand 7 "const_int_operand" " i") - (reg:SI VL_REGNUM) - (reg:SI VTYPE_REGNUM)] UNSPEC_VPREDICATE) - (match_operator: 2 "equality_operator" - [(vec_duplicate:V_VLSI_D - (match_operand: 4 "register_operand" " r")) - (match_operand:V_VLSI_D 3 "register_operand" " vr")]) - (match_dup 1)))] - "TARGET_VECTOR" - "vms%B2.vx\t%0,%3,%4,v0.t" - [(set_attr "type" "vicmp") - (set_attr "mode" "") - (set_attr "merge_op_idx" "1") - (set_attr "vl_op_idx" "5") - (set (attr "ma") (symbol_ref "riscv_vector::get_ma(operands[6])")) - (set (attr "avl_type_idx") (const_int 7))]) - ;; We don't use early-clobber for LMUL <= 1 to get better codegen. (define_insn "*pred_cmp_scalar" [(set (match_operand: 0 "register_operand" "=vr, vr, &vr, &vr") @@ -4967,7 +4824,7 @@ (define_insn "*pred_cmp_scalar" (match_operand 8 "const_int_operand" " i, i, i, i") (reg:SI VL_REGNUM) (reg:SI VTYPE_REGNUM)] UNSPEC_VPREDICATE) - (match_operator: 3 "comparison_except_eqge_operator" + (match_operator: 3 "comparison_except_ge_operator" [(match_operand:V_VLSI_D 4 "register_operand" " vr, vr, vr, vr") (vec_duplicate:V_VLSI_D (match_operand: 5 "register_operand" " r, r, r, r"))]) @@ -4989,7 +4846,7 @@ (define_insn "*pred_cmp_scalar_narrow" (match_operand 8 "const_int_operand" " i, i, i, i, i") (reg:SI VL_REGNUM) (reg:SI VTYPE_REGNUM)] UNSPEC_VPREDICATE) - (match_operator: 3 "comparison_except_eqge_operator" + (match_operator: 3 "comparison_except_ge_operator" [(match_operand:V_VLSI_D 4 "register_operand" " vr, 0, 0, vr, vr") (vec_duplicate:V_VLSI_D (match_operand: 5 "register_operand" " r, r, r, r, r"))]) @@ -5000,50 +4857,6 @@ (define_insn "*pred_cmp_scalar_narrow" (set_attr "mode" "") (set_attr "spec_restriction" "none,thv,thv,none,none")]) -;; We don't use early-clobber for LMUL <= 1 to get better codegen. -(define_insn "*pred_eqne_scalar" - [(set (match_operand: 0 "register_operand" "=vr, vr, &vr, &vr") - (if_then_else: - (unspec: - [(match_operand: 1 "vector_mask_operand" "vmWc1,vmWc1,vmWc1,vmWc1") - (match_operand 6 "vector_length_operand" " rK, rK, rK, rK") - (match_operand 7 "const_int_operand" " i, i, i, i") - (match_operand 8 "const_int_operand" " i, i, i, i") - (reg:SI VL_REGNUM) - (reg:SI VTYPE_REGNUM)] UNSPEC_VPREDICATE) - (match_operator: 3 "equality_operator" - [(vec_duplicate:V_VLSI_D - (match_operand: 5 "register_operand" " r, r, r, r")) - (match_operand:V_VLSI_D 4 "register_operand" " vr, vr, vr, vr")]) - (match_operand: 2 "vector_merge_operand" " vu, 0, vu, 0")))] - "TARGET_VECTOR && riscv_vector::cmp_lmul_le_one (mode)" - "vms%B3.vx\t%0,%4,%5%p1" - [(set_attr "type" "vicmp") - (set_attr "mode" "") - (set_attr "spec_restriction" "thv,thv,rvv,rvv")]) - -;; We use early-clobber for source LMUL > dest LMUL. -(define_insn "*pred_eqne_scalar_narrow" - [(set (match_operand: 0 "register_operand" "=vm, vr, vr, &vr, &vr") - (if_then_else: - (unspec: - [(match_operand: 1 "vector_mask_operand" " 0,vmWc1,vmWc1,vmWc1,vmWc1") - (match_operand 6 "vector_length_operand" " rK, rK, rK, rK, rK") - (match_operand 7 "const_int_operand" " i, i, i, i, i") - (match_operand 8 "const_int_operand" " i, i, i, i, i") - (reg:SI VL_REGNUM) - (reg:SI VTYPE_REGNUM)] UNSPEC_VPREDICATE) - (match_operator: 3 "equality_operator" - [(vec_duplicate:V_VLSI_D - (match_operand: 5 "register_operand" " r, r, r, r, r")) - (match_operand:V_VLSI_D 4 "register_operand" " vr, 0, 0, vr, vr")]) - (match_operand: 2 "vector_merge_operand" " vu, vu, 0, vu, 0")))] - "TARGET_VECTOR && riscv_vector::cmp_lmul_gt_one (mode)" - "vms%B3.vx\t%0,%4,%5%p1" - [(set_attr "type" "vicmp") - (set_attr "mode" "") - (set_attr "spec_restriction" "none,thv,thv,none,none")]) - (define_insn "*pred_cmp_extended_scalar_merge_tie_mask" [(set (match_operand: 0 "register_operand" "=vm") (if_then_else: @@ -5054,7 +4867,7 @@ (define_insn "*pred_cmp_extended_scalar_merge_tie_mask" (match_operand 7 "const_int_operand" " i") (reg:SI VL_REGNUM) (reg:SI VTYPE_REGNUM)] UNSPEC_VPREDICATE) - (match_operator: 2 "comparison_except_eqge_operator" + (match_operator: 2 "comparison_except_ge_operator" [(match_operand:V_VLSI_D 3 "register_operand" " vr") (vec_duplicate:V_VLSI_D (sign_extend: @@ -5080,7 +4893,7 @@ (define_insn "*pred_cmp_extended_scalar" (match_operand 8 "const_int_operand" " i, i, i, i") (reg:SI VL_REGNUM) (reg:SI VTYPE_REGNUM)] UNSPEC_VPREDICATE) - (match_operator: 3 "comparison_except_eqge_operator" + (match_operator: 3 "comparison_except_ge_operator" [(match_operand:V_VLSI_D 4 "register_operand" " vr, vr, vr, vr") (vec_duplicate:V_VLSI_D (sign_extend: @@ -5102,7 +4915,7 @@ (define_insn "*pred_cmp_extended_scalar_narrow" (match_operand 8 "const_int_operand" " i, i, i, i, i") (reg:SI VL_REGNUM) (reg:SI VTYPE_REGNUM)] UNSPEC_VPREDICATE) - (match_operator: 3 "comparison_except_eqge_operator" + (match_operator: 3 "comparison_except_ge_operator" [(match_operand:V_VLSI_D 4 "register_operand" " vr, 0, 0, vr, vr") (vec_duplicate:V_VLSI_D (sign_extend: @@ -5114,76 +4927,6 @@ (define_insn "*pred_cmp_extended_scalar_narrow" (set_attr "mode" "") (set_attr "spec_restriction" "none,thv,thv,none,none")]) -(define_insn "*pred_eqne_extended_scalar_merge_tie_mask" - [(set (match_operand: 0 "register_operand" "=vm") - (if_then_else: - (unspec: - [(match_operand: 1 "register_operand" " 0") - (match_operand 5 "vector_length_operand" " rK") - (match_operand 6 "const_int_operand" " i") - (match_operand 7 "const_int_operand" " i") - (reg:SI VL_REGNUM) - (reg:SI VTYPE_REGNUM)] UNSPEC_VPREDICATE) - (match_operator: 2 "equality_operator" - [(vec_duplicate:V_VLSI_D - (sign_extend: - (match_operand: 4 "register_operand" " r"))) - (match_operand:V_VLSI_D 3 "register_operand" " vr")]) - (match_dup 1)))] - "TARGET_VECTOR && !TARGET_64BIT" - "vms%B2.vx\t%0,%3,%4,v0.t" - [(set_attr "type" "vicmp") - (set_attr "mode" "") - (set_attr "merge_op_idx" "1") - (set_attr "vl_op_idx" "5") - (set (attr "ma") (symbol_ref "riscv_vector::get_ma(operands[6])")) - (set (attr "avl_type_idx") (const_int 7))]) - -;; We don't use early-clobber for LMUL <= 1 to get better codegen. -(define_insn "*pred_eqne_extended_scalar" - [(set (match_operand: 0 "register_operand" "=vr, vr, &vr, &vr") - (if_then_else: - (unspec: - [(match_operand: 1 "vector_mask_operand" "vmWc1,vmWc1,vmWc1,vmWc1") - (match_operand 6 "vector_length_operand" " rK, rK, rK, rK") - (match_operand 7 "const_int_operand" " i, i, i, i") - (match_operand 8 "const_int_operand" " i, i, i, i") - (reg:SI VL_REGNUM) - (reg:SI VTYPE_REGNUM)] UNSPEC_VPREDICATE) - (match_operator: 3 "equality_operator" - [(vec_duplicate:V_VLSI_D - (sign_extend: - (match_operand: 5 "register_operand" " r, r, r, r"))) - (match_operand:V_VLSI_D 4 "register_operand" " vr, vr, vr, vr")]) - (match_operand: 2 "vector_merge_operand" " vu, 0, vu, 0")))] - "TARGET_VECTOR && riscv_vector::cmp_lmul_le_one (mode) && !TARGET_64BIT" - "vms%B3.vx\t%0,%4,%5%p1" - [(set_attr "type" "vicmp") - (set_attr "mode" "") - (set_attr "spec_restriction" "thv,thv,rvv,rvv")]) - -(define_insn "*pred_eqne_extended_scalar_narrow" - [(set (match_operand: 0 "register_operand" "=vm, vr, vr, &vr, &vr") - (if_then_else: - (unspec: - [(match_operand: 1 "vector_mask_operand" " 0,vmWc1,vmWc1,vmWc1,vmWc1") - (match_operand 6 "vector_length_operand" " rK, rK, rK, rK, rK") - (match_operand 7 "const_int_operand" " i, i, i, i, i") - (match_operand 8 "const_int_operand" " i, i, i, i, i") - (reg:SI VL_REGNUM) - (reg:SI VTYPE_REGNUM)] UNSPEC_VPREDICATE) - (match_operator: 3 "equality_operator" - [(vec_duplicate:V_VLSI_D - (sign_extend: - (match_operand: 5 "register_operand" " r, r, r, r, r"))) - (match_operand:V_VLSI_D 4 "register_operand" " vr, 0, 0, vr, vr")]) - (match_operand: 2 "vector_merge_operand" " vu, vu, 0, vu, 0")))] - "TARGET_VECTOR && riscv_vector::cmp_lmul_gt_one (mode) && !TARGET_64BIT" - "vms%B3.vx\t%0,%4,%5%p1" - [(set_attr "type" "vicmp") - (set_attr "mode" "") - (set_attr "spec_restriction" "none,thv,thv,none,none")]) - ;; GE, vmsge.vx/vmsgeu.vx ;; ;; unmasked va >= x