Thanks Kito for comments, updated in PATCH v2.

https://gcc.gnu.org/pipermail/gcc-patches/2023-August/627367.html

Pan

-----Original Message-----
From: Kito Cheng <kito.ch...@gmail.com> 
Sent: Monday, August 14, 2023 10:07 PM
To: 钟居哲 <juzhe.zh...@rivai.ai>
Cc: Li, Pan2 <pan2...@intel.com>; gcc-patches <gcc-patches@gcc.gnu.org>; Wang, 
Yanzhang <yanzhang.w...@intel.com>
Subject: Re: [PATCH v1] RISC-V: Support RVV VFREC7 rounding mode intrinsic API

> +template<int UNSPEC>

You don't need a template class here since it can only be UNSPEC_VFREC7.

> +class vfrec7_frm : public function_base
> +{
> +public:
> +  bool has_rounding_mode_operand_p () const override { return true; }
> +
> +  rtx expand (function_expander &e) const override
> +  {
> +    return e.use_exact_insn (code_for_pred (UNSPEC, e.vector_mode ()));
> +  }
> +};
> +
> /* Implements vrsub.  */
> class vrsub : public function_base
> {
> @@ -2433,6 +2448,7 @@ static CONSTEXPR const unop<SQRT> vfsqrt_obj;
> static CONSTEXPR const unop_frm<SQRT> vfsqrt_frm_obj;
> static CONSTEXPR const float_misc<UNSPEC_VFRSQRT7> vfrsqrt7_obj;
> static CONSTEXPR const float_misc<UNSPEC_VFREC7> vfrec7_obj;
> +static CONSTEXPR const vfrec7_frm<UNSPEC_VFREC7> vfrec7_frm_obj;

Then `static CONSTEXPR const vfrec7_frm vfrec7_frm_obj;` here

> static CONSTEXPR const binop<SMIN> vfmin_obj;
> static CONSTEXPR const binop<SMAX> vfmax_obj;
> static CONSTEXPR const float_misc<UNSPEC_VCOPYSIGN> vfsgnj_obj;

Reply via email to