public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH v1] RISC-V: Cleanup the comments for the psabi
@ 2024-01-31  1:54 pan2.li
  2024-02-01 13:39 ` Jeff Law
  0 siblings, 1 reply; 3+ messages in thread
From: pan2.li @ 2024-01-31  1:54 UTC (permalink / raw)
  To: gcc-patches; +Cc: juzhe.zhong, pan2.li, yanzhang.wang, kito.cheng

From: Pan Li <pan2.li@intel.com>

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 <pan2.li@intel.com>
---
 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 ();
-- 
2.34.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1] RISC-V: Cleanup the comments for the psabi
  2024-01-31  1:54 [PATCH v1] RISC-V: Cleanup the comments for the psabi pan2.li
@ 2024-02-01 13:39 ` Jeff Law
  2024-02-02  2:24   ` Li, Pan2
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Law @ 2024-02-01 13:39 UTC (permalink / raw)
  To: pan2.li, gcc-patches; +Cc: juzhe.zhong, yanzhang.wang, kito.cheng



On 1/30/24 18:54, pan2.li@intel.com wrote:
> From: Pan Li <pan2.li@intel.com>
> 
> 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.
OK
jeff

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH v1] RISC-V: Cleanup the comments for the psabi
  2024-02-01 13:39 ` Jeff Law
@ 2024-02-02  2:24   ` Li, Pan2
  0 siblings, 0 replies; 3+ messages in thread
From: Li, Pan2 @ 2024-02-02  2:24 UTC (permalink / raw)
  To: Jeff Law, gcc-patches; +Cc: juzhe.zhong, Wang, Yanzhang, kito.cheng

Committed, thanks Jeff.

Pan

-----Original Message-----
From: Jeff Law <jeffreyalaw@gmail.com> 
Sent: Thursday, February 1, 2024 9:39 PM
To: Li, Pan2 <pan2.li@intel.com>; gcc-patches@gcc.gnu.org
Cc: juzhe.zhong@rivai.ai; Wang, Yanzhang <yanzhang.wang@intel.com>; kito.cheng@gmail.com
Subject: Re: [PATCH v1] RISC-V: Cleanup the comments for the psabi



On 1/30/24 18:54, pan2.li@intel.com wrote:
> From: Pan Li <pan2.li@intel.com>
> 
> 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.
OK
jeff

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-02-02  2:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-31  1:54 [PATCH v1] RISC-V: Cleanup the comments for the psabi pan2.li
2024-02-01 13:39 ` Jeff Law
2024-02-02  2:24   ` Li, Pan2

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).