This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix PR 13987, compile time slow down on powerpc-apple-darwin


I decided to rename the configure option and make it default to use long instead of long long.
I also moved the code to decide which type to use into hwint.h so other
files can use it also if they want.  Also since ia64-hpux was mentioned
as one of the targets where long long was more effiecent I turned it on
for that host.

OK? Bootstrapped on powerpc-apple-darwin with no regressions?

Thanks,
Andrew Pinski
ChangeLog:

	* config.host (host_efficient_long_long): New, set defaultly to no.
	And set to yes for ia64-*-hpux*.
	* configure.ac: If host_efficient_long_long, then define EFFICIENT_LONG_LONG.
	* configure: Regenerate.
	* config.in: Regenerate.
	* hwint.h (HOST_FASTEST_INT): Define on the fastest integer type
	based on EFFICIENT_LONG_LONG.
	* sbitmap.h (SBITMAP_ELT_BITS): Define based on HOST_BITS_PRE_FASTEST_INT.
	(SBITMAP_ELT_TYPE): Define base on HOST_FASTEST_INT.


Index: configure.ac
===================================================================
RCS file: /cvs/gcc/gcc/gcc/configure.ac,v
retrieving revision 2.43
diff -u -p -r2.43 configure.ac
--- configure.ac	18 Jun 2004 01:59:45 -0000	2.43
+++ configure.ac	19 Jun 2004 18:55:31 -0000
@@ -1170,6 +1170,11 @@ 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$host_efficient_long_long = xyes; then
+	AC_DEFINE(EFFICIENT_LONG_LONG, 1,
+[Define to 1 if long long are efficient for general use.])
+fi
+
 count=a
 for f in $host_xm_file; do
 	count=${count}x
Index: config.host
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config.host,v
retrieving revision 2.10
diff -u -p -r2.10 config.host
--- config.host	5 Jun 2004 07:28:25 -0000	2.10
+++ config.host	19 Jun 2004 18:55:31 -0000
@@ -52,6 +52,9 @@
 #
 #  host_can_use_collect2 Set to yes normally; to no if the host cannot
 #			link or otherwise use collect2
+#
+#  host_efficient_long_long Set to no normally; to no if long long are
+#			 not as effiecient as long integers
 
 # 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 +69,7 @@ host_extra_objs=
 host_extra_gcc_objs=
 out_host_hook_obj=host-default.o
 host_can_use_collect2=yes
+host_efficient_long_long=no
 
 # Unsupported hosts list.  Generally, only include hosts known to fail here,
 # since we allow hosts not listed to be supported generically.
@@ -80,6 +84,12 @@ case ${host} in
     ;;
 esac
 
+case ${host} in
+  ia64-*-hpux*)
+    host_efficient_long_long=yes
+    ;;
+esac
+
 # Machine-specific settings.
 case ${host} in
   alpha*-dec-*vms*)
Index: sbitmap.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/sbitmap.h,v
retrieving revision 1.21
diff -u -p -r1.21 sbitmap.h
--- sbitmap.h	13 May 2004 06:39:45 -0000	1.21
+++ sbitmap.h	19 Jun 2004 18:55:31 -0000
@@ -25,8 +25,9 @@ Software Foundation, 59 Temple Place - S
    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_PRE_FASTEST_INT)
+#define SBITMAP_ELT_TYPE unsigned HOST_FASTEST_INT
 
 typedef struct simple_bitmap_def
 {
Index: hwint.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/hwint.h,v
retrieving revision 1.17
diff -u -p -r1.17 hwint.h
--- hwint.h	25 Jun 2003 19:33:08 -0000	1.17
+++ hwint.h	19 Jun 2004 18:55:31 -0000
@@ -116,4 +116,21 @@ extern char sizeof_long_long_must_be_8[s
 # define HOST_WIDEST_INT_PRINT_DOUBLE_HEX     "0x%llx%016llx"
 #endif
 
+/* Set HOST_FASTEST_INT to the fastest and largest integer type available.  */
+
+#ifdef EFFICIENT_LONG_LONG
+# ifdef HAVE_LONG_LONG
+#  define HOST_FASTEST_INT long long
+#  define HOST_BITS_PRE_FASTEST_INT HOST_BITS_PER_LONGLONG
+# elif defined (HAVE___INT64)
+#  define HOST_FASTEST_INT __int64
+#  define HOST_BITS_PRE_FASTEST_INT HOST_BITS_PER___INT64
+# else
+  #error "This should be impossible to reach"
+#endif
+#else
+# define HOST_FASTEST_INT long
+# define HOST_BITS_PRE_FASTEST_INT HOST_BITS_PER_LONG
+#endif
+
 #endif /* ! GCC_HWINT_H */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]