/* Generate the machine mode enumeration and associated tables.
- Copyright (C) 2003
+ Copyright (C) 2003, 2004
Free Software Foundation, Inc.
This file is part of GCC.
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, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA. */
#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
};
break;
default:
- abort ();
+ gcc_unreachable ();
}
/* If not already specified, the mode alignment defaults to the largest
ncomponents, base) >= sizeof namebuf)
{
error ("%s:%d: mode name \"%s\" is too long",
- base, file, line);
+ file, line, base);
return;
}
for (prev = 0, m = modes[c]; m; m = next)
{
m->wider = void_mode;
+ m->wider_2x = void_mode;
/* this is nreverse */
next = m->next;
m->name);
print_closer ();
+ print_decl ("unsigned char", "mode_2xwider", "NUM_MACHINE_MODES");
+
+ for_all_modes (c, m)
+ {
+ struct mode_data * m2;
+
+ for (m2 = m;
+ m2 && m2 != void_mode;
+ m2 = m2->wider)
+ {
+ if (m2->bytesize < 2 * m->bytesize)
+ continue;
+ if (m->precision != (unsigned int) -1)
+ {
+ if (m2->precision != 2 * m->precision)
+ continue;
+ }
+ else
+ {
+ if (m2->precision != (unsigned int) -1)
+ continue;
+ }
+
+ break;
+ }
+ if (m2 == void_mode)
+ m2 = 0;
+ tagged_printf ("%smode",
+ m2 ? m2->name : void_mode->name,
+ m->name);
+ }
+
+ print_closer ();
}
static void