public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Li, Pan2" <pan2.li@intel.com>
To: Kito Cheng <kito.cheng@gmail.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	"juzhe.zhong@rivai.ai" <juzhe.zhong@rivai.ai>,
	"Wang, Yanzhang" <yanzhang.wang@intel.com>
Subject: RE: [PATCH v2] RISC-V: Bugfix for vls mode aggregated in GPR calling convention
Date: Tue, 30 Jan 2024 13:10:45 +0000	[thread overview]
Message-ID: <MW5PR11MB5908AFAE45FD9E56A1BAFC3DA97D2@MW5PR11MB5908.namprd11.prod.outlook.com> (raw)
In-Reply-To: <CA+yXCZDWcug1wcs_-qWsKu2jyR_mFvTgz9WSzOLb5FeYHOfSWg@mail.gmail.com>

Thanks Kito, will add assertion here, and commit it if there is no surprise in riscv regression test.

Pan

-----Original Message-----
From: Kito Cheng <kito.cheng@gmail.com> 
Sent: Tuesday, January 30, 2024 8:54 PM
To: Li, Pan2 <pan2.li@intel.com>
Cc: gcc-patches@gcc.gnu.org; juzhe.zhong@rivai.ai; Wang, Yanzhang <yanzhang.wang@intel.com>
Subject: Re: [PATCH v2] RISC-V: Bugfix for vls mode aggregated in GPR calling convention

Thanks for fixing this bug! LGTM with one minor comment :)


> diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc
> index 7b6111aa545..1de69019cd4 100644
> --- a/gcc/config/riscv/riscv.cc
> +++ b/gcc/config/riscv/riscv.cc
> @@ -1382,6 +1382,38 @@ riscv_v_ext_mode_p (machine_mode mode)
>          || riscv_v_ext_vls_mode_p (mode);
>  }
>
> +static unsigned
> +riscv_v_vls_mode_aggregate_gpr_count (unsigned vls_unit_size,
> +                                     unsigned scalar_unit_size)
> +{
> +  gcc_assert (vls_unit_size != 0 && scalar_unit_size != 0);
> +
> +  if (vls_unit_size < scalar_unit_size)
> +    return 1;
> +

Add gcc_assert ((vls_unit_size % scalar_unit_size) == 0); here to make
sure no accident :P

> +  return vls_unit_size / scalar_unit_size;
> +}
> +

  reply	other threads:[~2024-01-30 13:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-24  3:16 [PATCH v1] RISC-V: Bugfix for vls integer mode " pan2.li
2024-01-24  3:18 ` juzhe.zhong
2024-01-24  3:41   ` Li, Pan2
2024-01-24  3:43     ` juzhe.zhong
2024-01-29 13:22 ` Kito Cheng
2024-01-30  8:39   ` Li, Pan2
2024-01-30  8:37 ` [PATCH v2] RISC-V: Bugfix for vls mode aggregated in GPR " pan2.li
2024-01-30 12:54   ` Kito Cheng
2024-01-30 13:10     ` Li, Pan2 [this message]
2024-01-30 13:49       ` 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=MW5PR11MB5908AFAE45FD9E56A1BAFC3DA97D2@MW5PR11MB5908.namprd11.prod.outlook.com \
    --to=pan2.li@intel.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=juzhe.zhong@rivai.ai \
    --cc=kito.cheng@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).