public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Kito Cheng <kito.cheng@gmail.com>
To: pan2.li@intel.com
Cc: gcc-patches@gcc.gnu.org, juzhe.zhong@rivai.ai,
	yanzhang.wang@intel.com,  rdapp.gcc@gmail.com,
	jeffreyalaw@gmail.com
Subject: Re: [PATCH v3] RISC-V: Introduce gcc option mrvv-vector-bits for RVV
Date: Wed, 28 Feb 2024 20:56:31 +0800	[thread overview]
Message-ID: <CA+yXCZAk8gfTo208ck9jLVUjidXsqpp2g1u9GZhyWS1jXJBPEw@mail.gmail.com> (raw)
In-Reply-To: <20240228103532.2079576-1-pan2.li@intel.com>

Take one more look, I think this option should work and integrate with
--param=riscv-autovec-preference= since they have similar jobs but
slightly different.

We have 3 value for  --param=riscv-autovec-preference=: none, scalable
and fixed-vlmax

-mrvv-vector-bits=scalable is work like
--param=riscv-autovec-preference=scalable and
-mrvv-vector-bits=zvl is work like
--param=riscv-autovec-preference=fixed-vlmax.

So I think...we need to do some conflict check, like:

-mrvv-vector-bits=zvl can't work with --param=riscv-autovec-preference=scalable
-mrvv-vector-bits=scalable can't work with
--param=riscv-autovec-preference=fixed-vlmax

but it may not just alias since there is some useful combinations like:

-mrvv-vector-bits=zvl with --param=riscv-autovec-preference=none:
NO auto vectorization but intrinsic code still could benefit from the
-mrvv-vector-bits=zvl option.

-mrvv-vector-bits=scalable with --param=riscv-autovec-preference=none
Should still work for VLS code gen, but just disable auto
vectorization per the option semantic.

However here is something we need some fix, since
--param=riscv-autovec-preference=none still disable VLS code gen for
now, you can see some example here:
https://godbolt.org/z/fMTr3eW7K

But I think it's really the right behavior here, this part might need
to be fixed in vls_mode_valid_p and some other places.


Anyway I think we need to check all use sites with RVV_FIXED_VLMAX and
RVV_SCALABLE, and need to make sure all use site of RVV_FIXED_VLMAX
also checked with RVV_VECTOR_BITS_ZVL.



> -/* Return the VLEN value associated with -march.
> +static int
> +riscv_convert_vector_bits (int min_vlen)

Not sure if we really need this function, it seems it always returns min_vlen?

> +{
> +  int rvv_bits = 0;
> +
> +  switch (rvv_vector_bits)
> +    {
> +      case RVV_VECTOR_BITS_ZVL:
> +      case RVV_VECTOR_BITS_SCALABLE:
> +       rvv_bits = min_vlen;
> +       break;
> +      default:
> +       gcc_unreachable ();
> +    }
> +
> +  return rvv_bits;
> +}
> +
> +/* Return the VLEN value associated with -march and -mwrvv-vector-bits.

  reply	other threads:[~2024-02-28 12:56 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-23  8:05 [PATCH v1] " pan2.li
2024-02-23  8:22 ` Kito Cheng
2024-02-23  8:29   ` Jeff Law
2024-02-23  8:38     ` juzhe.zhong
2024-02-23  9:23       ` Li, Pan2
2024-02-23 20:31         ` Vineet Gupta
2024-02-28  4:16 ` [PATCH v2] " pan2.li
2024-02-28  6:16   ` Kito Cheng
2024-02-28  6:33     ` Li, Pan2
2024-02-28 10:37       ` Li, Pan2
2024-02-28 10:33 ` [PATCH v3] " pan2.li
2024-02-28 10:35 ` pan2.li
2024-02-28 12:56   ` Kito Cheng [this message]
2024-02-28 13:52     ` Li, Pan2
2024-02-28 13:58     ` 钟居哲
2024-02-28 14:55       ` Kito Cheng
2024-02-29  1:23         ` juzhe.zhong
2024-02-29 13:21           ` Robin Dapp
2024-02-29  1:23         ` Li, Pan2
2024-03-01 18:59           ` Vineet Gupta
2024-03-02  0:42             ` Li, Pan2
2024-03-01  6:13 ` [PATCH v4] " pan2.li
2024-03-01  7:09   ` 钟居哲
2024-03-01  8:45     ` [PATCH " Kito Cheng
2024-03-01 10:33       ` Li, Pan2

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=CA+yXCZAk8gfTo208ck9jLVUjidXsqpp2g1u9GZhyWS1jXJBPEw@mail.gmail.com \
    --to=kito.cheng@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jeffreyalaw@gmail.com \
    --cc=juzhe.zhong@rivai.ai \
    --cc=pan2.li@intel.com \
    --cc=rdapp.gcc@gmail.com \
    --cc=yanzhang.wang@intel.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).