diff options
author | Christophe Lyon <christophe.lyon@linaro.org> | 2023-08-14 13:19:30 +0000 |
---|---|---|
committer | Christophe Lyon <christophe.lyon@linaro.org> | 2023-08-28 08:59:51 +0000 |
commit | b06a80057334d29f3f316ad483e3a6cfd7df2484 (patch) | |
tree | ff2e2a705788e2e8c1893fa2d9320625de3d8c9e /gcc | |
parent | 455d608f878e800399f400b758f277af7aac1842 (diff) | |
download | gcc-b06a80057334d29f3f316ad483e3a6cfd7df2484.zip gcc-b06a80057334d29f3f316ad483e3a6cfd7df2484.tar.gz gcc-b06a80057334d29f3f316ad483e3a6cfd7df2484.tar.bz2 |
arm: [MVE intrinsics] add binary_widen_poly shape
This patch adds the binary_widen_poly shape description.
2023-08-14 Christophe Lyon <christophe.lyon@linaro.org>
gcc/
* config/arm/arm-mve-builtins-shapes.cc (binary_widen_poly): New.
* config/arm/arm-mve-builtins-shapes.h (binary_widen_poly): New.
Diffstat (limited to 'gcc')
-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 761da4d..23eb9d0 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.cc +++ b/gcc/config/arm/arm-mve-builtins-shapes.cc @@ -1187,6 +1187,55 @@ struct binary_widen_def : public overloaded_base<0> }; SHAPE (binary_widen) +/* <T0:twice>_t vfoo[_t0](<T0>_t, <T0>_t) + + Example: vmullbq_poly. + uint32x4_t [__arm_]vmullbq_poly[_p16](uint16x8_t a, uint16x8_t b) + uint32x4_t [__arm_]vmullbq_poly_m[_p16](uint32x4_t inactive, uint16x8_t a, uint16x8_t b, mve_pred16_t p) + uint32x4_t [__arm_]vmullbq_poly_x[_p16](uint16x8_t a, uint16x8_t b, mve_pred16_t p) */ +struct binary_widen_poly_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, "vU0,vp0,vp0", 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 (2, i, nargs) + || (type = r.infer_vector_type (i - 1)) == NUM_TYPE_SUFFIXES) + return error_mark_node; + + /* infer_vector_type found the 'unsigned' version of the 'poly' + type we are looking for, so find the 'poly' type with the same + width. */ + type = find_type_suffix (TYPE_poly, type_suffixes[type].element_bits); + + type_suffix_index wide_suffix + = find_type_suffix (TYPE_unsigned, + type_suffixes[type].element_bits * 2); + + /* Require the 'poly' type, require_matching_vector_type would try + and fail with the 'unsigned' one. */ + if (!r.require_vector_type (i, type_suffixes[type].vector_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.resolve_to (r.mode_suffix_id, type); + } +}; +SHAPE (binary_widen_poly) + /* <T0:twice>_t vfoo[_n_t0](<T0>_t, const int) Check that 'imm' is in the [1..#bits] range. diff --git a/gcc/config/arm/arm-mve-builtins-shapes.h b/gcc/config/arm/arm-mve-builtins-shapes.h index fa6ec4f..a932453 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.h +++ b/gcc/config/arm/arm-mve-builtins-shapes.h @@ -57,6 +57,7 @@ namespace arm_mve extern const function_shape *const binary_widen; extern const function_shape *const binary_widen_n; extern const function_shape *const binary_widen_opt_n; + extern const function_shape *const binary_widen_poly; extern const function_shape *const cmp; extern const function_shape *const create; extern const function_shape *const inherent; |