From 2cb32abfe954730c551311869f25683b6479c089 Mon Sep 17 00:00:00 2001 From: zadeck Date: Fri, 13 Dec 2013 16:38:53 +0000 Subject: 2013-12-13 Kenneth Zadeck * config/arc/arc.h (BITS_PER_UNIT): Removed. * config/bfin/bfin.h (BITS_PER_UNIT): Removed. * config/lm32/lm32.h (BITS_PER_UNIT): Removed. * config/m32c/m32c.h (BITS_PER_UNIT): Removed. * config/microblaze/microblaze.h (BITS_PER_UNIT): Removed. * config/picochip/picochip.h (BITS_PER_UNIT): Removed. * config/spu/spu.h (BITS_PER_UNIT): Removed. * defaults.h (BITS_PER_UNIT): Removed. * config/i386/i386-modes.def (MAX_BITSIZE_MODE_ANY_INT): New. * doc/rtl (BITS_PER_UNIT): Moved from tm.texi. (MAX_BITSIZE_MODE_ANY_INT): Updated. * doc/tm.texi (BITS_PER_UNIT): Removed. * doc/tm.texi.in (BITS_PER_UNIT): Removed. * genmodes.c (bits_per_unit, max_bitsize_mode_any_int): New. (create_modes): Added code to set bits_per_unit and max_bitsize_mode_any_int. (emit_max_int): Changed code generation. * mkconfig.sh: Added insn-modes.h. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@205964 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/genmodes.c | 45 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 35 insertions(+), 10 deletions(-) (limited to 'gcc/genmodes.c') diff --git a/gcc/genmodes.c b/gcc/genmodes.c index 3c1ce0e9301..641623d385e 100644 --- a/gcc/genmodes.c +++ b/gcc/genmodes.c @@ -711,10 +711,27 @@ make_vector_mode (enum mode_class bclass, #define ADJUST_IBIT(M, X) _ADD_ADJUST (ibit, M, X, ACCUM, UACCUM) #define ADJUST_FBIT(M, X) _ADD_ADJUST (fbit, M, X, FRACT, UACCUM) +static int bits_per_unit; +static int max_bitsize_mode_any_int; + static void create_modes (void) { #include "machmode.def" + + /* So put the default value unless the target needs a non standard + value. */ +#ifdef BITS_PER_UNIT + bits_per_unit = BITS_PER_UNIT; +#else + bits_per_unit = 8; +#endif + +#ifdef MAX_BITSIZE_MODE_ANY_INT + max_bitsize_mode_any_int = MAX_BITSIZE_MODE_ANY_INT; +#else + max_bitsize_mode_any_int = 0; +#endif } /* Processing. */ @@ -860,16 +877,24 @@ emit_max_int (void) 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); + + printf ("#define BITS_PER_UNIT (%d)\n", bits_per_unit); + + if (max_bitsize_mode_any_int == 0) + { + 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); + } + 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++) -- cgit v1.2.1