From patchwork Wed Jan 31 01:54:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, Pan2" X-Patchwork-Id: 194430 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1616480dyb; Tue, 30 Jan 2024 17:55:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IH54Jhimf12gwTA1cqsRY7IzsGpEfmFrZisc5ShtoqGhJ5EZTVEZdkD5kv8TXZJuwUGcVs6 X-Received: by 2002:ac8:7d4f:0:b0:42a:db63:2b9f with SMTP id h15-20020ac87d4f000000b0042adb632b9fmr532824qtb.19.1706666113936; Tue, 30 Jan 2024 17:55:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706666113; cv=pass; d=google.com; s=arc-20160816; b=V/f0Rmlj6kMMWAjpxdBK7vksY28qHBi6Xk5ypxUJwK0Ibs00tKWVMCfHAAc/ttbWqE 76yLOvY/NGp+WS3abaFEO+3I3xzGI+YoSwB+Q2A7tzA+E7lI088yqSzpbRRQURyFdbxu WVKw2rvr//GOo6EtqdADEYQwQ0bvPq84gosPh2Q7OS5GQay5wXFU8i/d+1Mz3ZW9G9Iu rZ/V1UpklUvTTncfIHEW0h20Na39O5hobZEUGheMp0f1xN/qmm/2QIj4gsJ9eYNVhW/y l9xI4WtTVNuAeZT6Ya4GIvO8YkshQQQh8HQhzpAcOR0kL84JKAKdMarOLaaD6vk68DQe 4CjQ== ARC-Message-Signature: i=2; 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:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=0n4j/YWDBnyRVbRgCBalnB/YIYbTPNkRmp/15FgJWUk=; fh=vyf6OX4f5H+h3pgcahCHdwZNX1Ek9sfMZSLbBp75M5A=; b=piOlmK+N+M8tSN+AK2GA8hSMt41Qytfl9bhd1HC2jpNQN1fJ6lHV5t7510SVGoxWbY m9zGfYV7C0PPiSk1M0+kqVHFCydQkNeL0FAtUmP3rMwjDcs/VCaWx+ko+aTOICAHXdNw ikYC+oqKPVzEnoF6l23oLwBT2s3k1d9aWpyCNV34trLWCErblK415irtK2kHM1s3BGZ1 NWV2uzuF4DdSU1q+aN/YPvRaSh70+wSi5mrRImkqpIu2hALk7sF+4qXtbhQ4Z5GtBqEI 5nrwM/3xcSBkUs4p2UeiQ6XxnOUBM2krebpcQOt31H4iKaaXOGqaadMyrKpc/adQiiEL QZMg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=YlYVMQD3; arc=pass (i=1); 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=intel.com X-Forwarded-Encrypted: i=1; AJvYcCWn4xZVAr1KcBcEQIGbbzC38vhtOr+7Gbqe6bWzMCXhikem7n+HUHMPr5tTskueVQSkhth2nHJqLJfebYqVZMq8uUXG7g== Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id m10-20020a05622a118a00b0042be1813f04si1473873qtk.221.2024.01.30.17.55.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 17:55:13 -0800 (PST) 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=@intel.com header.s=Intel header.b=YlYVMQD3; arc=pass (i=1); 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=intel.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 763913858413 for ; Wed, 31 Jan 2024 01:55:13 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.115]) by sourceware.org (Postfix) with ESMTPS id E71273858407 for ; Wed, 31 Jan 2024 01:54:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E71273858407 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E71273858407 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=192.55.52.115 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706666059; cv=none; b=xBDYGs9q7oCPNez1W935mTywsFPTW2QWskfWN1LkJI6eVyMmrzyRYZ8UixrgZwVjloKKmcacSim2V2T0lMuZxbvb61fetaM/+ynyn6tLHSSuhWggOVoDOk5SAuG1Cd0RXeS1WzxujEebNyBMJRH0+kzHbxawirRMbORYtmhSuQ0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706666059; c=relaxed/simple; bh=RUvNi2zVBJnV21n7jtcYLqVe6yX6jnXIMUZFXoxBrAY=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=RdmTPkkM/vN5Qeumll+xPF2P7m2txr3CiDMATLyAmhSWgOnDMAdRF404vy47IVtAeFE8sTdCzBBry8amjI0QaM6yYa+OgWfRA9SMJUErIYuUN78Tfs4DsmTkhYbsYHmAAhsHm9xa8JosBao8xNQXt8Xe20vnSevuec3LdFm5R0o= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706666047; x=1738202047; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=RUvNi2zVBJnV21n7jtcYLqVe6yX6jnXIMUZFXoxBrAY=; b=YlYVMQD3/Z9ZwG3KoE8akKKbxZyDkhgEi3UiaWBW0IxF0+HZmcq/AkL1 1FNYltN7bzgCnyhQGXrJ1azvcN9uhIMhM2udjNW1o6Qr7/9Ud4YLhkTdz o7uD5dnjbWshpBYKwYaycv0wMrS0A/Eubdnp048LSjRkNUqspj56cBbvV X2X2f0nugGam+LqDvO2Ah6Fj67mZTDUh7u2WxgWeWUBPJvxmiDhMiNM6g 04D+GGITkN35RNUfEdS7H4VPt3MGVWBky89fNrg543jKAgEYU7X60CLhh QNyQ6CqCJ/2E0OQhx1cwAPMZRKIREJP6wsV809iu3qfJxQ2InNjPVd2ev g==; X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="403076638" X-IronPort-AV: E=Sophos;i="6.05,231,1701158400"; d="scan'208";a="403076638" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2024 17:54:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="788397939" X-IronPort-AV: E=Sophos;i="6.05,231,1701158400"; d="scan'208";a="788397939" Received: from shvmail02.sh.intel.com ([10.239.244.9]) by orsmga002.jf.intel.com with ESMTP; 30 Jan 2024 17:54:04 -0800 Received: from pli-ubuntu.sh.intel.com (pli-ubuntu.sh.intel.com [10.239.159.47]) by shvmail02.sh.intel.com (Postfix) with ESMTP id 48102100569E; Wed, 31 Jan 2024 09:54:03 +0800 (CST) From: pan2.li@intel.com To: gcc-patches@gcc.gnu.org Cc: juzhe.zhong@rivai.ai, pan2.li@intel.com, yanzhang.wang@intel.com, kito.cheng@gmail.com Subject: [PATCH v1] RISC-V: Cleanup the comments for the psabi Date: Wed, 31 Jan 2024 09:54:02 +0800 Message-Id: <20240131015402.3806586-1-pan2.li@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_NONE, 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: 1789569127018503663 X-GMAIL-MSGID: 1789569127018503663 From: Pan Li This patch would like to cleanup some comments which are out of date or incorrect. gcc/ChangeLog: * config/riscv/riscv.cc (riscv_get_arg_info): Cleanup comments. (riscv_pass_by_reference): Ditto. (riscv_fntype_abi): Ditto. Signed-off-by: Pan Li --- gcc/config/riscv/riscv.cc | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc index 529ef5e84b7..7713ad26c8d 100644 --- a/gcc/config/riscv/riscv.cc +++ b/gcc/config/riscv/riscv.cc @@ -5067,8 +5067,7 @@ riscv_get_arg_info (struct riscv_arg_info *info, const CUMULATIVE_ARGS *cum, info->gpr_offset = cum->num_gprs; info->fpr_offset = cum->num_fprs; - /* When disable vector_abi or scalable vector argument is anonymous, this - argument is passed by reference. */ + /* Passed by reference when the scalable vector argument is anonymous. */ if (riscv_v_ext_mode_p (mode) && !named) return NULL_RTX; @@ -5265,8 +5264,9 @@ riscv_pass_by_reference (cumulative_args_t cum_v, const function_arg_info &arg) so we can avoid the call to riscv_get_arg_info in this case. */ if (cum != NULL) { - /* Don't pass by reference if we can use a floating-point register. */ riscv_get_arg_info (&info, cum, arg.mode, arg.type, arg.named, false); + + /* Don't pass by reference if we can use a floating-point register. */ if (info.num_fprs) return false; @@ -5279,9 +5279,9 @@ riscv_pass_by_reference (cumulative_args_t cum_v, const function_arg_info &arg) return false; } - /* When vector abi disabled(without --param=riscv-vector-abi option) or - scalable vector argument is anonymous or cannot be passed through vector - registers, this argument is passed by reference. */ + /* Passed by reference when: + 1. The scalable vector argument is anonymous. + 2. Args cannot be passed through vector registers. */ if (riscv_v_ext_mode_p (arg.mode)) return true; @@ -5392,12 +5392,9 @@ riscv_arguments_is_vector_type_p (const_tree fntype) static const predefined_function_abi & riscv_fntype_abi (const_tree fntype) { - /* Implementing an experimental vector calling convention, the proposal - can be viewed at the bellow link: - https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/389 - - You can enable this feature via the `--param=riscv-vector-abi` compiler - option. */ + /* Implement the vector calling convention. For more details please + reference the below link. + https://github.com/riscv-non-isa/riscv-elf-psabi-doc/pull/389 */ if (riscv_return_value_is_vector_type_p (fntype) || riscv_arguments_is_vector_type_p (fntype)) return riscv_v_abi ();