diff options
author | Christophe Lyon <christophe.lyon@arm.com> | 2023-02-27 10:32:55 +0000 |
---|---|---|
committer | Christophe Lyon <christophe.lyon@arm.com> | 2023-05-12 12:40:36 +0200 |
commit | 9b9267665010905b87802c023f709dd899ff751a (patch) | |
tree | c58c28f744a866aad819d6a3501214590062ecad | |
parent | 7a7f6b26259d22115ee4813ce130622ad1073d16 (diff) | |
download | gcc-9b9267665010905b87802c023f709dd899ff751a.zip gcc-9b9267665010905b87802c023f709dd899ff751a.tar.gz gcc-9b9267665010905b87802c023f709dd899ff751a.tar.bz2 |
arm: [MVE intrinsics] add binary_widen_opt_n shape
This patch adds the binary_widen_opt_n shape description.
2022-12-12 Christophe Lyon <christophe.lyon@arm.com>
gcc/
* config/arm/arm-mve-builtins-shapes.cc (binary_widen_opt_n): New.
* config/arm/arm-mve-builtins-shapes.h (binary_widen_opt_n): New.
-rw-r--r-- | gcc/config/arm/arm-mve-builtins-shapes.cc | 49 | ||||
-rw-r--r-- | gcc/config/arm/arm-mve-builtins-shapes.h | 1 |
2 files changed, 50 insertions, 0 deletions
diff --git a/gcc/config/arm/arm-mve-builtins-shapes.cc b/gcc/config/arm/arm-mve-builtins-shapes.cc index 5a299a2..47a0395 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.cc +++ b/gcc/config/arm/arm-mve-builtins-shapes.cc @@ -1098,6 +1098,55 @@ struct binary_widen_n_def : public overloaded_base<0> }; SHAPE (binary_widen_n) +/* <T0:twice>_t vfoo[_t0](<T0>_t, <T0>_t) + <T0:twice>_t vfoo[_n_t0](<T0>_t, <S0>_t) + + Example: vqdmullbq. + int32x4_t [__arm_]vqdmulltq[_n_s16](int16x8_t a, int16_t b) + int32x4_t [__arm_]vqdmulltq_m[_n_s16](int32x4_t inactive, int16x8_t a, int16_t b, mve_pred16_t p) + int32x4_t [__arm_]vqdmulltq[_s16](int16x8_t a, int16x8_t b) + int32x4_t [__arm_]vqdmulltq_m[_s16](int32x4_t inactive, int16x8_t a, int16x8_t b, mve_pred16_t p) */ +struct binary_widen_opt_n_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_none, preserve_user_namespace); + build_all (b, "vw0,v0,v0", group, MODE_none, preserve_user_namespace); + build_all (b, "vw0,v0,s0", group, MODE_n, preserve_user_namespace); + } + + tree + resolve (function_resolver &r) const override + { + unsigned int i, nargs; + type_suffix_index type; + if (!r.check_gp_argument (2, i, nargs) + || (type = r.infer_vector_type (i - 1)) == NUM_TYPE_SUFFIXES) + return error_mark_node; + + type_suffix_index wide_suffix + = find_type_suffix (type_suffixes[type].tclass, + type_suffixes[type].element_bits * 2); + + /* Skip last argument, may be scalar, will be checked below by + finish_opt_n_resolution. */ + unsigned int last_arg = i--; + for (; i > 0; i--) + if (!r.require_matching_vector_type (i, type)) + return error_mark_node; + + /* Check the inactive argument has the wide type. */ + if ((r.pred == PRED_m) + && (r.infer_vector_type (0) != wide_suffix)) + return r.report_no_such_form (type); + + return r.finish_opt_n_resolution (last_arg, 0, type); + } +}; +SHAPE (binary_widen_opt_n) + /* Shape for comparison operations that operate on uniform types. diff --git a/gcc/config/arm/arm-mve-builtins-shapes.h b/gcc/config/arm/arm-mve-builtins-shapes.h index a28cd6a..07b12b4 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.h +++ b/gcc/config/arm/arm-mve-builtins-shapes.h @@ -53,6 +53,7 @@ namespace arm_mve extern const function_shape *const binary_rshift_narrow; extern const function_shape *const binary_rshift_narrow_unsigned; extern const function_shape *const binary_widen_n; + extern const function_shape *const binary_widen_opt_n; extern const function_shape *const cmp; extern const function_shape *const create; extern const function_shape *const inherent; |