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: "juzhe.zhong@rivai.ai" <juzhe.zhong@rivai.ai>,
	gcc-patches <gcc-patches@gcc.gnu.org>,
	"Wang, Yanzhang" <yanzhang.wang@intel.com>
Subject: RE: RE: [PATCH v1] RISC-V: Refactor RVV frm_mode attr for rounding mode intrinsic
Date: Mon, 7 Aug 2023 13:13:50 +0000	[thread overview]
Message-ID: <MW5PR11MB5908B321F29A5955F389ACF0A90CA@MW5PR11MB5908.namprd11.prod.outlook.com> (raw)
In-Reply-To: <CA+yXCZDhmmo=_7tDY2L74U4UvjZQAxk6NSj8iw9OKv7LN7aEcg@mail.gmail.com>

Got you point, thanks kito and will send patch v2 after test.

Pan

-----Original Message-----
From: Kito Cheng <kito.cheng@gmail.com> 
Sent: Monday, August 7, 2023 2:35 PM
To: Li, Pan2 <pan2.li@intel.com>
Cc: juzhe.zhong@rivai.ai; gcc-patches <gcc-patches@gcc.gnu.org>; Wang, Yanzhang <yanzhang.wang@intel.com>
Subject: Re: RE: [PATCH v1] RISC-V: Refactor RVV frm_mode attr for rounding mode intrinsic

A build-able patch attached, again, it's based on your patch :)

On Mon, Aug 7, 2023 at 11:46 AM Li, Pan2 via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> I am not quite sure if I understand it correctly, but I bet below enums are required by RISC-V mode switching, like FRM_MODE_DYN in entry, or FRM_MODE_CALL/EXIT in emit.
>
> > ;; Defines rounding mode of an floating-point operation.
> > -(define_attr "frm_mode" "rne,rtz,rdn,rup,rmm,dyn,dyn_exit,dyn_call,none"
> > +(define_attr "frm_mode" ""
> >  (cond [(eq_attr "type" "vfalu,vfwalu,vfmul,vfdiv,vfwmul,vfdiv,vfwmul")
> > -        (const_string "dyn")]
> > +        (const_string "FRM_DYN")]
> >        (const_string "none")))
>
> Pan
>
> -----Original Message-----
> From: Kito Cheng <kito.cheng@gmail.com>
> Sent: Monday, August 7, 2023 11:27 AM
> To: Li, Pan2 <pan2.li@intel.com>
> Cc: juzhe.zhong@rivai.ai; gcc-patches <gcc-patches@gcc.gnu.org>; Wang, Yanzhang <yanzhang.wang@intel.com>
> Subject: Re: RE: [PATCH v1] RISC-V: Refactor RVV frm_mode attr for rounding mode intrinsic
>
> What about using similar way as vlmul?
>
>
> # NOTE: diff is based on your patch.
> [kitoc@hsinchu02 riscv]$ git diff
> diff --git a/gcc/config/riscv/riscv-protos.h b/gcc/config/riscv/riscv-protos.h
> index 33f7cb1d670..3cb5c23cb09 100644
> --- a/gcc/config/riscv/riscv-protos.h
> +++ b/gcc/config/riscv/riscv-protos.h
> @@ -345,6 +345,7 @@ enum floating_point_rounding_mode
>   FRM_DYN = 7, /* Aka 0b111.  */
>   FRM_STATIC_MIN = FRM_RNE,
>   FRM_STATIC_MAX = FRM_RMM,
> +  FRM_NONE = 8,
> };
>
> opt_machine_mode vectorize_related_mode (machine_mode, scalar_mode,
> diff --git a/gcc/config/riscv/riscv-v.cc b/gcc/config/riscv/riscv-v.cc
> index d5fb8611d6e..3d5dc0c11be 100644
> --- a/gcc/config/riscv/riscv-v.cc
> +++ b/gcc/config/riscv/riscv-v.cc
> @@ -112,6 +112,7 @@ public:
>   {
>     m_has_fp_rounding_mode_p = true;
>     m_fp_rounding_mode = mode;
> +    gcc_assert (mode != FRM_NONE);
>   }
>
>   void add_output_operand (rtx x, machine_mode mode)
> diff --git a/gcc/config/riscv/vector.md b/gcc/config/riscv/vector.md
> index f966f1ba769..c1a7650fe85 100644
> --- a/gcc/config/riscv/vector.md
> +++ b/gcc/config/riscv/vector.md
> @@ -865,9 +865,9 @@ (define_attr "vxrm_mode" "rnu,rne,rdn,rod,none"
>         (const_string "none")))
>
> ;; Defines rounding mode of an floating-point operation.
> -(define_attr "frm_mode" "rne,rtz,rdn,rup,rmm,dyn,dyn_exit,dyn_call,none"
> +(define_attr "frm_mode" ""
>   (cond [(eq_attr "type" "vfalu,vfwalu,vfmul,vfdiv,vfwmul,vfdiv,vfwmul")
> -        (const_string "dyn")]
> +        (const_string "FRM_DYN")]
>        (const_string "none")))
>
> ;; -----------------------------------------------------------------

  reply	other threads:[~2023-08-07 13:13 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-06  3:36 pan2.li
2023-08-07  0:45 ` juzhe.zhong
2023-08-07  1:22   ` Li, Pan2
2023-08-07  1:30     ` juzhe.zhong
2023-08-07  1:34       ` Li, Pan2
2023-08-07  3:26         ` Kito Cheng
2023-08-07  3:45           ` Li, Pan2
2023-08-07  6:35             ` Kito Cheng
2023-08-07 13:13               ` Li, Pan2 [this message]
2023-08-08  5:25 ` [PATCH v2] " pan2.li
2023-08-10  2:11   ` Kito Cheng
2023-08-10  2:16     ` Li, Pan2
2023-08-10  2:20       ` Kito Cheng
2023-08-10  3:13         ` Li, Pan2
2023-08-10  3:12 ` [PATCH v3] " pan2.li
2023-08-10  3:13   ` Kito Cheng
2023-08-10  4:37     ` 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=MW5PR11MB5908B321F29A5955F389ACF0A90CA@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).