+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,
#
# 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
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.
out_host_hook_obj=host-linux.o
host_xmake_file=x-linux
;;
+ ia64-*-hpux*)
+ use_long_long_for_widest_fast_int=yes
+ ;;
esac
/* 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
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
[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
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
#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] \
(!!((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; \
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; \
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; \
&& (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); \
# 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 */
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
{