/* Generate the machine mode enumeration and associated tables.
- Copyright (C) 2003, 2004, 2005, 2006, 2007
+ Copyright (C) 2003, 2004, 2005, 2006, 2007, 2010
Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
+Software Foundation; either version 3, or (at your option) any later
version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
for more details.
You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING. If not, write to the Free
-Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301, USA. */
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
#include "bconfig.h"
#include "system.h"
struct mode_data *component; /* mode of components */
struct mode_data *wider; /* next wider mode */
- struct mode_data *wider_2x; /* 2x wider mode */
struct mode_data *contained; /* Pointer to list of modes that have
this mode as a component. */
static const struct mode_data blank_mode = {
0, "<unknown>", MAX_MODE_CLASS,
-1U, -1U, -1U, -1U,
- 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0,
"<unknown>", 0, 0, 0, 0
};
n_modes[cl]++;
*htab_find_slot (modes_by_name, m, INSERT) = m;
-
+
return m;
}
mode_class_names[required_class_to] + 5);
return;
}
-
+
for (a = *category; a; a = a->next)
if (a->mode == mode)
{
static int
cmp_modes (const void *a, const void *b)
{
- struct mode_data *m = *(struct mode_data **)a;
- struct mode_data *n = *(struct mode_data **)b;
+ const struct mode_data *const m = *(const struct mode_data *const*)a;
+ const struct mode_data *const n = *(const struct mode_data *const*)b;
if (m->bytesize > n->bytesize)
return 1;
/* Allocate max_n_modes + 1 entries to leave room for the extra null
pointer assigned after the qsort call below. */
- sortbuf = (struct mode_data **) alloca ((max_n_modes + 1) * sizeof (struct mode_data *));
+ sortbuf = XALLOCAVEC (struct mode_data *, max_n_modes + 1);
for (c = 0; c < MAX_MODE_CLASS; c++)
{
for (prev = 0, m = modes[c]; m; m = next)
{
m->wider = void_mode;
- m->wider_2x = void_mode;
/* this is nreverse */
next = m->next;
for (j = 0; j < i; j++)
sortbuf[j]->next = sortbuf[j]->wider = sortbuf[j + 1];
-
modes[c] = sortbuf[0];
}
}
continue;
}
+ /* For vectors we want twice the number of components,
+ with the same element type. */
+ if (m->cl == MODE_VECTOR_INT
+ || m->cl == MODE_VECTOR_FLOAT
+ || m->cl == MODE_VECTOR_FRACT
+ || m->cl == MODE_VECTOR_UFRACT
+ || m->cl == MODE_VECTOR_ACCUM
+ || m->cl == MODE_VECTOR_UACCUM)
+ {
+ if (m2->ncomponents != 2 * m->ncomponents)
+ continue;
+ if (m->component != m2->component)
+ continue;
+ }
+
break;
}
if (m2 == void_mode)
? modes[c]->next->name
: void_mode->name))
: void_mode->name);
-
+
print_closer ();
}
or not the table itself is constant.
For backward compatibility this table is always writable
- (several targets modify it in OVERRIDE_OPTIONS). FIXME:
+ (several targets modify it in TARGET_OPTION_OVERRIDE). FIXME:
convert all said targets to use ADJUST_FORMAT instead. */
#if 0
print_maybe_const_decl ("const struct real_format *%s",
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",
if (have_error)
return FATAL_EXIT_CODE;
-
+
calc_wider_mode ();
if (gen_header)