public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: 钟居哲 <juzhe.zhong@rivai.ai>
To: "Bernhard Reutner-Fischer" <rep.dot.nop@gmail.com>
Cc: "Bernhard Reutner-Fischer" <rep.dot.nop@gmail.com>,
	 gcc-patches <gcc-patches@gcc.gnu.org>,
	 rguenther <rguenther@suse.de>,
	 richard.sandiford <richard.sandiford@arm.com>
Subject: Re: Re: [PATCH V5] VECT: Apply LEN_MASK_{LOAD,STORE} into vectorizer
Date: Fri, 23 Jun 2023 06:52:10 +0800	[thread overview]
Message-ID: <9DDAE00A14534A70+2023062306521003409973@rivai.ai> (raw)
In-Reply-To: <20230622180551.2bc62c61@nbbrfq.loc>

[-- Attachment #1: Type: text/plain, Size: 3003 bytes --]

Thanks so much. Will send V6 patch.




juzhe.zhong@rivai.ai
 
From: Bernhard Reutner-Fischer
Date: 2023-06-23 00:05
To: juzhe.zhong
CC: rep.dot.nop; gcc-patches; rguenther; richard.sandiford
Subject: Re: [PATCH V5] VECT: Apply LEN_MASK_{LOAD,STORE} into vectorizer
On Thu, 22 Jun 2023 21:53:48 +0800
juzhe.zhong@rivai.ai wrote:
 
> +static bool
> +target_supports_mask_load_store_p (machine_mode mode, machine_mode mask_mode,
> +    bool is_load, internal_fn *ifn)
> +{
> +  optab op = is_load ? maskload_optab : maskstore_optab;
> +  optab len_op = is_load ? len_maskload_optab : len_maskstore_optab;
> +  if (convert_optab_handler (op, mode, mask_mode) != CODE_FOR_nothing)
> +    {
> +      if (ifn)
> + *ifn = is_load ? IFN_MASK_LOAD : IFN_MASK_STORE;
> +      return true;
> +    }
> +  else if (convert_optab_handler (len_op, mode, mask_mode) != CODE_FOR_nothing)
> +    {
> +      *ifn = is_load ? IFN_LEN_MASK_LOAD : IFN_LEN_MASK_STORE;
 
It feels inconsistent that you do not check ifn here.
 
> +      return true;
> +    }
> +  return false;
> +}
 
> +/* Return true if the target has support for len load/store.
> +   We can support len load/store by either len_{load,store}
> +   or len_mask{load,store}.
> +   This helper function checks whether target supports len
> +   load/store and return corresponding IFN in the last argument
> +   (IFN_LEN_{LOAD,STORE} or IFN_LEN_MASK_{LOAD,STORE}).  */
> +
> +static bool
> +target_supports_len_load_store_p (machine_mode mode, bool is_load,
> +   internal_fn *ifn)
> +{
> +  optab op = is_load ? len_load_optab : len_store_optab;
> +  optab masked_op = is_load ? len_maskload_optab : len_maskstore_optab;
> +
> +  if (direct_optab_handler (op, mode))
> +    {
> +      if (ifn)
> + *ifn = is_load ? IFN_LEN_LOAD : IFN_LEN_STORE;
> +      return true;
> +    }
> +  machine_mode mask_mode;
> +  if (targetm.vectorize.get_mask_mode (mode).exists (&mask_mode)
> +      && convert_optab_handler (masked_op, mode, mask_mode) != CODE_FOR_nothing)
> +    {
> +      if (ifn)
> + *ifn = is_load ? IFN_LEN_MASK_LOAD : IFN_LEN_MASK_STORE;
> +      return true;
> +    }
> +  return false;
> +}
> +
>  /* If target supports vector load/store with length for vector mode MODE,
>     return the corresponding vector mode, otherwise return opt_machine_mode ().
>     There are two flavors for vector load/store with length, one is to measure
>     length with bytes, the other is to measure length with lanes.
>     As len_{load,store} optabs point out, for the flavor with bytes, we use
> -   VnQI to wrap the other supportable same size vector modes.  */
> +   VnQI to wrap the other supportable same size vector modes.
> +   An additional output in the last argumennt which is the IFN pointer.
> +   We set IFN as LEN_{LOAD,STORE} or LEN_MASK_{LOAD,STORE} according
> +   which optab is supported in the targe.  */
 
s/argumennt/argument/
s/targe\./target./
 
thanks,
 

  reply	other threads:[~2023-06-22 22:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-22 13:53 juzhe.zhong
2023-06-22 16:05 ` Bernhard Reutner-Fischer
2023-06-22 22:52   ` 钟居哲 [this message]
2023-06-22 18:27 ` Richard Sandiford
2023-06-22 22:52   ` 钟居哲
2023-06-23  6:21 ` Richard Biener
2023-06-23  7:10   ` 钟居哲

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=9DDAE00A14534A70+2023062306521003409973@rivai.ai \
    --to=juzhe.zhong@rivai.ai \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rep.dot.nop@gmail.com \
    --cc=rguenther@suse.de \
    --cc=richard.sandiford@arm.com \
    /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).