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: 1893185 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=YlYVMQD3; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TPlTb191Kz23g7 for ; Wed, 31 Jan 2024 12:54:41 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E0E6F38582A0 for ; Wed, 31 Jan 2024 01:54:39 +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+incoming=patchwork.ozlabs.org@gcc.gnu.org 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 ();