From patchwork Fri Mar 1 06:27:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "demin.han" X-Patchwork-Id: 208665 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2097:b0:108:e6aa:91d0 with SMTP id gs23csp893154dyb; Thu, 29 Feb 2024 22:30:27 -0800 (PST) X-Forwarded-Encrypted: i=4; AJvYcCWVFQjR9FsRSPINHE+Xdp+hEdgDH44uqrYh1oujez6E2nqh0xkTOIipYGvrn6IzV4aDG4O5eu5kBVqtID6rFYPkimIzZQ== X-Google-Smtp-Source: AGHT+IHoW3HtN8Vd9AUbXwAiO/+iX9HMqqTiNd4GBUM41OxGxF5wVEELq5L5zLSNUxRB1TSNpXew X-Received: by 2002:a05:620a:15af:b0:787:fd91:e674 with SMTP id f15-20020a05620a15af00b00787fd91e674mr825690qkk.7.1709274627182; Thu, 29 Feb 2024 22:30:27 -0800 (PST) ARC-Seal: i=3; a=rsa-sha256; t=1709274627; cv=pass; d=google.com; s=arc-20160816; b=uoFinfCyTuUKpqXD0bFJtDBTLTpd86D8+PPlGicGffTVGU54jn7ykB7QURAlaU6kOG GmiFlFF8UlHAuGMqeuAYWpyzee1X5GdO+aYkAcD2QJHl5eHAhrEnaOZYN3DC5Po3unMV KJN+L6M45GtVqJvI1rPZY7+5/tByAqm6WrFLiDS4ayK06bZsDlw5DyDhanaVsdL2KQtA evgvvGPuH4k/6BE34tEbujjNkzJxkWrG7Wib4rEPpYNeZELHMPoTDJfo+UUPc51U16Qs nUzrqC4qlpyyH4wWUXNdbkEf3ab2KPzux05OL+vQIi4jZPhgIsG2tmwfvjLPUbqBayBA Xchg== 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=th1viYMbCnQBE8GPd5qn+4LaB3S/BD3bztfHp05jgp8=; fh=AkWPpvwPhOnqU3cJUjz+pCLfr011jkgzwHdP+JYf2bQ=; b=gtb6mvRNaCuWoLZfe12e8Aqmd3V5EgpUYbkYp13e32FYyhrW2fE02tG1LHDDkLW1tb kbc6rfqdur/pxX0e/TDm06ZkDbs9YpeUn+lTrO3BvQW5QZk/T8xxXUvAezsSDrfBS2Sd QD+kUwdXzLE2EuelheIoARr7GgRRJarCrZZCXd30HetojVsjdJ3QM0uNckHJX95hc7xY qGSl8ooEp1MZ+pIQHWo/IMSHnSj9N2bRMq/KiGTTWCwTLgkNiXjBx9W4AKg39/oNZlt0 1zDgv39vrXqcBnAZpEULkaXMoWNdUAFk/J/XjHpPlso0GUpCQ36GEHRzQ5YqFZPVoq7f iEyQ==; 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 b22-20020a05620a119600b00787b249ee3dsi2887802qkk.313.2024.02.29.22.30.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 22:30:27 -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 DE81A385841F for ; Fri, 1 Mar 2024 06:30:26 +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 B910A385840C for ; Fri, 1 Mar 2024 06:28:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B910A385840C 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 B910A385840C 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=1709274486; cv=pass; b=EqAPFJEj2jF7qJ/Z5EwtdeKcNTC5X/q2jR7qZbfrmrHp5mX1uc1Zkdi+KbZtcmeo3T8y75myuO4sR1fNsspDZpHqLbvKJS2UNK36szWDE2CY2aRFF424ja72NgGifp24U+RK0rmrsnlv+XQt5+njMuz0f07RWYzlLktpze+Ffds= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1709274486; c=relaxed/simple; bh=qxaj1lLwahI5LikBJIrZzq7bmpp96DnkQOW6sB6fmxI=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=DGHBsvXWogsJb9M6CcN1CO4lKtA6yMPN1ZCzRv6lCaTngO4eaJKMmJIGgV0pEFrLy5GnStIiHa8+NjgWdQg1rr/UcYO2MKerUqyljNAjTLtX4fMPN+4110ZMd7U/PP9P7Xzhg589Y+UsmGwT8CULYpA75i0qxHXL1Hg3eO1UzCo= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g7VuDB1QWOozbE3goARVjRebS5wBAB50ZBB3mSeH6r7nP3YlFzdBELLTmTUi0Mh32rnt3gGR/D2GBO5DQIVYOhCVNzlVrCXMdlduS/81TgrG+CxO9fNDtawHs561PK/0VZhPplPkKuJ95I7qdnEZhMkJXHhJcmbYr5607ECxRJHOeA81yqsjm9ep81r8k9rMw05yBG/fnM5DE0UJU2C9v+LsV/SOeGqXrpgKLc0HndgUcYrR7DBkRIS2osznxZcmlnzgaP+/KM6+axgTi98PywOsHcQHANXS9konrTH6IepUQkTMR03zXNw+H7hXyYopiUzgMe7p8f15Bax05TztKg== 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=th1viYMbCnQBE8GPd5qn+4LaB3S/BD3bztfHp05jgp8=; b=VHH2NJ4oUeXrOLm9oqYh8zonsOJvtWT6cDVb9NOqWLV+kL/F4t5oCS3XJlozrpI8b6Eu93cPMH+qSncTJkfGz6zH3mcSHa8gtoqmdTYRrNusUnmMulG2FZqEnfocy6rbrqYedzRuen0OBtoNtHgQpJbxf3yfzWcyQUjVxLk/lsJ8vm+3+x1oBaA2lXkZweFRXMCMtEvf1xbjh6pU4tYVdoxP5PhJzVt2RyCy/rnV02TQVhulx1f3+aT8Onc4XxUOmeytS0G7BpeA0g6B0E0+YbZ2CioJ1mA8gCsB3obhhMvMEaHh6l9LZUmnLl8A9ARWHTSLY5KmPYP0ZRe5Sw26MA== 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:50 +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:50 +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 2/5] RISC-V: Refactor expand_vec_cmp Date: Fri, 1 Mar 2024 14:27:08 +0800 Message-ID: <20240301062711.207137-3-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: c469d51e-8ad4-423b-15e4-08dc39b8b7d5 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6Yrl66OAo/3gVBHIaptAy5F0meNkZH3Yv69rsNfkXIqHWmIJS4s3S+oqivOlvCrZkPYliGuylfo71Czs25AjkcW6jJA5SkbviyLKP7boVwuU0MNTgPiWJ2qiXG2d1KMjIBznWEQgdNL87ylhwlQUcfScMO6vefpeSp1YnhFlijbl6/rEApW0JzGveJqMk6XvirPZfC0SI6TdXXnpMCbH3kvg+XORj8HGl662nR7YavoGbuugT3yexdKaUKasUalbyiRaPNUX44AIPnmnSikjY+4ZLU8i/1BuanLnG6hn6BDvmeyQL2ULNHewbFIWSSBrxuQn02xutdDz+JwE2zcnfZgogowT5U+/ai53528bAVP44Jh8MOPStlrpwd236Avo94Gay8tEwEVLcNkwaFSuPf2F2hFwzYWJ00RMgklg4yU5fxRjV0hmiWeXXqXNM6g3lWzuIx2+fBtAUeubOm+VXbydJmKJ7ANs3l27MNOZfxIppI5SrtzRSUIRQVGxzct3Ho9KdJiXcmaC7P/cK40HwlbOrVV0j4Im3adfvzehIfTDJDKB0ajYcT89x5UWCeGEYVG9OM0dsshvi9irQ/6yvfKCqND972Z/1WmI/0K2rSuXuwgUUR/igXk1fi45mLAi 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: 3Slv3CSMP+31ZIo70KLgiDStNyCE39V4v7XFyTAwSyHAW1ja5TK/nrvV7DgIzCnLKX+2oBMm3Ds4UBKYxA460yREkM+bcpyXAhHWjLPTQth7pErin0kQDFd8yrfQpvP8i1qiS7KJlyeGoZ8L8Bv1wTpR1c/21ZcjnJ5OXx3TGffuYTMrjHOdWlGS0CUOL2/iaCCRuG0NHPFOg6WoRB5yZzwiYQWWgJ8U3mewoJ7gb0cval8xZD+1WpJogISiwQEqJsqHRyz0qrdugCwqMep+xtEAEB+7XkImErcB6kXhSz4fuOhbBGBXhv1TVQtVUVDUTfyo/Xaq7MkAPsZn4+DeoFqy4kY40+0t+Va3Q0NoVaKuW0yVCQTQiO+Pq0ikLzCsiXcV/AI1p2HxhKilrdmtu+NoTMpFDGmLC4R3mycxUGXa7b6d+vTmy4gbza6gAOS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/ndI/rtB8DWDK8Fe+BF6NcwiAG4Y+ACL22wtyCoM9+7b4RGj6jmrVn+ItauNHddJjigZfHpc+h8hpjgU7CGh0sKnELMlin927w== X-OriginatorOrg: starfivetech.com X-MS-Exchange-CrossTenant-Network-Message-Id: c469d51e-8ad4-423b-15e4-08dc39b8b7d5 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:50.1714 (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: 6d33HsaziteJHqBc9JlObruton5E/xFIETuUnhfg4sNtctLenwPMAjPF3Clj8xoCNpw+h80pnJ4aqWX/UJ/+GL7mkLAtFajFz9ke66KrzYQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: ZQ0PR01MB1080 X-Spam-Status: No, score=-13.2 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: 1792304351712542706 X-GMAIL-MSGID: 1792304351712542706 There are two expand_vec_cmp functions. They have same structure and similar code. We can use default arguments instead of overloading. Tested on RV32 and RV64. gcc/ChangeLog: * config/riscv/riscv-protos.h (expand_vec_cmp): Change proto * config/riscv/riscv-v.cc (expand_vec_cmp): Use default arguments (expand_vec_cmp_float): Adapt arguments Signed-off-by: demin.han Signed-off-by: demin.han