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]

Patch ping^2


On Tue, Feb 14, 2006 at 12:19:41PM -0500, Jakub Jelinek wrote:
> --with{,out}-long-double-128 configure option:
> http://gcc.gnu.org/ml/gcc-patches/2006-02/msg00664.html
> 
> (together with the already approved remaining parts of:
> http://gcc.gnu.org/ml/gcc-patches/2006-02/msg00274.html
> http://gcc.gnu.org/ml/gcc-patches/2006-02/msg00271.html
> http://gcc.gnu.org/ml/gcc-patches/2006-02/msg00263.html).
> 
> Ok for trunk?

I'm attaching the full patch that includes also the approved
parts.
Ok?

2006-02-20  Jakub Jelinek  <jakub@redhat.com>

	* configure.ac: Add --with{,out}-long-double-128 configure option.
	(TARGET_DEFAULT_LONG_DOUBLE_128): New test.
	* configure: Rebuilt.
	* config.in: Rebuilt.
	* doc/install.texi (Options specification): Document
	--with-long-double-128.

	* config/rs6000/linux.h [TARGET_DEFAULT_LONG_DOUBLE_128]
	(RS6000_DEFAULT_LONG_DOUBLE_SIZE): Define to 128.
	* config/rs6000/linux64.h [TARGET_DEFAULT_LONG_DOUBLE_128]
	(RS6000_DEFAULT_LONG_DOUBLE_SIZE): Define to 128.

2006-02-20  Aldy Hernandez  <aldyh@redhat.com>

	* config/s390/s390.c (override_options): Handle
	TARGET_DEFAULT_LONG_DOUBLE_128.

	* config/alpha/alpha.c (override_options): Handle
	TARGET_DEFAULT_LONG_DOUBLE_128.

	* config/sparc/sparc.c (sparc_override_options): Handle
	TARGET_DEFAULT_LONG_DOUBLE_128.

--- gcc/doc/install.texi.jj	2006-02-20 20:01:07.000000000 +0100
+++ gcc/doc/install.texi	2006-02-20 20:21:09.000000000 +0100
@@ -1251,6 +1251,14 @@ extension.  This is enabled by default o
 systems.  Other systems may also support it, but require the user to
 specifically enable it.
 
+@item --with-long-double-128
+Specify if @code{long double} type should be 128-bit by default on selected
+GNU/Linux architectures.  If using @code{--without-long-double-128},
+@code{long double} will be by default 64-bit, the same as @code{double} type.
+When neither of these configure options are used, the default will be
+128-bit @code{long double} when built against GNU C Library 2.4 and later,
+64-bit @code{long double} otherwise.
+
 @end table
 
 @subheading Cross-Compiler-Specific Options
--- gcc/config/alpha/alpha.c.jj	2006-02-13 22:21:21.000000000 +0100
+++ gcc/config/alpha/alpha.c	2006-02-20 20:38:27.000000000 +0100
@@ -516,6 +516,11 @@ override_options (void)
       REAL_MODE_FORMAT (DFmode) = &vax_g_format;
       REAL_MODE_FORMAT (TFmode) = NULL;
     }
+
+#ifdef TARGET_DEFAULT_LONG_DOUBLE_128
+  if (!(target_flags_explicit & MASK_LONG_DOUBLE_128))
+    target_flags |= MASK_LONG_DOUBLE_128;
+#endif
 }
 
 /* Returns 1 if VALUE is a mask that contains full bytes of zero or ones.  */
--- gcc/config/s390/s390.c.jj	2006-02-20 20:01:07.000000000 +0100
+++ gcc/config/s390/s390.c	2006-02-20 20:38:27.000000000 +0100
@@ -1415,6 +1415,11 @@ override_options (void)
     }
   else if (s390_stack_guard)
     error ("-mstack-guard implies use of -mstack-size"); 
+
+#ifdef TARGET_DEFAULT_LONG_DOUBLE_128
+  if (!(target_flags_explicit & MASK_LONG_DOUBLE_128))
+    target_flags |= MASK_LONG_DOUBLE_128;
+#endif
 }
 
 /* Map for smallest class containing reg regno.  */
--- gcc/config/sparc/sparc.c.jj	2006-02-13 22:21:22.000000000 +0100
+++ gcc/config/sparc/sparc.c	2006-02-20 20:38:27.000000000 +0100
@@ -791,6 +791,11 @@ sparc_override_options (void)
       sparc_costs = &ultrasparc3_costs;
       break;
     };
+
+#ifdef TARGET_DEFAULT_LONG_DOUBLE_128
+  if (!(target_flags_explicit & MASK_LONG_DOUBLE_128))
+    target_flags |= MASK_LONG_DOUBLE_128;
+#endif
 }
 
 #ifdef SUBTARGET_ATTRIBUTE_TABLE
--- gcc/config/rs6000/linux.h.jj	2006-02-18 19:55:52.000000000 +0100
+++ gcc/config/rs6000/linux.h	2006-02-20 20:38:27.000000000 +0100
@@ -120,3 +120,8 @@
 #endif
 
 #define POWERPC_LINUX
+
+/* ppc linux has 128-bit long double support in glibc 2.4 and later.  */
+#ifdef TARGET_DEFAULT_LONG_DOUBLE_128
+#define RS6000_DEFAULT_LONG_DOUBLE_SIZE 128
+#endif
--- gcc/config/rs6000/linux64.h.jj	2006-02-18 19:55:52.000000000 +0100
+++ gcc/config/rs6000/linux64.h	2006-02-20 20:38:27.000000000 +0100
@@ -584,3 +584,8 @@ while (0)
 #endif
 
 #define POWERPC_LINUX
+
+/* ppc{32,64} linux has 128-bit long double support in glibc 2.4 and later.  */
+#ifdef TARGET_DEFAULT_LONG_DOUBLE_128
+#define RS6000_DEFAULT_LONG_DOUBLE_SIZE 128
+#endif
--- gcc/configure.ac.jj	2006-02-20 20:01:08.000000000 +0100
+++ gcc/configure.ac	2006-02-20 20:21:09.000000000 +0100
@@ -3176,6 +3176,39 @@ if test x$gcc_cv_libc_provides_ssp = xye
 	    [Define if your target C library provides stack protector support])
 fi
 
+# Check if TFmode long double should be used by default or not.
+# Some glibc targets used DFmode long double, but with glibc 2.4
+# and later they can use TFmode.
+case "$target" in
+  powerpc*-*-*gnu* | \
+  sparc*-*-linux* | \
+  s390*-*-linux* | \
+  alpha*-*-linux*)
+    AC_ARG_WITH(long-double-128,
+[  --with-long-double-128  Use 128-bit long double by default.],
+      gcc_cv_target_ldbl128="$with_long_double_128",
+      [gcc_cv_target_ldbl128=no
+      if test x$host != x$target || test "x$TARGET_SYSTEM_ROOT" != x; then
+	if test "x$with_sysroot" = x; then
+	  glibc_header_dir="${exec_prefix}/${target_noncanonical}/sys-include"
+	elif test "x$with_sysroot" = xyes; then
+	  glibc_header_dir="${exec_prefix}/${target_noncanonical}/sys-root/usr/include"
+	else
+	  glibc_header_dir="${with_sysroot}/usr/include"
+	fi
+      else
+	glibc_header_dir=/usr/include
+      fi
+      grep '^[ 	]*#[ 	]*define[ 	][ 	]*__LONG_DOUBLE_MATH_OPTIONAL' \
+        $glibc_header_dir/bits/wordsize.h > /dev/null 2>&1 \
+      && gcc_cv_target_ldbl128=yes])
+    ;;
+esac
+if test x$gcc_cv_target_ldbl128 = xyes; then
+  AC_DEFINE(TARGET_DEFAULT_LONG_DOUBLE_128, 1,
+	    [Define if TFmode long double should be the default])
+fi
+
 # Find out what GC implementation we want, or may, use.
 AC_ARG_WITH(gc,
 [  --with-gc={page,zone}   choose the garbage collection mechanism to use
--- gcc/configure.jj	2006-02-20 20:01:08.000000000 +0100
+++ gcc/configure	2006-02-20 20:21:27.000000000 +0100
@@ -932,6 +932,7 @@ Optional Packages:
   --with-libiconv-prefix[=DIR]  search for libiconv in DIR/include and DIR/lib
   --without-libiconv-prefix     don't search for libiconv in includedir and libdir
   --with-system-libunwind use installed libunwind
+  --with-long-double-128  Use 128-bit long double by default.
   --with-gc={page,zone}   choose the garbage collection mechanism to use
                           with the compiler
   --with-system-zlib      use installed libz
@@ -7612,7 +7613,7 @@ if test "${gcc_cv_prog_makeinfo_modern+s
 else
     ac_prog_version=`$MAKEINFO --version 2>&1 |
                    sed -n 's/^.*GNU texinfo.* \([0-9][0-9.]*\).*$/\1/p'`
-  echo "configure:7615: version of makeinfo is $ac_prog_version" >&5
+  echo "configure:7616: version of makeinfo is $ac_prog_version" >&5
   case $ac_prog_version in
     '')     gcc_cv_prog_makeinfo_modern=no;;
     4.[4-9]*)
@@ -15675,6 +15676,46 @@ _ACEOF
 
 fi
 
+# Check if TFmode long double should be used by default or not.
+# Some glibc targets used DFmode long double, but with glibc 2.4
+# and later they can use TFmode.
+case "$target" in
+  powerpc*-*-*gnu* | \
+  sparc*-*-linux* | \
+  s390*-*-linux* | \
+  alpha*-*-linux*)
+
+# Check whether --with-long-double-128 or --without-long-double-128 was given.
+if test "${with_long_double_128+set}" = set; then
+  withval="$with_long_double_128"
+  gcc_cv_target_ldbl128="$with_long_double_128"
+else
+  gcc_cv_target_ldbl128=no
+      if test x$host != x$target || test "x$TARGET_SYSTEM_ROOT" != x; then
+	if test "x$with_sysroot" = x; then
+	  glibc_header_dir="${exec_prefix}/${target_noncanonical}/sys-include"
+	elif test "x$with_sysroot" = xyes; then
+	  glibc_header_dir="${exec_prefix}/${target_noncanonical}/sys-root/usr/include"
+	else
+	  glibc_header_dir="${with_sysroot}/usr/include"
+	fi
+      else
+	glibc_header_dir=/usr/include
+      fi
+      grep '^ 	*#[ 	]*define[ 	][ 	]*__LONG_DOUBLE_MATH_OPTIONAL' \
+        $glibc_header_dir/bits/wordsize.h > /dev/null 2>&1 \
+      && gcc_cv_target_ldbl128=yes
+fi;
+    ;;
+esac
+if test x$gcc_cv_target_ldbl128 = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define TARGET_DEFAULT_LONG_DOUBLE_128 1
+_ACEOF
+
+fi
+
 # Find out what GC implementation we want, or may, use.
 
 # Check whether --with-gc or --without-gc was given.
--- gcc/config.in.jj	2005-12-27 17:31:45.000000000 +0100
+++ gcc/config.in	2006-02-20 20:21:09.000000000 +0100
@@ -1283,6 +1283,12 @@
 #endif
 
 
+/* Define if TFmode long double should be the default */
+#ifndef USED_FOR_TARGET
+#undef TARGET_DEFAULT_LONG_DOUBLE_128
+#endif
+
+
 /* Define if your target C library provides stack protector support */
 #ifndef USED_FOR_TARGET
 #undef TARGET_LIBC_PROVIDES_SSP


	Jakub


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