+ /* The end of the table is entries for decimal float modes. */
+ for (m = modes[MODE_DECIMAL_FLOAT]; m; m = m->next)
+ if (!strcmp (m->format, "0"))
+ tagged_printf ("%s", m->format, m->name);
+ else
+ tagged_printf ("&%s", m->format, m->name);
+
+ print_closer ();
+}
+
+static void
+emit_mode_adjustments (void)
+{
+ struct mode_adjust *a;
+ struct mode_data *m;
+
+ puts ("\
+\nvoid\
+\ninit_adjust_machine_modes (void)\
+\n{\
+\n size_t s ATTRIBUTE_UNUSED;");
+
+ /* Size adjustments must be propagated to all containing modes.
+ A size adjustment forces us to recalculate the alignment too. */
+ for (a = adj_bytesize; a; a = a->next)
+ {
+ printf ("\n /* %s:%d */\n s = %s;\n",
+ a->file, a->line, a->adjustment);
+ printf (" mode_size[%smode] = s;\n", a->mode->name);
+ printf (" mode_base_align[%smode] = s & (~s + 1);\n",
+ a->mode->name);
+
+ for (m = a->mode->contained; m; m = m->next_cont)
+ {
+ switch (m->cl)
+ {
+ case MODE_COMPLEX_INT:
+ case MODE_COMPLEX_FLOAT:
+ printf (" mode_size[%smode] = 2*s;\n", m->name);
+ printf (" mode_base_align[%smode] = s & (~s + 1);\n",
+ m->name);
+ break;
+
+ case MODE_VECTOR_INT:
+ case MODE_VECTOR_FLOAT:
+ case MODE_VECTOR_FRACT:
+ case MODE_VECTOR_UFRACT:
+ case MODE_VECTOR_ACCUM:
+ case MODE_VECTOR_UACCUM:
+ printf (" mode_size[%smode] = %d*s;\n",
+ m->name, m->ncomponents);
+ printf (" mode_base_align[%smode] = (%d*s) & (~(%d*s)+1);\n",
+ m->name, m->ncomponents, m->ncomponents);
+ break;
+
+ default:
+ internal_error (
+ "mode %s is neither vector nor complex but contains %s",
+ m->name, a->mode->name);
+ /* NOTREACHED */
+ }
+ }
+ }
+
+ /* Alignment adjustments propagate too.
+ ??? This may not be the right thing for vector modes. */
+ for (a = adj_alignment; a; a = a->next)
+ {
+ printf ("\n /* %s:%d */\n s = %s;\n",
+ a->file, a->line, a->adjustment);
+ printf (" mode_base_align[%smode] = s;\n", a->mode->name);
+
+ for (m = a->mode->contained; m; m = m->next_cont)
+ {
+ switch (m->cl)
+ {
+ case MODE_COMPLEX_INT:
+ case MODE_COMPLEX_FLOAT:
+ printf (" mode_base_align[%smode] = s;\n", m->name);
+ break;
+
+ case MODE_VECTOR_INT:
+ case MODE_VECTOR_FLOAT:
+ case MODE_VECTOR_FRACT:
+ case MODE_VECTOR_UFRACT:
+ case MODE_VECTOR_ACCUM:
+ case MODE_VECTOR_UACCUM:
+ printf (" mode_base_align[%smode] = %d*s;\n",
+ m->name, m->ncomponents);
+ break;
+
+ default:
+ internal_error (
+ "mode %s is neither vector nor complex but contains %s",
+ m->name, a->mode->name);
+ /* NOTREACHED */
+ }
+ }
+ }
+
+ /* Ibit adjustments don't have to propagate. */
+ for (a = adj_ibit; a; a = a->next)
+ {
+ printf ("\n /* %s:%d */\n s = %s;\n",
+ a->file, a->line, a->adjustment);
+ printf (" mode_ibit[%smode] = s;\n", a->mode->name);
+ }
+
+ /* Fbit adjustments don't have to propagate. */
+ for (a = adj_fbit; a; a = a->next)
+ {
+ printf ("\n /* %s:%d */\n s = %s;\n",
+ a->file, a->line, a->adjustment);
+ printf (" mode_fbit[%smode] = s;\n", a->mode->name);
+ }
+
+ /* Real mode formats don't have to propagate anywhere. */
+ for (a = adj_format; a; a = a->next)
+ printf ("\n /* %s:%d */\n REAL_MODE_FORMAT (%smode) = %s;\n",
+ a->file, a->line, a->mode->name, a->adjustment);
+
+ puts ("}");
+}
+
+/* Emit ibit for all modes. */
+
+static void
+emit_mode_ibit (void)
+{
+ int c;
+ struct mode_data *m;
+
+ print_maybe_const_decl ("%sunsigned char",
+ "mode_ibit", "NUM_MACHINE_MODES",
+ ibit);
+
+ for_all_modes (c, m)
+ tagged_printf ("%u", m->ibit, m->name);
+