aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@linaro.org>2023-08-10 15:39:04 +0000
committerChristophe Lyon <christophe.lyon@linaro.org>2023-08-28 08:59:50 +0000
commitdfd45e21c17653b958e1c9441b616660a1861275 (patch)
tree79414e25735ac90552a34968bf5fc88645048540
parentcf13ab5fc3ee81cfe24d6a4015d465e303817ad4 (diff)
downloadgcc-dfd45e21c17653b958e1c9441b616660a1861275.zip
gcc-dfd45e21c17653b958e1c9441b616660a1861275.tar.gz
gcc-dfd45e21c17653b958e1c9441b616660a1861275.tar.bz2
arm: [MVE intrinsics] add binary_widen shape
This patch adds the binary_widen shape description. 2023-08-14 Christophe Lyon <christophe.lyon@linaro.org> gcc/: * config/arm/arm-mve-builtins-shapes.cc (binary_widen): New. * config/arm/arm-mve-builtins-shapes.h (binary_widen): New.
-rw-r--r--gcc/config/arm/arm-mve-builtins-shapes.cc42
-rw-r--r--gcc/config/arm/arm-mve-builtins-shapes.h5
2 files changed, 45 insertions, 2 deletions
diff --git a/gcc/config/arm/arm-mve-builtins-shapes.cc b/gcc/config/arm/arm-mve-builtins-shapes.cc
index 1f22201..c8eb335 100644
--- a/gcc/config/arm/arm-mve-builtins-shapes.cc
+++ b/gcc/config/arm/arm-mve-builtins-shapes.cc
@@ -1129,6 +1129,48 @@ struct binary_rshift_narrow_unsigned_def : public overloaded_base<0>
};
SHAPE (binary_rshift_narrow_unsigned)
+/* <T0:twice>_t vfoo[_t0](<T0>_t, <T0>_t)
+
+ Example: vmullbq.
+ int32x4_t [__arm_]vmullbq_int[_s16](int16x8_t a, int16x8_t b)
+ int32x4_t [__arm_]vmullbq_int_m[_s16](int32x4_t inactive, int16x8_t a, int16x8_t b, mve_pred16_t p)
+ int32x4_t [__arm_]vmullbq_int_x[_s16](int16x8_t a, int16x8_t b, mve_pred16_t p) */
+struct binary_widen_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);
+ }
+
+ 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);
+
+ 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.resolve_to (r.mode_suffix_id, type);
+ }
+};
+SHAPE (binary_widen)
+
/* <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 a1842f5..fa6ec4f 100644
--- a/gcc/config/arm/arm-mve-builtins-shapes.h
+++ b/gcc/config/arm/arm-mve-builtins-shapes.h
@@ -35,13 +35,13 @@ namespace arm_mve
{
extern const function_shape *const binary;
- extern const function_shape *const binary_lshift;
- extern const function_shape *const binary_lshift_r;
extern const function_shape *const binary_acc_int32;
extern const function_shape *const binary_acc_int64;
extern const function_shape *const binary_acca_int32;
extern const function_shape *const binary_acca_int64;
extern const function_shape *const binary_imm32;
+ extern const function_shape *const binary_lshift;
+ extern const function_shape *const binary_lshift_r;
extern const function_shape *const binary_lshift_unsigned;
extern const function_shape *const binary_maxamina;
extern const function_shape *const binary_maxavminav;
@@ -54,6 +54,7 @@ namespace arm_mve
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 binary_widen;
extern const function_shape *const binary_widen_n;
extern const function_shape *const binary_widen_opt_n;
extern const function_shape *const cmp;