+2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
+
+ * doc/rtl.texi (MAX_BITSIZE_MODE_ANY_MODE): Describe how the default
+ is calculated and how it can be overridden.
+ * genmodes.c (max_bitsize_mode_any_mode): New variable.
+ (create_modes): Initialize it from MAX_BITSIZE_MODE_ANY_MODE,
+ if defined.
+ (emit_max_int): Use it to set the output MAX_BITSIZE_MODE_ANY_MODE,
+ if nonzero.
+
2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
@findex MAX_BITSIZE_MODE_ANY_MODE
@item MAX_BITSIZE_MODE_ANY_MODE
-The bitsize of the largest mode on the target.
+The bitsize of the largest mode on the target. The default value is
+the largest mode size given in the mode definition file, which is
+always correct for targets whose modes have a fixed size. Targets
+that might increase the size of a mode beyond this default should define
+@code{MAX_BITSIZE_MODE_ANY_MODE} to the actual upper limit in
+@file{@var{machine}-modes.def}.
@end table
@findex byte_mode
static int bits_per_unit;
static int max_bitsize_mode_any_int;
+static int max_bitsize_mode_any_mode;
static void
create_modes (void)
#else
max_bitsize_mode_any_int = 0;
#endif
+
+#ifdef MAX_BITSIZE_MODE_ANY_MODE
+ max_bitsize_mode_any_mode = MAX_BITSIZE_MODE_ANY_MODE;
+#else
+ max_bitsize_mode_any_mode = 0;
+#endif
}
#ifndef NUM_POLY_INT_COEFFS
else
printf ("#define MAX_BITSIZE_MODE_ANY_INT %d\n", max_bitsize_mode_any_int);
- mmax = 0;
- for (j = 0; j < MAX_MODE_CLASS; j++)
- for (i = modes[j]; i; i = i->next)
- if (mmax < i->bytesize)
- mmax = i->bytesize;
- printf ("#define MAX_BITSIZE_MODE_ANY_MODE (%d*BITS_PER_UNIT)\n", mmax);
+ if (max_bitsize_mode_any_mode == 0)
+ {
+ mmax = 0;
+ for (j = 0; j < MAX_MODE_CLASS; j++)
+ for (i = modes[j]; i; i = i->next)
+ if (mmax < i->bytesize)
+ mmax = i->bytesize;
+ printf ("#define MAX_BITSIZE_MODE_ANY_MODE (%d*BITS_PER_UNIT)\n", mmax);
+ }
+ else
+ printf ("#define MAX_BITSIZE_MODE_ANY_MODE %d\n",
+ max_bitsize_mode_any_mode);
}
/* Emit mode_size_inline routine into insn-modes.h header. */