diff options
author | Christophe Lyon <christophe.lyon@arm.com> | 2023-02-28 15:50:16 +0000 |
---|---|---|
committer | Christophe Lyon <christophe.lyon@arm.com> | 2023-05-12 12:40:39 +0200 |
commit | 4be4771b8f652d46b59fc2cbfd1f94bbd66e30a6 (patch) | |
tree | 400d8c84c449b51cd927d2eabd2b895e3beb5cbb | |
parent | f7196b72752cc4089570e75ebcce641b6d0165f2 (diff) | |
download | gcc-4be4771b8f652d46b59fc2cbfd1f94bbd66e30a6.zip gcc-4be4771b8f652d46b59fc2cbfd1f94bbd66e30a6.tar.gz gcc-4be4771b8f652d46b59fc2cbfd1f94bbd66e30a6.tar.bz2 |
arm: [MVE intrinsics] add vpsel shape
This patch adds the vpsel shape description.
2022-12-12 Christophe Lyon <christophe.lyon@arm.com>
gcc/
* config/arm/arm-mve-builtins-shapes.cc (vpsel): New.
* config/arm/arm-mve-builtins-shapes.h (vpsel): New.
-rw-r--r-- | gcc/config/arm/arm-mve-builtins-shapes.cc | 39 | ||||
-rw-r--r-- | gcc/config/arm/arm-mve-builtins-shapes.h | 1 |
2 files changed, 40 insertions, 0 deletions
diff --git a/gcc/config/arm/arm-mve-builtins-shapes.cc b/gcc/config/arm/arm-mve-builtins-shapes.cc index cd105fb..9afa129 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.cc +++ b/gcc/config/arm/arm-mve-builtins-shapes.cc @@ -1706,6 +1706,45 @@ struct unary_widen_acc_def : public overloaded_base<0> }; SHAPE (unary_widen_acc) +/* <T0>_t vfoo[_t0](<T0>_t, <T0>_t, mve_pred16_t) + + i.e. a version of the standard ternary shape in which + the final argument is always a set of predicates. + + Example: vpselq. + int16x8_t [__arm_]vpselq[_s16](int16x8_t a, int16x8_t b, mve_pred16_t p) */ +struct vpsel_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, "v0,v0,v0,p", group, MODE_none, preserve_user_namespace); + } + + tree + resolve (function_resolver &r) const override + { + unsigned int i, nargs; + type_suffix_index type; + if (!r.check_gp_argument (3, i, nargs) + || (type = r.infer_vector_type (0)) == NUM_TYPE_SUFFIXES) + return error_mark_node; + + unsigned int last_arg = i; + for (i = 0; i < last_arg; i++) + if (!r.require_matching_vector_type (i, type)) + return error_mark_node; + + if (!r.require_vector_type (2 , VECTOR_TYPE_mve_pred16_t)) + return error_mark_node; + + return r.resolve_to (r.mode_suffix_id, type); + } +}; +SHAPE (vpsel) + } /* end namespace arm_mve */ #undef SHAPE diff --git a/gcc/config/arm/arm-mve-builtins-shapes.h b/gcc/config/arm/arm-mve-builtins-shapes.h index f67a484..6e81809 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.h +++ b/gcc/config/arm/arm-mve-builtins-shapes.h @@ -71,6 +71,7 @@ namespace arm_mve extern const function_shape *const unary_n; extern const function_shape *const unary_widen; extern const function_shape *const unary_widen_acc; + extern const function_shape *const vpsel; } /* end namespace arm_mve::shapes */ } /* end namespace arm_mve */ |