re PR rtl-optimization/13987 (compile time regression while compile fold-const.i)
authorAndrew Pinski <apinski@apple.com>
Tue, 31 Aug 2004 00:29:04 +0000 (00:29 +0000)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Tue, 31 Aug 2004 00:29:04 +0000 (17:29 -0700)
2004-08-30  Andrew Pinski  <apinski@apple.com>

        PR rtl-opt/13987
        * config.host (use_long_long_for_widest_fast_int): New, default is
        off.
        (ia64-*-hpux*): Enable use_long_long_for_widest_fast_int.
        * configure.ac: If use_long_long_for_widest_fast_int, then
        define USE_LONG_LONG_FOR_WIDEST_FAST_INT.
        * configure: Regenerate.
        * config.in: Regenerate.
        * hwint.h (HOST_WIDEST_FAST_INT, HOST_BITS_PER_WIDEST_FAST_INT):
        New: widest integer type supported efficiently in hardware for the
        host.
        * sbitmap.h (SBITMAP_ELT_BITS): Define based on
        HOST_BITS_PER_WIDEST_FAST_INT.
        (SBITMAP_ELT_TYPE): Define based on HOST_WIDEST_FAST_INT.
        * hard-reg-set.h (HARD_REG_ELT_TYPE): Define based on
        HOST_WIDEST_FAST_INT
        instead of HOST_WIDE_INT.
        (HARD_REG_SET_LONGS): Likewise.
        (UHOST_BITS_PER_WIDE_INT): Likewise.
        Change the checks for the fast cases to be based on
        HOST_BITS_PER_WIDES_FAST_INT instead of HOST_BITS_PER_WIDE_INT.

From-SVN: r86816

gcc/ChangeLog
gcc/config.host
gcc/config.in
gcc/configure
gcc/configure.ac
gcc/hard-reg-set.h
gcc/hwint.h
gcc/sbitmap.h

index ce84375fcf1295230c27e264532742f874fcc569..e5c7ac0a3bd8e514f2ef1ce5de6db69e6249c962 100644 (file)
@@ -1,3 +1,27 @@
+2004-08-30  Andrew Pinski  <apinski@apple.com>
+
+       PR rtl-opt/13987
+       * config.host (use_long_long_for_widest_fast_int): New, default is 
+       off.
+       (ia64-*-hpux*): Enable use_long_long_for_widest_fast_int.
+       * configure.ac: If use_long_long_for_widest_fast_int, then
+       define USE_LONG_LONG_FOR_WIDEST_FAST_INT.
+       * configure: Regenerate.
+       * config.in: Regenerate.
+       * hwint.h (HOST_WIDEST_FAST_INT, HOST_BITS_PER_WIDEST_FAST_INT):
+       New: widest integer type supported efficiently in hardware for the
+       host.
+       * sbitmap.h (SBITMAP_ELT_BITS): Define based on
+       HOST_BITS_PER_WIDEST_FAST_INT.
+       (SBITMAP_ELT_TYPE): Define based on HOST_WIDEST_FAST_INT.
+       * hard-reg-set.h (HARD_REG_ELT_TYPE): Define based on 
+       HOST_WIDEST_FAST_INT
+       instead of HOST_WIDE_INT.
+       (HARD_REG_SET_LONGS): Likewise.
+       (UHOST_BITS_PER_WIDE_INT): Likewise.
+       Change the checks for the fast cases to be based on
+       HOST_BITS_PER_WIDES_FAST_INT instead of HOST_BITS_PER_WIDE_INT.
+
 2004-08-30  Steven Bosscher  <stevenb@suse.de>
 
        * cfgcleanup.c (merge_memattrs): Look at the value of MEM_SIZE,
index 67a067c169ffe9ebc17f633fd49c887c6de51f73..fa7963062bf5fa49a07180e006aa21c80f98de01 100644 (file)
 #
 #  host_can_use_collect2 Set to yes normally; to no if the host cannot
 #                      link or otherwise use collect2
+#  use_long_long_for_widest_fast_int Set this to 'yes' if 'long long'
+#                      (or '__int64') is wider than 'long' but still
+#                      efficeiently supported by the host hardware.
+#                      Only affects compile speed.  Default is 'no'.
 
 # When setting any of these variables, check to see if a corresponding
 # variable is present in config.build; if so, you will likely want to 
@@ -66,6 +70,7 @@ host_extra_objs=
 host_extra_gcc_objs=
 out_host_hook_obj=host-default.o
 host_can_use_collect2=yes
+use_long_long_for_widest_fast_int=no
 
 # Unsupported hosts list.  Generally, only include hosts known to fail here,
 # since we allow hosts not listed to be supported generically.
@@ -172,4 +177,7 @@ case ${host} in
     out_host_hook_obj=host-linux.o
     host_xmake_file=x-linux
     ;;
+  ia64-*-hpux*)
+    use_long_long_for_widest_fast_int=yes
+    ;;
 esac
index a104c6739c3c4d37e987ff21a5a9414b918be3ce..f169e6dfdb1ef827cfffe62296ace33fcfd4149f 100644 (file)
 /* Define if gcc should use -lunwind. */
 #undef USE_LIBUNWIND_EXCEPTIONS
 
+/* Define to 1 if the 'long long' (or '__int64') is wider than 'long' but
+   still efficiently supported by the host hardware. */
+#undef USE_LONG_LONG_FOR_WIDEST_FAST_INT
+
 /* Define if location_t is fileline integer cookie. */
 #undef USE_MAPPED_LOCATION
 
index 50faa15f998fdb6bba410ef71695290e880ab9b0..db6fc03cb544f4b1cce83ad238d5bd3a1ca7ad36 100755 (executable)
@@ -9281,6 +9281,14 @@ _ACEOF
 
 fi
 
+if test x$use_long_long_for_widest_fast_int = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define USE_LONG_LONG_FOR_WIDEST_FAST_INT 1
+_ACEOF
+
+fi
+
 count=a
 for f in $host_xm_file; do
        count=${count}x
index 18c0d1f179f9d00d1f821f3803d05a3a7e8bc26c..f1295d4f4d633ac959641d0a2c1b2e4052df064e 100644 (file)
@@ -1220,6 +1220,12 @@ if test x$need_64bit_hwint = xyes; then
 [Define to 1 if HOST_WIDE_INT must be 64 bits wide (see hwint.h).])
 fi
 
+if test x$use_long_long_for_widest_fast_int = xyes; then
+       AC_DEFINE(USE_LONG_LONG_FOR_WIDEST_FAST_INT, 1,
+[Define to 1 if the 'long long' (or '__int64') is wider than 'long' but still
+efficiently supported by the host hardware.])
+fi
+
 count=a
 for f in $host_xm_file; do
        count=${count}x
index a770180e3868c7320c6c850ee1920083af8ba1fb..166a839a759ff166065ceddc16f2201077bf398e 100644 (file)
@@ -33,22 +33,23 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 
    Note that lots of code assumes that the first part of a regset is
    the same format as a HARD_REG_SET.  To help make sure this is true,
-   we only try the widest integer mode (HOST_WIDE_INT) instead of all the
-   smaller types.  This approach loses only if there are a very few
-   registers and then only in the few cases where we have an array of
-   HARD_REG_SETs, so it needn't be as complex as it used to be.  */
+   we only try the widest fast integer mode (HOST_WIDEST_FAST_INT)
+   instead of all the smaller types.  This approach loses only if
+   there are avery few registers and then only in the few cases where
+   we have an array of HARD_REG_SETs, so it needn't be as complex as
+   it used to be.  */
 
-typedef unsigned HOST_WIDE_INT HARD_REG_ELT_TYPE;
+typedef unsigned HOST_WIDEST_FAST_INT HARD_REG_ELT_TYPE;
 
-#if FIRST_PSEUDO_REGISTER <= HOST_BITS_PER_WIDE_INT
+#if FIRST_PSEUDO_REGISTER <= HOST_BITS_PER_WIDEST_FAST_INT
 
 #define HARD_REG_SET HARD_REG_ELT_TYPE
 
 #else
 
 #define HARD_REG_SET_LONGS \
- ((FIRST_PSEUDO_REGISTER + HOST_BITS_PER_WIDE_INT - 1) \
-  / HOST_BITS_PER_WIDE_INT)
+ ((FIRST_PSEUDO_REGISTER + HOST_BITS_PER_WIDEST_FAST_INT - 1)  \
+  / HOST_BITS_PER_WIDEST_FAST_INT)
 typedef HARD_REG_ELT_TYPE HARD_REG_SET[HARD_REG_SET_LONGS];
 
 #endif
@@ -111,7 +112,7 @@ typedef HARD_REG_ELT_TYPE HARD_REG_SET[HARD_REG_SET_LONGS];
 
 #else
 
-#define UHOST_BITS_PER_WIDE_INT ((unsigned) HOST_BITS_PER_WIDE_INT)
+#define UHOST_BITS_PER_WIDE_INT ((unsigned) HOST_BITS_PER_WIDEST_FAST_INT)
 
 #define SET_HARD_REG_BIT(SET, BIT)             \
   ((SET)[(BIT) / UHOST_BITS_PER_WIDE_INT]      \
@@ -125,7 +126,7 @@ typedef HARD_REG_ELT_TYPE HARD_REG_SET[HARD_REG_SET_LONGS];
   (!!((SET)[(BIT) / UHOST_BITS_PER_WIDE_INT]   \
       & (HARD_CONST (1) << ((BIT) % UHOST_BITS_PER_WIDE_INT))))
 
-#if FIRST_PSEUDO_REGISTER <= 2*HOST_BITS_PER_WIDE_INT
+#if FIRST_PSEUDO_REGISTER <= 2*HOST_BITS_PER_WIDEST_FAST_INT
 #define CLEAR_HARD_REG_SET(TO)  \
 do { HARD_REG_ELT_TYPE *scan_tp_ = (TO);                       \
      scan_tp_[0] = 0;                                          \
@@ -179,7 +180,7 @@ do { HARD_REG_ELT_TYPE *scan_xp_ = (X), *scan_yp_ = (Y);    \
        goto TO; } while (0)
 
 #else
-#if FIRST_PSEUDO_REGISTER <= 3*HOST_BITS_PER_WIDE_INT
+#if FIRST_PSEUDO_REGISTER <= 3*HOST_BITS_PER_WIDES_FAST_INT
 #define CLEAR_HARD_REG_SET(TO)  \
 do { HARD_REG_ELT_TYPE *scan_tp_ = (TO);                       \
      scan_tp_[0] = 0;                                          \
@@ -243,7 +244,7 @@ do { HARD_REG_ELT_TYPE *scan_xp_ = (X), *scan_yp_ = (Y);    \
        goto TO; } while (0)
 
 #else
-#if FIRST_PSEUDO_REGISTER <= 4*HOST_BITS_PER_WIDE_INT
+#if FIRST_PSEUDO_REGISTER <= 4*HOST_BITS_PER_WIDEST_FAST_INT
 #define CLEAR_HARD_REG_SET(TO)  \
 do { HARD_REG_ELT_TYPE *scan_tp_ = (TO);                       \
      scan_tp_[0] = 0;                                          \
@@ -316,7 +317,7 @@ do { HARD_REG_ELT_TYPE *scan_xp_ = (X), *scan_yp_ = (Y);    \
         && (scan_xp_[3] == scan_yp_[3]))                       \
        goto TO; } while (0)
 
-#else /* FIRST_PSEUDO_REGISTER > 3*HOST_BITS_PER_WIDE_INT */
+#else /* FIRST_PSEUDO_REGISTER > 3*HOST_BITS_PER_WIDEST_FAST_INT */
 
 #define CLEAR_HARD_REG_SET(TO)  \
 do { HARD_REG_ELT_TYPE *scan_tp_ = (TO);                       \
index 4fed004cbf6cdcf9c6001b9b26411d5d8a040fdf..ccf624f6d054877e24c28e6f057c96467571d2d4 100644 (file)
@@ -116,4 +116,27 @@ extern char sizeof_long_long_must_be_8[sizeof(long long) == 8 ? 1 : -1];
 # define HOST_WIDEST_INT_PRINT_DOUBLE_HEX     "0x%llx%016llx"
 #endif
 
+/* Define HOST_WIDEST_FAST_INT to the widest integer type supported
+   efficiently in hardware.  (That is, the widest integer type that fits
+   in a hardware register.)  Normally this is "long" but on some hosts it
+   should be "long long" or "__int64".  This is no convenient way to
+   autodect this, so such systems must set a flag in config.host; see there
+   for details.  */
+
+#ifdef USE_LONG_LONG_FOR_WIDEST_FAST_INT
+#  ifdef HAVE_LONG_LONG
+#    define HOST_WIDEST_FAST_INT long long
+#    define HOST_BITS_PER_WIDEST_FAST_INT HOST_BITS_PER_LONGLONG
+#  elif defined (HAVE___INT64)
+#    define HOST_WIDEST_FAST_INT __int64
+#    define HOST_BITS_PER_WIDEST_FAST_INT HOST_BITS_PER___INT64
+#  else
+#    error "Your host said it wantted to use long long or __int64 but neither"
+#    error "exist"
+#  endif
+#else
+#  define HOST_WIDEST_FAST_INT long
+#  define HOST_BITS_PER_WIDEST_FAST_INT HOST_BITS_PER_LONG
+#endif
+
 #endif /* ! GCC_HWINT_H */
index 0ddc0d051c68807c6c4f240935719cd53f1e8249..8584811cddb7a1d454b71124f85b323284e13902 100644 (file)
@@ -25,8 +25,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
    It should be straightforward to convert so for now we keep things simple
    while more important issues are dealt with.  */
 
-#define SBITMAP_ELT_BITS ((unsigned) HOST_BITS_PER_WIDE_INT)
-#define SBITMAP_ELT_TYPE unsigned HOST_WIDE_INT
+#define SBITMAP_ELT_BITS ((unsigned) HOST_BITS_PER_WIDEST_FAST_INT)
+#define SBITMAP_ELT_TYPE unsigned HOST_WIDEST_FAST_INT
 
 typedef struct simple_bitmap_def
 {