public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Kewen.Lin" <linkw@linux.ibm.com>
To: Carl Love <cel@us.ibm.com>
Cc: Peter Bergner <bergner@linux.ibm.com>,
	David Edelsohn <dje.gcc@gmail.com>,
	Segher Boessenkool <segher@kernel.crashing.org>,
	gcc-patches@gcc.gnu.org
Subject: Re: [PATCH 1/2 ver 2] rs6000, add argument to function find_instance
Date: Mon, 24 Jul 2023 09:55:10 +0800	[thread overview]
Message-ID: <98628c27-5134-d1af-635b-a150125b3932@linux.ibm.com> (raw)
In-Reply-To: <ef666dabca521f1afb9cc1cf6d65a3a9a0a17084.camel@us.ibm.com>

Hi Carl,

on 2023/7/22 07:38, Carl Love wrote:
> GCC maintainers:
> 
> Version 2:  Updated a number of formatting and spacing issues.   Added
> the NARGS description to the header comment for function find_instance.
> This patch was tested on Power 8 LE/BE, Power 9 LE/BE and Power 10 LE
> with no regressions.
> 
> The rs6000 function find_instance assumes that it is called for built-
> ins with only two arguments.  There is no checking for the actual
> number of aruguments used in the built-in.  This patch adds an
> additional parameter to the function call containing the number of
> aruguments in the built-in.  The function will now do the needed checks
> for all of the arguments.
> 
> This fix is needed for the next patch in the series that fixes the
> vec_replace_unaligned built-in.c test.
> 
> Please let me know if this patch is acceptable for mainline.  Thanks.
> 
>                         Carl 
> 
> 
> 
> 
> -------------------------------------
> rs6000, add argument to function find_instance
> 
> The function find_instance assumes it is called to check a built-in with
> only two arguments.  This patch extends the function by adding a parameter
> specifying the number of built-in arguments to check.
> 
> gcc/ChangeLog:
> 	* config/rs6000/rs6000-c.cc (find_instance): Add new parameter that
> 	specifies the number of built-in arguments to check.
> 	(altivec_resolve_overloaded_builtin): Update calls to find_instance
> 	to pass the number of built-in arguments to be checked.
> ---
>  gcc/config/rs6000/rs6000-c.cc | 40 +++++++++++++++++++++++------------
>  1 file changed, 26 insertions(+), 14 deletions(-)
> 
> diff --git a/gcc/config/rs6000/rs6000-c.cc b/gcc/config/rs6000/rs6000-c.cc
> index a353bca19ef..de35490de42 100644
> --- a/gcc/config/rs6000/rs6000-c.cc
> +++ b/gcc/config/rs6000/rs6000-c.cc
> @@ -1668,18 +1668,20 @@ resolve_vec_step (resolution *res, vec<tree, va_gc> *arglist, unsigned nargs)
>  /* Look for a matching instance in a chain of instances.  INSTANCE points to
>     the chain of instances; INSTANCE_CODE is the code identifying the specific
>     built-in being searched for; FCODE is the overloaded function code; TYPES
> -   contains an array of two types that must match the types of the instance's
> -   parameters; and ARGS contains an array of two arguments to be passed to
> -   the instance.  If found, resolve the built-in and return it, unless the
> -   built-in is not supported in context.  In that case, set
> -   UNSUPPORTED_BUILTIN to true.  If we don't match, return error_mark_node
> -   and leave UNSUPPORTED_BUILTIN alone.  */
> +   contains an array of NARGS types that must match the types of the
> +   instance's parameters; ARGS contains an array of NARGS arguments to be
> +   passed to the instance; and NARGS is the number of built-in arguments to
> +   check.  If found, resolve the built-in and return it, unless the built-in
> +   is not supported in context.  In that case, set UNSUPPORTED_BUILTIN to
> +   true.  If we don't match, return error_mark_node and leave
> +   UNSUPPORTED_BUILTIN alone.
> +*/

Minor nit: "*/" doesn't need to start with a new line, just "... alone.  */".

This patch is okay for trunk with this fixed.  Thanks!

BR,
Kewen


  reply	other threads:[~2023-07-24  1:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-21 23:26 [PATCH 0/2 ver 2] rs6000, fix vec_replace_unaligned built-in arguments Carl Love
2023-07-21 23:38 ` [PATCH 1/2 ver 2] rs6000, add argument to function find_instance Carl Love
2023-07-24  1:55   ` Kewen.Lin [this message]
2023-07-21 23:38 ` [PATCH 2/2 ver 5] rs6000, fix vec_replace_unaligned built-in arguments Carl Love
2023-07-24  2:13   ` Kewen.Lin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=98628c27-5134-d1af-635b-a150125b3932@linux.ibm.com \
    --to=linkw@linux.ibm.com \
    --cc=bergner@linux.ibm.com \
    --cc=cel@us.ibm.com \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=segher@kernel.crashing.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).