summaryrefslogtreecommitdiff
path: root/gcc/genmodes.c
diff options
context:
space:
mode:
authorzadeck <zadeck@138bc75d-0d04-0410-961f-82ee72b054a4>2013-03-28 14:46:31 +0000
committerzadeck <zadeck@138bc75d-0d04-0410-961f-82ee72b054a4>2013-03-28 14:46:31 +0000
commitf9cb58ae23d7c5354c9cf4101343fbd7e2560a59 (patch)
tree2a5527a5207957c4911401b0159d8b32ff08f528 /gcc/genmodes.c
parent64a8b20406de148a89771462eb135cf909a39ec4 (diff)
downloadgcc-f9cb58ae23d7c5354c9cf4101343fbd7e2560a59.tar.gz
2013-03-28 Kenneth Zadeck <zadeck@naturalbridge.com>
* genmodes.c (emit_max_int): New function. (emit_insn_modes_h): Added call to emit_max_function. * doc/rtl.texi (MAX_BITSIZE_MODE_ANY_INT, MAX_BITSIZE_MODE_ANY_MODE): Added doc. * machmode.def: Fixed comment. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@197200 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/genmodes.c')
-rw-r--r--gcc/genmodes.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/genmodes.c b/gcc/genmodes.c
index 9907d699761..dc384833871 100644
--- a/gcc/genmodes.c
+++ b/gcc/genmodes.c
@@ -848,6 +848,36 @@ calc_wider_mode (void)
#define print_closer() puts ("};")
+/* Compute the max bitsize of some of the classes of integers. It may
+ be that there are needs for the other integer classes, and this
+ code is easy to extend. */
+static void
+emit_max_int (void)
+{
+ unsigned int max, mmax;
+ struct mode_data *i;
+ int j;
+
+ puts ("");
+ for (max = 1, i = modes[MODE_INT]; i; i = i->next)
+ if (max < i->bytesize)
+ max = i->bytesize;
+ mmax = max;
+ for (max = 1, i = modes[MODE_PARTIAL_INT]; i; i = i->next)
+ if (max < i->bytesize)
+ max = i->bytesize;
+ if (max > mmax)
+ mmax = max;
+ printf ("#define MAX_BITSIZE_MODE_ANY_INT %d*BITS_PER_UNIT\n", mmax);
+
+ 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);
+}
+
static void
emit_insn_modes_h (void)
{
@@ -912,6 +942,7 @@ enum machine_mode\n{");
#endif
printf ("#define CONST_MODE_IBIT%s\n", adj_ibit ? "" : " const");
printf ("#define CONST_MODE_FBIT%s\n", adj_fbit ? "" : " const");
+ emit_max_int ();
puts ("\
\n\
#endif /* insn-modes.h */");