> -----Original Message-----
> From: Christophe Lyon <christophe.l...@arm.com>
> Sent: Friday, May 5, 2023 9:39 AM
> To: gcc-patches@gcc.gnu.org; Kyrylo Tkachov <kyrylo.tkac...@arm.com>;
> Richard Earnshaw <richard.earns...@arm.com>; Richard Sandiford
> <richard.sandif...@arm.com>
> Cc: Christophe Lyon <christophe.l...@arm.com>
> Subject: [PATCH 21/23] arm: [MVE intrinsics] add binary_rshift shape
> 
> This patch adds the binary_rshift shape description.
> 

Ok.
Thanks,
Kyrill

> 2022-09-08  Christophe Lyon  <christophe.l...@arm.com>
> 
>       gcc/
>       * config/arm/arm-mve-builtins-shapes.cc (binary_rshift): New.
>       * config/arm/arm-mve-builtins-shapes.h (binary_rshift): New.
> ---
>  gcc/config/arm/arm-mve-builtins-shapes.cc | 36 +++++++++++++++++++++++
>  gcc/config/arm/arm-mve-builtins-shapes.h  |  1 +
>  2 files changed, 37 insertions(+)
> 
> diff --git a/gcc/config/arm/arm-mve-builtins-shapes.cc b/gcc/config/arm/arm-
> mve-builtins-shapes.cc
> index e3bf586565c..7078f7d7220 100644
> --- a/gcc/config/arm/arm-mve-builtins-shapes.cc
> +++ b/gcc/config/arm/arm-mve-builtins-shapes.cc
> @@ -365,6 +365,42 @@ struct binary_def : public overloaded_base<0>
>  };
>  SHAPE (binary)
> 
> +/* <T0>_t vfoo[_n_t0](<T0>_t, const int)
> +
> +   Shape for vector shift right operations that take a vector first
> +   argument and an integer, and produce a vector.
> +
> +   Check that 'imm' is in the [1..#bits] range.
> +
> +   Example: vrshrq.
> +   int8x16_t [__arm_]vrshrq[_n_s8](int8x16_t a, const int imm)
> +   int8x16_t [__arm_]vrshrq_m[_n_s8](int8x16_t inactive, int8x16_t a, const
> int imm, mve_pred16_t p)
> +   int8x16_t [__arm_]vrshrq_x[_n_s8](int8x16_t a, const int imm,
> mve_pred16_t p)  */
> +struct binary_rshift_def : public overloaded_base<0>
> +{
> +  void
> +  build (function_builder &b, const function_group_info &group,
> +      bool preserve_user_namespace) const override
> +  {
> +    b.add_overloaded_functions (group, MODE_n,
> preserve_user_namespace);
> +    build_all (b, "v0,v0,ss32", group, MODE_n, preserve_user_namespace);
> +  }
> +
> +  tree
> +  resolve (function_resolver &r) const override
> +  {
> +    return r.resolve_uniform (1, 1);
> +  }
> +
> +  bool
> +  check (function_checker &c) const override
> +  {
> +    unsigned int bits = c.type_suffix (0).element_bits;
> +    return c.require_immediate_range (1, 1, bits);
> +  }
> +};
> +SHAPE (binary_rshift)
> +
>  /* <T0>_t vfoo[_t0](<T0>_t, <T0>_t)
>     <T0>_t vfoo[_n_t0](<T0>_t, <S0>_t)
> 
> diff --git a/gcc/config/arm/arm-mve-builtins-shapes.h b/gcc/config/arm/arm-
> mve-builtins-shapes.h
> index ca1c1017e8e..09e00b69e63 100644
> --- a/gcc/config/arm/arm-mve-builtins-shapes.h
> +++ b/gcc/config/arm/arm-mve-builtins-shapes.h
> @@ -40,6 +40,7 @@ namespace arm_mve
>      extern const function_shape *const binary_opt_n;
>      extern const function_shape *const binary_orrq;
>      extern const function_shape *const binary_round_lshift;
> +    extern const function_shape *const binary_rshift;
>      extern const function_shape *const binary_rshift_narrow;
>      extern const function_shape *const binary_rshift_narrow_unsigned;
>      extern const function_shape *const create;
> --
> 2.34.1

Reply via email to