]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
arc.h (BITS_PER_UNIT): Removed.
authorKenneth Zadeck <zadeck@naturalbridge.com>
Fri, 13 Dec 2013 16:38:53 +0000 (16:38 +0000)
committerKenneth Zadeck <zadeck@gcc.gnu.org>
Fri, 13 Dec 2013 16:38:53 +0000 (16:38 +0000)
2013-12-13  Kenneth Zadeck  <zadeck@naturalbridge.com>

* 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.

From-SVN: r205964

15 files changed:
gcc/ChangeLog
gcc/config/arc/arc.h
gcc/config/bfin/bfin.h
gcc/config/i386/i386-modes.def
gcc/config/lm32/lm32.h
gcc/config/m32c/m32c.h
gcc/config/microblaze/microblaze.h
gcc/config/picochip/picochip.h
gcc/config/spu/spu.h
gcc/defaults.h
gcc/doc/rtl.texi
gcc/doc/tm.texi
gcc/doc/tm.texi.in
gcc/genmodes.c
gcc/mkconfig.sh

index 3ee682bbe231dbc71f0a71beb075546affd3b3cd..a238cac62a66877762ec08a06ea627c5c39ae09a 100644 (file)
@@ -1,3 +1,24 @@
+2013-12-13  Kenneth Zadeck  <zadeck@naturalbridge.com>
+
+       * 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.
+
 2013-12-13  Jeff Law  <law@redhat.com>
 
        PR tree-optimization/45685
index cc49c553c55dc17f198c29bd671665fd6c9f2a45..88102f0a532de18ef82ddae287a074f8b497eac7 100644 (file)
@@ -303,9 +303,6 @@ along with GCC; see the file COPYING3.  If not see
    numbered.  */
 #define WORDS_BIG_ENDIAN (TARGET_BIG_ENDIAN)
 
-/* Number of bits in an addressable storage unit.  */
-#define BITS_PER_UNIT 8
-
 /* Width in bits of a "word", which is the contents of a machine register.
    Note that this is not necessarily the width of data type `int';
    if using 16-bit ints on a 68000, this would still be 32.
index cc175062ebc0e42b7035a940bcd468ee106127d5..85ab0b0f5b8baf4db33ec9b387a774486b521bf6 100644 (file)
@@ -859,9 +859,6 @@ typedef struct {
 /* Define this if most significant word of a multiword number is numbered. */
 #define WORDS_BIG_ENDIAN 0
 
-/* number of bits in an addressable storage unit */
-#define BITS_PER_UNIT 8
-
 /* Width in bits of a "word", which is the contents of a machine register.
    Note that this is not necessarily the width of data type `int';
    if using 16-bit ints on a 68000, this would still be 32.
index e0b8fc826abce73d87a4bcb8845357e7a7d2bf4e..57d08fb1b687d3d87630339a1687e424b63ef974 100644 (file)
@@ -90,5 +90,10 @@ VECTOR_MODE (INT, QI, 2);     /*                   V2QI */
 INT_MODE (OI, 32);
 INT_MODE (XI, 64);
 
+/* Keep the OI and XI modes from confusing the compiler into thinking
+   that these modes could actually be used for computation.  They are
+   only holders for vectors during data movement.  */
+#define MAX_BITSIZE_MODE_ANY_INT (128)
+
 /* The symbol Pmode stands for one of the above machine modes (usually SImode).
    The tm.h file specifies which one.  It is not a distinct mode.  */
index d19adea8822469ac079b95b794c9e8574ce0df91..edb96b7b0b2c67458db3b16fc98ba9cd2f6485d4 100644 (file)
@@ -73,7 +73,6 @@
 #define BYTES_BIG_ENDIAN 1
 #define WORDS_BIG_ENDIAN 1
 
-#define BITS_PER_UNIT 8
 #define BITS_PER_WORD 32
 #define UNITS_PER_WORD 4
 
index 3ceb093f7d9cf241d83899b57b4379cbc5827af6..b7b5aa4692419ddc8b29c3fd1b44b0b5b8ea4dbf 100644 (file)
@@ -140,7 +140,6 @@ machine_function;
    matches "int".  Pointers are 16 bits for R8C/M16C (when TARGET_A16
    is true) and 24 bits for M32CM/M32C (when TARGET_A24 is true), but
    24-bit pointers are stored in 32-bit words.  */
-#define BITS_PER_UNIT 8
 #define UNITS_PER_WORD 2
 #define POINTER_SIZE (TARGET_A16 ? 16 : 32)
 #define POINTERS_EXTEND_UNSIGNED 1
index eb8e45ce17be1cdafce2f5beb4afbd047b3ed00c..dcca4ac9f5f11815ed85fd0bfd873dd4c4af615b 100644 (file)
@@ -193,7 +193,6 @@ extern enum pipeline_type microblaze_pipe;
 #define BITS_BIG_ENDIAN 0
 #define BYTES_BIG_ENDIAN (TARGET_LITTLE_ENDIAN == 0)
 #define WORDS_BIG_ENDIAN (BYTES_BIG_ENDIAN)
-#define BITS_PER_UNIT           8
 #define BITS_PER_WORD           32
 #define UNITS_PER_WORD          4
 #define MIN_UNITS_PER_WORD      4
index 13414c6cc9c1dd8046fcf8fa4cb916fb84391b1c..3621f3d1b1c9c912298ca609c9f4ace45bf35133 100644 (file)
@@ -92,8 +92,6 @@ extern enum picochip_dfa_type picochip_schedule_type;
 #define BYTES_BIG_ENDIAN 0
 #define WORDS_BIG_ENDIAN 0
 
-#define BITS_PER_UNIT 8
-
 #define BITS_PER_WORD 16
 #define UNITS_PER_WORD (BITS_PER_WORD / BITS_PER_UNIT)
 
index 64a2ba06b22832c693c1b5efd917fa9f17467e37..ad4405ae3d9e70a3c23185dff54e6db8cbd88b3d 100644 (file)
@@ -54,8 +54,6 @@ extern GTY(()) int spu_tune;
 
 #define WORDS_BIG_ENDIAN 1
 
-#define BITS_PER_UNIT 8
-
 /* GCC uses word_mode in many places, assuming that it is the fastest
    integer mode.  That is not the case for SPU though.  We can't use
    32 here because (of some reason I can't remember.) */
index 37e8a08ac5af32b5d22e64d53dcb8e940b0de483..1d12aef801d358de9bfd0e0f21ded086440bcf78 100644 (file)
@@ -471,10 +471,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
    your target, you should override these values by defining the
    appropriate symbols in your tm.h file.  */
 
-#ifndef BITS_PER_UNIT
-#define BITS_PER_UNIT 8
-#endif
-
 #ifndef BITS_PER_WORD
 #define BITS_PER_WORD (BITS_PER_UNIT * UNITS_PER_WORD)
 #endif
index 84c0444ad9c44f49ca00557e0352152fb7272ded..15290f23fba4367b45eabb5b6160920b9f408daf 100644 (file)
@@ -1462,14 +1462,25 @@ Returns the number of units contained in a mode, i.e.,
 Returns the narrowest mode in mode class @var{c}.
 @end table
 
-The following 4 variables are defined on every target.   They can be
+The following 3 variables are defined on every target.   They can be
 used to allocate buffers that are guaranteed to be large enough to
-hold any value that can be represented on the target.   
+hold any value that can be represented on the target.   The first two
+can be overridden by defining them in the target's mode.def file,
+however, the value must be a constant that can determined very early
+in the compilation process.   The third symbol cannot be overridden.
 
 @table @code
+@findex BITS_PER_UNIT
+@item BITS_PER_UNIT
+The number of bits in an addressable storage unit (byte).  If you do
+not define this, the default is 8.
+
 @findex MAX_BITSIZE_MODE_ANY_INT
 @item MAX_BITSIZE_MODE_ANY_INT
-The maximum of MAX_BITSIZE_MODE_INT and MAX_BITSIZE_MODE_PARTIAL_INT.
+The maximum bitsize of any mode that is used in integer math.  This
+should be overridden by the target if it uses large integers as
+containers for larger vectors but otherwise never uses the contents to
+compute integer values.
 
 @findex MAX_BITSIZE_MODE_ANY_MODE
 @item MAX_BITSIZE_MODE_ANY_MODE
index c4ecd998ddb61ccf66fa65d5d2f77160f2e3c3e4..8abb3effff46e75a8b3bfc386919e654268c4b5f 100644 (file)
@@ -879,11 +879,6 @@ You need not define this macro if the ordering is the same as for
 multi-word integers.
 @end defmac
 
-@defmac BITS_PER_UNIT
-Define this macro to be the number of bits in an addressable storage
-unit (byte).  If you do not define this macro the default is 8.
-@end defmac
-
 @defmac BITS_PER_WORD
 Number of bits in a word.  If you do not define this macro, the default
 is @code{BITS_PER_UNIT * UNITS_PER_WORD}.
index 7e459ebd087d37dc0e46eb328058e37d6b160627..deedb41d3b243cbba28a76f8913acb2f51fd5e1f 100644 (file)
@@ -853,11 +853,6 @@ You need not define this macro if the ordering is the same as for
 multi-word integers.
 @end defmac
 
-@defmac BITS_PER_UNIT
-Define this macro to be the number of bits in an addressable storage
-unit (byte).  If you do not define this macro the default is 8.
-@end defmac
-
 @defmac BITS_PER_WORD
 Number of bits in a word.  If you do not define this macro, the default
 is @code{BITS_PER_UNIT * UNITS_PER_WORD}.
index 3c1ce0e9301a87fe1f8653f0f99ed5149d1845c3..641623d385e4220e4ec6d5d8e2a9a52e6f0798c4 100644 (file)
@@ -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++)
index 29fdfc7a294d0e493e1cf2e06766651edb285e30..a5b116d4483dc601e49ecc5f12ced05257f12529 100644 (file)
@@ -97,6 +97,9 @@ case $output in
 #if defined IN_GCC && !defined GENERATOR_FILE && !defined USED_FOR_TARGET
 # include "insn-flags.h"
 #endif
+#if defined IN_GCC && !defined GENERATOR_FILE
+# include "insn-modes.h"
+#endif
 EOF
     ;;
 esac