aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@linaro.org>2023-08-14 13:06:20 +0000
committerChristophe Lyon <christophe.lyon@linaro.org>2023-08-28 08:59:51 +0000
commit910249f9b1045ce985fd580f2feb438f070a194f (patch)
treeef294dcac086cf9e81e633965f5f27f0ca8d888d /gcc
parentb06a80057334d29f3f316ad483e3a6cfd7df2484 (diff)
downloadgcc-910249f9b1045ce985fd580f2feb438f070a194f.zip
gcc-910249f9b1045ce985fd580f2feb438f070a194f.tar.gz
gcc-910249f9b1045ce985fd580f2feb438f070a194f.tar.bz2
arm: [MVE intrinsics] add unspec_mve_function_exact_insn_vmull_poly
Introduce a function that will be used to build vmull[bt]q_poly intrinsics that use poly types. 2023-08-14 Christophe Lyon <christophe.lyon@linaro.org> gcc/ * config/arm/arm-mve-builtins-functions.h (class unspec_mve_function_exact_insn_vmull_poly): New.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/arm/arm-mve-builtins-functions.h56
1 files changed, 55 insertions, 1 deletions
diff --git a/gcc/config/arm/arm-mve-builtins-functions.h b/gcc/config/arm/arm-mve-builtins-functions.h
index c0fc450..eba1f07 100644
--- a/gcc/config/arm/arm-mve-builtins-functions.h
+++ b/gcc/config/arm/arm-mve-builtins-functions.h
@@ -838,7 +838,6 @@ public:
}
};
-
/* Map the vmull-related function directly to CODE (UNSPEC, UNSPEC, M)
where M is the vector mode associated with type suffix 0. We need
this special case because the builtins have _int in their
@@ -912,6 +911,61 @@ public:
}
};
+/* Map the vmull_poly-related function directly to CODE (UNSPEC,
+ UNSPEC, M) where M is the vector mode associated with type suffix
+ 0. We need this special case because the builtins have _poly in
+ their names, and use the special poly type.. */
+class unspec_mve_function_exact_insn_vmull_poly : public function_base
+{
+public:
+ CONSTEXPR unspec_mve_function_exact_insn_vmull_poly (int unspec_for_poly,
+ int unspec_for_m_poly)
+ : m_unspec_for_poly (unspec_for_poly),
+ m_unspec_for_m_poly (unspec_for_m_poly)
+ {}
+
+ /* The unspec code associated with signed-integer, unsigned-integer
+ and poly operations respectively. It covers the cases with and
+ without the _m predicate. */
+ int m_unspec_for_poly;
+ int m_unspec_for_m_poly;
+
+ rtx
+ expand (function_expander &e) const override
+ {
+ insn_code code;
+
+ if (e.mode_suffix_id != MODE_none)
+ gcc_unreachable ();
+
+ if (! e.type_suffix (0).poly_p)
+ gcc_unreachable ();
+
+ switch (e.pred)
+ {
+ case PRED_none:
+ /* No predicate, no suffix. */
+ code = code_for_mve_q_poly (m_unspec_for_poly, m_unspec_for_poly, e.vector_mode (0));
+ return e.use_exact_insn (code);
+
+ case PRED_m:
+ /* No suffix, "m" predicate. */
+ code = code_for_mve_q_poly_m (m_unspec_for_m_poly, m_unspec_for_m_poly, e.vector_mode (0));
+ return e.use_cond_insn (code, 0);
+
+ case PRED_x:
+ /* No suffix, "x" predicate. */
+ code = code_for_mve_q_poly_m (m_unspec_for_m_poly, m_unspec_for_m_poly, e.vector_mode (0));
+ return e.use_pred_x_insn (code);
+
+ default:
+ gcc_unreachable ();
+ }
+
+ gcc_unreachable ();
+ }
+};
+
} /* end namespace arm_mve */
/* Declare the global function base NAME, creating it from an instance