aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@arm.com>2023-02-21 10:55:29 +0000
committerChristophe Lyon <christophe.lyon@arm.com>2023-05-11 10:25:10 +0200
commitacf9741c530bc17057775da26c12efacfcda1ba6 (patch)
tree620e57374d6d4e551103a1a775ee5da5682105fa
parentfc468102c56c37a8a80d17fb07db12e5973d80f1 (diff)
downloadgcc-acf9741c530bc17057775da26c12efacfcda1ba6.zip
gcc-acf9741c530bc17057775da26c12efacfcda1ba6.tar.gz
gcc-acf9741c530bc17057775da26c12efacfcda1ba6.tar.bz2
arm: [MVE intrinsics] add unary_n shape
This patch adds the unary_n shape description. 2022-10-25 Christophe Lyon <christophe.lyon@arm.com> gcc/ * config/arm/arm-mve-builtins-shapes.cc (unary_n): New. * config/arm/arm-mve-builtins-shapes.h (unary_n): New.
-rw-r--r--gcc/config/arm/arm-mve-builtins-shapes.cc53
-rw-r--r--gcc/config/arm/arm-mve-builtins-shapes.h1
2 files changed, 54 insertions, 0 deletions
diff --git a/gcc/config/arm/arm-mve-builtins-shapes.cc b/gcc/config/arm/arm-mve-builtins-shapes.cc
index ea0112b..c78683a 100644
--- a/gcc/config/arm/arm-mve-builtins-shapes.cc
+++ b/gcc/config/arm/arm-mve-builtins-shapes.cc
@@ -1094,6 +1094,59 @@ struct unary_convert_def : public overloaded_base<1>
};
SHAPE (unary_convert)
+/* <T0>_t vfoo[_n]_t0(<S0>_t)
+
+ Example: vdupq.
+ int16x8_t [__arm_]vdupq_n_s16(int16_t a)
+ int16x8_t [__arm_]vdupq_m[_n_s16](int16x8_t inactive, int16_t a, mve_pred16_t p)
+ int16x8_t [__arm_]vdupq_x_n_s16(int16_t a, mve_pred16_t p) */
+struct unary_n_def : public overloaded_base<0>
+{
+ bool
+ explicit_type_suffix_p (unsigned int, enum predication_index pred,
+ enum mode_suffix_index) const override
+ {
+ return pred != PRED_m;
+ }
+
+ bool
+ explicit_mode_suffix_p (enum predication_index pred,
+ enum mode_suffix_index mode) const override
+ {
+ return ((mode == MODE_n)
+ && (pred != PRED_m));
+ }
+
+ bool
+ skip_overload_p (enum predication_index pred, enum mode_suffix_index mode)
+ const override
+ {
+ switch (mode)
+ {
+ case MODE_n:
+ return pred != PRED_m;
+
+ default:
+ gcc_unreachable ();
+ }
+ }
+
+ void
+ build (function_builder &b, const function_group_info &group,
+ bool preserve_user_namespace) const override
+ {
+ b.add_overloaded_functions (group, MODE_n, preserve_user_namespace);
+ build_all (b, "v0,s0", group, MODE_n, preserve_user_namespace);
+ }
+
+ tree
+ resolve (function_resolver &r) const override
+ {
+ return r.resolve_unary_n ();
+ }
+};
+SHAPE (unary_n)
+
} /* 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 59c4dc3..a35faec 100644
--- a/gcc/config/arm/arm-mve-builtins-shapes.h
+++ b/gcc/config/arm/arm-mve-builtins-shapes.h
@@ -54,6 +54,7 @@ namespace arm_mve
extern const function_shape *const inherent;
extern const function_shape *const unary;
extern const function_shape *const unary_convert;
+ extern const function_shape *const unary_n;
} /* end namespace arm_mve::shapes */
} /* end namespace arm_mve */