summaryrefslogtreecommitdiff
path: root/gcc/genmodes.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2018-01-03 21:43:17 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2018-01-03 21:43:17 +0000
commit6ce12f6a1647ec2831f3c5908ecf9c23ae191d02 (patch)
tree8c22889b700a21e7d4fe8da29c0d38b16c371d2c /gcc/genmodes.c
parent5c0caeb37ff72cfd9153e164e9fd9eec7d56e969 (diff)
Allow targets to pick a vector prefix other than "V"
Originally the SVE port used the names for 256-bit vectors, as the next available increment after Advanced SIMD. However, that was always a bit of a hack and is bound to confuse people new to the code. Nothing actually requires vector modes to have names of the form V<nunits><mode>, and after talking it over with the AArch64 maintainers, we agreed to switch to things like: VNx16QI instead. This patch lets targets pick this kind of prefix. 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org> gcc/ * machmode.def (VECTOR_MODES_WITH_PREFIX): Document. * genmodes.c (VECTOR_MODES_WITH_PREFIX): New macro. (VECTOR_MODES): Use it. (make_vector_modes): Take the prefix as an argument. From-SVN: r256203
Diffstat (limited to 'gcc/genmodes.c')
-rw-r--r--gcc/genmodes.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/genmodes.c b/gcc/genmodes.c
index 9e37d65997e..7d58865ca96 100644
--- a/gcc/genmodes.c
+++ b/gcc/genmodes.c
@@ -483,9 +483,11 @@ make_complex_modes (enum mode_class cl,
/* For all modes in class CL, construct vector modes of width
WIDTH, having as many components as necessary. */
-#define VECTOR_MODES(C, W) make_vector_modes (MODE_##C, W, __FILE__, __LINE__)
+#define VECTOR_MODES_WITH_PREFIX(PREFIX, C, W) \
+ make_vector_modes (MODE_##C, #PREFIX, W, __FILE__, __LINE__)
+#define VECTOR_MODES(C, W) VECTOR_MODES_WITH_PREFIX (V, C, W)
static void ATTRIBUTE_UNUSED
-make_vector_modes (enum mode_class cl, unsigned int width,
+make_vector_modes (enum mode_class cl, const char *prefix, unsigned int width,
const char *file, unsigned int line)
{
struct mode_data *m;
@@ -516,8 +518,8 @@ make_vector_modes (enum mode_class cl, unsigned int width,
if (cl == MODE_INT && m->precision == 1)
continue;
- if ((size_t)snprintf (buf, sizeof buf, "V%u%s", ncomponents, m->name)
- >= sizeof buf)
+ if ((size_t) snprintf (buf, sizeof buf, "%s%u%s", prefix,
+ ncomponents, m->name) >= sizeof buf)
{
error ("%s:%d: mode name \"%s\" is too long",
m->file, m->line, m->name);