Add VXRM enum

Message ID 20230713063142.66310-1-chenyixuan@iscas.ac.cn
State New
Headers
Series Add VXRM enum |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_check--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gcc_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gcc_check--master-arm success Testing passed

Commit Message

陈逸轩 July 13, 2023, 6:31 a.m. UTC
  From: XYenChi <chenyixuan@iscas.ac.cn>

Noticed that the rvv-intrinsic-doc updated the __RISCV_VXRM.
gcc/ChangeLog:Add __RISCV_VXRM enum to riscv_vector.h

2023-07-13  XYenChi  <chenyixuan@iscas.ac.cn>

        * config/riscv/riscv_vector.h (enum __RISCV_VXRM):Add an enum __RISCV_VXRM to help express the rounding modes.


---
 gcc/config/riscv/riscv_vector.h | 7 +++++++
 1 file changed, 7 insertions(+)
  

Comments

Robin Dapp July 13, 2023, 6:54 a.m. UTC | #1
> +enum __RISCV_VXRM {
> +  __RISCV_VXRM_RNU = 0,
> +  __RISCV_VXRM_RNE = 1,
> +  __RISCV_VXRM_RDN = 2,
> +  __RISCV_VXRM_ROD = 3,
> +};
> +
>  __extension__ extern __inline unsigned long
>  __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
>  vread_csr(enum RVV_CSR csr)

We have that already in riscv-protos.h :)
(fixed_point_rounding_mode)

Regards
 Robin
  
Kito Cheng July 13, 2023, 7:24 a.m. UTC | #2
Those enum values have been defined via `#pragma riscv intrinsic "vector"` :)

https://github.com/gcc-mirror/gcc/commit/01d62e9b6c3e9fd3132f1616843103ccf81778ed

On Thu, Jul 13, 2023 at 2:55 PM Robin Dapp via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> > +enum __RISCV_VXRM {
> > +  __RISCV_VXRM_RNU = 0,
> > +  __RISCV_VXRM_RNE = 1,
> > +  __RISCV_VXRM_RDN = 2,
> > +  __RISCV_VXRM_ROD = 3,
> > +};
> > +
> >  __extension__ extern __inline unsigned long
> >  __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
> >  vread_csr(enum RVV_CSR csr)
>
> We have that already in riscv-protos.h :)
> (fixed_point_rounding_mode)
>
> Regards
>  Robin
>
  
陈逸轩 July 13, 2023, 7:54 a.m. UTC | #3
Oh, sorry for that, thank you very much! XD


&gt; -----Original Messages-----
&gt; From: "Kito Cheng" <kito.cheng@gmail.com>
&gt; Sent Time: 2023-07-13 15:24:45 (Thursday)
&gt; To: "Robin Dapp" <rdapp.gcc@gmail.com>
&gt; Cc: chenyixuan@iscas.ac.cn, gcc-patches@gcc.gnu.org, andrew@sifive.com, shiyulong@iscas.ac.cn, oriachiuan@gmail.com, shihua@iscas.ac.cn, jiawei@iscas.ac.cn
&gt; Subject: Re: [PATCH] Add VXRM enum
&gt; 
&gt; Those enum values have been defined via `#pragma riscv intrinsic "vector"` :)
&gt; 
&gt; https://github.com/gcc-mirror/gcc/commit/01d62e9b6c3e9fd3132f1616843103ccf81778ed
&gt; 
&gt; On Thu, Jul 13, 2023 at 2:55 PM Robin Dapp via Gcc-patches
&gt; <gcc-patches@gcc.gnu.org> wrote:
&gt; &gt;
&gt; &gt; &gt; +enum __RISCV_VXRM {
&gt; &gt; &gt; +  __RISCV_VXRM_RNU = 0,
&gt; &gt; &gt; +  __RISCV_VXRM_RNE = 1,
&gt; &gt; &gt; +  __RISCV_VXRM_RDN = 2,
&gt; &gt; &gt; +  __RISCV_VXRM_ROD = 3,
&gt; &gt; &gt; +};
&gt; &gt; &gt; +
&gt; &gt; &gt;  __extension__ extern __inline unsigned long
&gt; &gt; &gt;  __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
&gt; &gt; &gt;  vread_csr(enum RVV_CSR csr)
&gt; &gt;
&gt; &gt; We have that already in riscv-protos.h :)
&gt; &gt; (fixed_point_rounding_mode)
&gt; &gt;
&gt; &gt; Regards
&gt; &gt;  Robin
&gt; &gt;
</gcc-patches@gcc.gnu.org></rdapp.gcc@gmail.com></kito.cheng@gmail.com>
  

Patch

diff --git a/gcc/config/riscv/riscv_vector.h b/gcc/config/riscv/riscv_vector.h
index ff54b6be863..0a90816be1a 100644
--- a/gcc/config/riscv/riscv_vector.h
+++ b/gcc/config/riscv/riscv_vector.h
@@ -42,6 +42,13 @@  enum RVV_CSR {
   RVV_VCSR,
 };
 
+enum __RISCV_VXRM {
+  __RISCV_VXRM_RNU = 0,
+  __RISCV_VXRM_RNE = 1,
+  __RISCV_VXRM_RDN = 2,
+  __RISCV_VXRM_ROD = 3,
+};
+
 __extension__ extern __inline unsigned long
 __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
 vread_csr(enum RVV_CSR csr)