aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@arm.com>2023-02-21 15:45:53 +0000
committerChristophe Lyon <christophe.lyon@arm.com>2023-05-11 10:25:11 +0200
commit9d7f7762ffe4360a55edbe0b16e91775dc2755e0 (patch)
tree8ce836bea6810d12d803daa4e5e032b0111d1107
parent51fca3e13c33cb684cf145c530ff37e9432438f4 (diff)
downloadgcc-9d7f7762ffe4360a55edbe0b16e91775dc2755e0.zip
gcc-9d7f7762ffe4360a55edbe0b16e91775dc2755e0.tar.gz
gcc-9d7f7762ffe4360a55edbe0b16e91775dc2755e0.tar.bz2
arm: [MVE intrinsics] add unary_widen shape
This patch adds the unary_widen shape description. 2022-10-25 Christophe Lyon <christophe.lyon@arm.com> gcc/ * config/arm/arm-mve-builtins-shapes.cc (unary_widen): New. * config/arm/arm-mve-builtins-shapes.h (unary_widen): New.
-rw-r--r--gcc/config/arm/arm-mve-builtins-shapes.cc46
-rw-r--r--gcc/config/arm/arm-mve-builtins-shapes.h1
2 files changed, 47 insertions, 0 deletions
diff --git a/gcc/config/arm/arm-mve-builtins-shapes.cc b/gcc/config/arm/arm-mve-builtins-shapes.cc
index e77a0cc..ae73fc6 100644
--- a/gcc/config/arm/arm-mve-builtins-shapes.cc
+++ b/gcc/config/arm/arm-mve-builtins-shapes.cc
@@ -1236,6 +1236,52 @@ struct unary_n_def : public overloaded_base<0>
};
SHAPE (unary_n)
+/* <T0:twice>_t vfoo[_t0](<T0>_t)
+
+ i.e. a version of "unary" in which the source elements are half the
+ size of the destination, but have the same type class.
+
+ Example: vmovlbq.
+ int32x4_t [__arm_]vmovlbq[_s16](int16x8_t a)
+ int32x4_t [__arm_]vmovlbq_m[_s16](int32x4_t inactive, int16x8_t a, mve_pred16_t p)
+ int32x4_t [__arm_]vmovlbq_x[_s16](int16x8_t a, mve_pred16_t p) */
+struct unary_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", group, MODE_none, preserve_user_namespace);
+ }
+
+ tree
+ resolve (function_resolver &r) const override
+ {
+ unsigned int i, nargs;
+ type_suffix_index type;
+ tree res;
+ if (!r.check_gp_argument (1, i, nargs)
+ || (type = r.infer_vector_type (i)) == 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);
+
+ /* 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);
+
+ if ((res = r.lookup_form (r.mode_suffix_id, type)))
+ return res;
+
+ return r.report_no_such_form (type);
+ }
+};
+SHAPE (unary_widen)
+
} /* 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 c062fe6..5a8d9fe 100644
--- a/gcc/config/arm/arm-mve-builtins-shapes.h
+++ b/gcc/config/arm/arm-mve-builtins-shapes.h
@@ -58,6 +58,7 @@ namespace arm_mve
extern const function_shape *const unary_int32;
extern const function_shape *const unary_int32_acc;
extern const function_shape *const unary_n;
+ extern const function_shape *const unary_widen;
} /* end namespace arm_mve::shapes */
} /* end namespace arm_mve */