2004-08-30 Andrew Pinski <apinski@apple.com>
authorpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 31 Aug 2004 00:29:04 +0000 (00:29 +0000)
committerpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 31 Aug 2004 00:29:04 +0000 (00:29 +0000)
        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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@86816 138bc75d-0d04-0410-961f-82ee72b054a4

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 ce84375..e5c7ac0 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 67a067c..fa79630 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 a104c67..f169e6d 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 50faa15..db6fc03 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 18c0d1f..f1295d4 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 a770180..166a839 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 4fed004..ccf624f 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 0ddc0d0..8584811 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
 {