]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
aix.h (TARGET_IEEEQUAD_DEFAULT): Set long double default to IBM.
authorMichael Meissner <meissner@linux.vnet.ibm.com>
Thu, 26 Oct 2017 17:33:38 +0000 (17:33 +0000)
committerMichael Meissner <meissner@gcc.gnu.org>
Thu, 26 Oct 2017 17:33:38 +0000 (17:33 +0000)
[gcc]
2017-10-26  Michael Meissner  <meissner@linux.vnet.ibm.com>

* config/rs6000/aix.h (TARGET_IEEEQUAD_DEFAULT): Set long double
default to IBM.
* config/rs6000/darwin.h (TARGET_IEEEQUAD_DEFAULT): Likewise.
* config/rs6000/rs6000.opt (-mabi=ieeelongdouble): Move the
warning to rs6000.c.  Remove the Undocumented flag, since it has
been documented.
(-mabi=ibmlongdouble): Likewise.
* config/rs6000/rs6000.c (TARGET_IEEEQUAD_DEFAULT): If it is not
already set, set the default format for long double.
(rs6000_debug_reg_global): Print whether long double is IBM or
IEEE.
(rs6000_option_override_internal): Rework setting long double
format.  Only warn if the user is changing the long double default
and they did not use -Wno-psabi.
* doc/invoke.texi (PowerPC options): Update the documentation for
-mabi=ieeelongdouble and -mabi=ibmlongdouble.

From-SVN: r254116

gcc/ChangeLog
gcc/config/rs6000/aix.h
gcc/config/rs6000/darwin.h
gcc/config/rs6000/rs6000.c
gcc/config/rs6000/rs6000.opt
gcc/doc/invoke.texi

index 4312ac2d75e0e28c561b77121513c2742024219a..c6e0b8501b40d8e3fbdf283b0a88a3b766e4c675 100644 (file)
@@ -1,3 +1,22 @@
+2017-10-26  Michael Meissner  <meissner@linux.vnet.ibm.com>
+
+       * config/rs6000/aix.h (TARGET_IEEEQUAD_DEFAULT): Set long double
+       default to IBM.
+       * config/rs6000/darwin.h (TARGET_IEEEQUAD_DEFAULT): Likewise.
+       * config/rs6000/rs6000.opt (-mabi=ieeelongdouble): Move the
+       warning to rs6000.c.  Remove the Undocumented flag, since it has
+       been documented.
+       (-mabi=ibmlongdouble): Likewise.
+       * config/rs6000/rs6000.c (TARGET_IEEEQUAD_DEFAULT): If it is not
+       already set, set the default format for long double.
+       (rs6000_debug_reg_global): Print whether long double is IBM or
+       IEEE.
+       (rs6000_option_override_internal): Rework setting long double
+       format.  Only warn if the user is changing the long double default
+       and they did not use -Wno-psabi.
+       * doc/invoke.texi (PowerPC options): Update the documentation for
+       -mabi=ieeelongdouble and -mabi=ibmlongdouble.
+
 2017-10-26  Richard Sandiford  <richard.sandiford@linaro.org>
            Alan Hayward  <alan.hayward@arm.com>
            David Sherwood  <david.sherwood@arm.com>
index 607b42c0a40e56767e2d876b054d09c3f4c43392..73541819fdeaf2097cf9b0fe4768cd4e3dfe5b88 100644 (file)
@@ -76,6 +76,9 @@
 #undef  TARGET_IEEEQUAD
 #define TARGET_IEEEQUAD 0
 
+#undef  TARGET_IEEEQUAD_DEFAULT
+#define TARGET_IEEEQUAD_DEFAULT 0
+
 /* The AIX linker will discard static constructors in object files before
    collect has a chance to see them, so scan the object files directly.  */
 #define COLLECT_EXPORT_LIST
index 9a88a8d9e5e9d30bc79d4e829ce0fd0dc3400094..a6a7b2c554c30de10086a5a5fe0fce5cbffcba43 100644 (file)
@@ -272,6 +272,9 @@ extern int darwin_emit_branch_islands;
 #undef  TARGET_IEEEQUAD
 #define TARGET_IEEEQUAD 0
 
+#undef  TARGET_IEEEQUAD_DEFAULT
+#define TARGET_IEEEQUAD_DEFAULT 0
+
 /* Since Darwin doesn't do TOCs, stub this out.  */
 
 #define ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X, MODE)  ((void)X, (void)MODE, 0)
index 309541933cd0b9224b29aa310e6bb4348e0e9054..3162d522fe388ad779f25d473b0c7cd384a79755 100644 (file)
 
 #ifndef TARGET_NO_PROTOTYPE
 #define TARGET_NO_PROTOTYPE 0
+#endif
+
+  /* Set -mabi=ieeelongdouble on some old targets.  In the future, power server
+     systems will also set long double to be IEEE 128-bit.  AIX and Darwin
+     explicitly redefine TARGET_IEEEQUAD and TARGET_IEEEQUAD_DEFAULT to 0, so
+     those systems will not pick up this default.  This needs to be after all
+     of the include files, so that POWERPC_LINUX and POWERPC_FREEBSD are
+     properly defined.  */
+#ifndef TARGET_IEEEQUAD_DEFAULT
+#if !defined (POWERPC_LINUX) && !defined (POWERPC_FREEBSD)
+#define TARGET_IEEEQUAD_DEFAULT 1
+#else
+#define TARGET_IEEEQUAD_DEFAULT 0
+#endif
 #endif
 
 #define min(A,B)       ((A) < (B) ? (A) : (B))
@@ -2878,6 +2892,13 @@ rs6000_debug_reg_global (void)
   fprintf (stderr, DEBUG_FMT_D, "tls_size", rs6000_tls_size);
   fprintf (stderr, DEBUG_FMT_D, "long_double_size",
           rs6000_long_double_type_size);
+  if (rs6000_long_double_type_size == 128)
+    {
+      fprintf (stderr, DEBUG_FMT_S, "long double type",
+              TARGET_IEEEQUAD ? "IEEE" : "IBM");
+      fprintf (stderr, DEBUG_FMT_S, "default long double type",
+              TARGET_IEEEQUAD_DEFAULT ? "IEEE" : "IBM");
+    }
   fprintf (stderr, DEBUG_FMT_D, "sched_restricted_insns_priority",
           (int)rs6000_sched_restricted_insns_priority);
   fprintf (stderr, DEBUG_FMT_D, "Number of standard builtins",
@@ -4560,13 +4581,26 @@ rs6000_option_override_internal (bool global_init_p)
        rs6000_long_double_type_size = RS6000_DEFAULT_LONG_DOUBLE_SIZE;
     }
 
-  /* Set -mabi=ieeelongdouble on some old targets.  Note, AIX and Darwin
-     explicitly redefine TARGET_IEEEQUAD to 0, so those systems will not
-     pick up this default.  */
-#if !defined (POWERPC_LINUX) && !defined (POWERPC_FREEBSD)
+  /* Set -mabi=ieeelongdouble on some old targets.  In the future, power server
+     systems will also set long double to be IEEE 128-bit.  AIX and Darwin
+     explicitly redefine TARGET_IEEEQUAD and TARGET_IEEEQUAD_DEFAULT to 0, so
+     those systems will not pick up this default.  Warn if the user changes the
+     default unless -Wno-psabi.  */
   if (!global_options_set.x_rs6000_ieeequad)
-    rs6000_ieeequad = 1;
-#endif
+    rs6000_ieeequad = TARGET_IEEEQUAD_DEFAULT;
+
+  else if (rs6000_ieeequad != TARGET_IEEEQUAD_DEFAULT && TARGET_LONG_DOUBLE_128)
+    {
+      static bool warned_change_long_double;
+      if (!warned_change_long_double)
+       {
+         warned_change_long_double = true;
+         if (TARGET_IEEEQUAD)
+           warning (OPT_Wpsabi, "Using IEEE extended precision long double");
+         else
+           warning (OPT_Wpsabi, "Using IBM extended precision long double");
+       }
+    }
 
   /* Enable the default support for IEEE 128-bit floating point on Linux VSX
      sytems.  In GCC 7, we would enable the the IEEE 128-bit floating point
index c42818fbc04e1fdff5a5a5099d5c7d3e5efae012..e7d0829495e03ebcb0bb7184ce5ad9a282d63bca 100644 (file)
@@ -381,10 +381,10 @@ mabi=d32
 Target RejectNegative Undocumented Warn(using old darwin ABI) Var(rs6000_darwin64_abi, 0)
 
 mabi=ieeelongdouble
-Target RejectNegative Undocumented Warn(using IEEE extended precision long double) Var(rs6000_ieeequad) Save
+Target RejectNegative Var(rs6000_ieeequad) Save
 
 mabi=ibmlongdouble
-Target RejectNegative Undocumented Warn(using IBM extended precision long double) Var(rs6000_ieeequad, 0)
+Target RejectNegative Var(rs6000_ieeequad, 0)
 
 mcpu=
 Target RejectNegative Joined Var(rs6000_cpu_index) Init(-1) Enum(rs6000_cpu_opt_value) Save
index 71b2445f70fd5b832c68c08e69e71d8ecad37a4a..f950c3ca3941a21466d42e11bc049f672576e557 100644 (file)
@@ -22614,12 +22614,18 @@ Disable Book-E SPE ABI extensions for the current ABI@.
 @item -mabi=ibmlongdouble
 @opindex mabi=ibmlongdouble
 Change the current ABI to use IBM extended-precision long double.
-This is a PowerPC 32-bit SYSV ABI option.
+This is not likely to work if your system defaults to using IEEE
+extended-precision long double.  If you change the long double type
+from IEEE extended-precision, the compiler will issue a warning unless
+you use the @option{-Wno-psabi} option.
 
 @item -mabi=ieeelongdouble
 @opindex mabi=ieeelongdouble
 Change the current ABI to use IEEE extended-precision long double.
-This is a PowerPC 32-bit Linux ABI option.
+This is not likely to work if your system defaults to using IBM
+extended-precision long double.  If you change the long double type
+from IBM extended-precision, the compiler will issue a warning unless
+you use the @option{-Wno-psabi} option.
 
 @item -mabi=elfv1
 @opindex mabi=elfv1