RISC-V: Add _mu C++ overloaded intrinsics for load && viota && vid

Message ID 20230601230441.294259-1-juzhe.zhong@rivai.ai
State Accepted
Headers
Series RISC-V: Add _mu C++ overloaded intrinsics for load && viota && vid |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

juzhe.zhong@rivai.ai June 1, 2023, 11:04 p.m. UTC
  From: Juzhe-Zhong <juzhe.zhong@rivai.ai>

Base on these:
https://github.com/riscv-non-isa/rvv-intrinsic-doc/issues/232
https://github.com/riscv-non-isa/rvv-intrinsic-doc/pull/233

Add _mu C++ overloaded intrinsics for load && viota && vid.

gcc/ChangeLog:

        * config/riscv/riscv-vector-builtins-bases.cc: Add _mu overloaded intrinsics.

---
 gcc/config/riscv/riscv-vector-builtins-bases.cc | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
  

Comments

KuanLin Chen June 2, 2023, 1:26 a.m. UTC | #1
Hi Juzhe,

I think fault_load_def::get_name should remove "instance.pred ==
PRED_TYPE_mu", right?

<juzhe.zhong@rivai.ai> 於 2023年6月2日 週五 上午7:05寫道:
>
> From: Juzhe-Zhong <juzhe.zhong@rivai.ai>
>
> Base on these:
> https://github.com/riscv-non-isa/rvv-intrinsic-doc/issues/232
> https://github.com/riscv-non-isa/rvv-intrinsic-doc/pull/233
>
> Add _mu C++ overloaded intrinsics for load && viota && vid.
>
> gcc/ChangeLog:
>
>         * config/riscv/riscv-vector-builtins-bases.cc: Add _mu overloaded intrinsics.
>
> ---
>  gcc/config/riscv/riscv-vector-builtins-bases.cc | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/gcc/config/riscv/riscv-vector-builtins-bases.cc b/gcc/config/riscv/riscv-vector-builtins-bases.cc
> index a8113f6602b..498c6ba042e 100644
> --- a/gcc/config/riscv/riscv-vector-builtins-bases.cc
> +++ b/gcc/config/riscv/riscv-vector-builtins-bases.cc
> @@ -164,7 +164,7 @@ public:
>    {
>      if (STORE_P || LST_TYPE == LST_INDEXED)
>        return true;
> -    return pred != PRED_TYPE_none && pred != PRED_TYPE_mu;
> +    return pred != PRED_TYPE_none;
>    }
>
>    rtx expand (function_expander &e) const override
> @@ -963,7 +963,7 @@ public:
>    bool can_be_overloaded_p (enum predication_type_index pred) const override
>    {
>      return pred == PRED_TYPE_tu || pred == PRED_TYPE_tum
> -          || pred == PRED_TYPE_tumu;
> +          || pred == PRED_TYPE_tumu || pred == PRED_TYPE_mu;
>    }
>
>    rtx expand (function_expander &e) const override
> @@ -979,7 +979,7 @@ public:
>    bool can_be_overloaded_p (enum predication_type_index pred) const override
>    {
>      return pred == PRED_TYPE_tu || pred == PRED_TYPE_tum
> -          || pred == PRED_TYPE_tumu;
> +          || pred == PRED_TYPE_tumu || pred == PRED_TYPE_mu;
>    }
>
>    rtx expand (function_expander &e) const override
> @@ -1749,7 +1749,7 @@ public:
>
>    bool can_be_overloaded_p (enum predication_type_index pred) const override
>    {
> -    return pred != PRED_TYPE_none && pred != PRED_TYPE_mu;
> +    return pred != PRED_TYPE_none;
>    }
>
>    rtx expand (function_expander &e) const override
> @@ -1794,7 +1794,7 @@ public:
>
>    bool can_be_overloaded_p (enum predication_type_index pred) const override
>    {
> -    return pred != PRED_TYPE_none && pred != PRED_TYPE_mu;
> +    return pred != PRED_TYPE_none;
>    }
>
>    rtx expand (function_expander &e) const override
> --
> 2.36.1
>
  
juzhe.zhong@rivai.ai June 2, 2023, 1:32 a.m. UTC | #2
Oh. Yes. Thanks for catching this!
Will send V2 soon.



juzhe.zhong@rivai.ai
 
From: KuanLin Chen
Date: 2023-06-02 09:26
To: gcc-patches; juzhe.zhong
CC: kito.cheng; palmer; rdapp.gcc; jeffreyalaw
Subject: Re: [PATCH] RISC-V: Add _mu C++ overloaded intrinsics for load && viota && vid
Hi Juzhe,
 
I think fault_load_def::get_name should remove "instance.pred ==
PRED_TYPE_mu", right?
 
<juzhe.zhong@rivai.ai> 於 2023年6月2日 週五 上午7:05寫道:
>
> From: Juzhe-Zhong <juzhe.zhong@rivai.ai>
>
> Base on these:
> https://github.com/riscv-non-isa/rvv-intrinsic-doc/issues/232
> https://github.com/riscv-non-isa/rvv-intrinsic-doc/pull/233
>
> Add _mu C++ overloaded intrinsics for load && viota && vid.
>
> gcc/ChangeLog:
>
>         * config/riscv/riscv-vector-builtins-bases.cc: Add _mu overloaded intrinsics.
>
> ---
>  gcc/config/riscv/riscv-vector-builtins-bases.cc | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/gcc/config/riscv/riscv-vector-builtins-bases.cc b/gcc/config/riscv/riscv-vector-builtins-bases.cc
> index a8113f6602b..498c6ba042e 100644
> --- a/gcc/config/riscv/riscv-vector-builtins-bases.cc
> +++ b/gcc/config/riscv/riscv-vector-builtins-bases.cc
> @@ -164,7 +164,7 @@ public:
>    {
>      if (STORE_P || LST_TYPE == LST_INDEXED)
>        return true;
> -    return pred != PRED_TYPE_none && pred != PRED_TYPE_mu;
> +    return pred != PRED_TYPE_none;
>    }
>
>    rtx expand (function_expander &e) const override
> @@ -963,7 +963,7 @@ public:
>    bool can_be_overloaded_p (enum predication_type_index pred) const override
>    {
>      return pred == PRED_TYPE_tu || pred == PRED_TYPE_tum
> -          || pred == PRED_TYPE_tumu;
> +          || pred == PRED_TYPE_tumu || pred == PRED_TYPE_mu;
>    }
>
>    rtx expand (function_expander &e) const override
> @@ -979,7 +979,7 @@ public:
>    bool can_be_overloaded_p (enum predication_type_index pred) const override
>    {
>      return pred == PRED_TYPE_tu || pred == PRED_TYPE_tum
> -          || pred == PRED_TYPE_tumu;
> +          || pred == PRED_TYPE_tumu || pred == PRED_TYPE_mu;
>    }
>
>    rtx expand (function_expander &e) const override
> @@ -1749,7 +1749,7 @@ public:
>
>    bool can_be_overloaded_p (enum predication_type_index pred) const override
>    {
> -    return pred != PRED_TYPE_none && pred != PRED_TYPE_mu;
> +    return pred != PRED_TYPE_none;
>    }
>
>    rtx expand (function_expander &e) const override
> @@ -1794,7 +1794,7 @@ public:
>
>    bool can_be_overloaded_p (enum predication_type_index pred) const override
>    {
> -    return pred != PRED_TYPE_none && pred != PRED_TYPE_mu;
> +    return pred != PRED_TYPE_none;
>    }
>
>    rtx expand (function_expander &e) const override
> --
> 2.36.1
>
  

Patch

diff --git a/gcc/config/riscv/riscv-vector-builtins-bases.cc b/gcc/config/riscv/riscv-vector-builtins-bases.cc
index a8113f6602b..498c6ba042e 100644
--- a/gcc/config/riscv/riscv-vector-builtins-bases.cc
+++ b/gcc/config/riscv/riscv-vector-builtins-bases.cc
@@ -164,7 +164,7 @@  public:
   {
     if (STORE_P || LST_TYPE == LST_INDEXED)
       return true;
-    return pred != PRED_TYPE_none && pred != PRED_TYPE_mu;
+    return pred != PRED_TYPE_none;
   }
 
   rtx expand (function_expander &e) const override
@@ -963,7 +963,7 @@  public:
   bool can_be_overloaded_p (enum predication_type_index pred) const override
   {
     return pred == PRED_TYPE_tu || pred == PRED_TYPE_tum
-	   || pred == PRED_TYPE_tumu;
+	   || pred == PRED_TYPE_tumu || pred == PRED_TYPE_mu;
   }
 
   rtx expand (function_expander &e) const override
@@ -979,7 +979,7 @@  public:
   bool can_be_overloaded_p (enum predication_type_index pred) const override
   {
     return pred == PRED_TYPE_tu || pred == PRED_TYPE_tum
-	   || pred == PRED_TYPE_tumu;
+	   || pred == PRED_TYPE_tumu || pred == PRED_TYPE_mu;
   }
 
   rtx expand (function_expander &e) const override
@@ -1749,7 +1749,7 @@  public:
 
   bool can_be_overloaded_p (enum predication_type_index pred) const override
   {
-    return pred != PRED_TYPE_none && pred != PRED_TYPE_mu;
+    return pred != PRED_TYPE_none;
   }
 
   rtx expand (function_expander &e) const override
@@ -1794,7 +1794,7 @@  public:
 
   bool can_be_overloaded_p (enum predication_type_index pred) const override
   {
-    return pred != PRED_TYPE_none && pred != PRED_TYPE_mu;
+    return pred != PRED_TYPE_none;
   }
 
   rtx expand (function_expander &e) const override