public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/meissner/heads/work030)] Revert patch.
@ 2020-12-17 18:31 Michael Meissner
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Meissner @ 2020-12-17 18:31 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:33ccbb506750cb14b2ac57b5a7c6f936c5ea1b6f

commit 33ccbb506750cb14b2ac57b5a7c6f936c5ea1b6f
Author: Michael Meissner <meissner@linux.ibm.com>
Date:   Thu Dec 17 13:30:11 2020 -0500

    Revert patch.
    
    gcc/
    2020-12-17  Michael Meissner  <meissner@linux.ibm.com>
    
            Revert.
            * config/rs6000/rs6000.c (rs6000_mangle_decl_assembler_name): Add
            support for mapping built-in function names for long double
            built-in functions if long double is IEEE 128-bit.
    
    gcc/testsuite/
    2020-12-17  Michael Meissner  <meissner@linux.ibm.com>
    
            Revert.
            * gcc.target/powerpc/float128-longdouble-math.c: New test.
            * gcc.target/powerpc/float128-longdouble-stdio.c: New test.
            * gcc.target/powerpc/float128-math.c: Adjust test for new name
            being generated.  Add support for running test on power10.  Add
            support for running if long double defaults to 64-bits.

Diff:
---
 gcc/config/rs6000/rs6000.c                         | 135 ++-----
 .../gcc.target/powerpc/float128-longdouble-math.c  | 442 ---------------------
 .../gcc.target/powerpc/float128-longdouble-stdio.c |  36 --
 gcc/testsuite/gcc.target/powerpc/float128-math.c   |  16 +-
 4 files changed, 40 insertions(+), 589 deletions(-)

diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 36b102a0695..72f5d4250b5 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -27109,127 +27109,56 @@ rs6000_globalize_decl_name (FILE * stream, tree decl)
    library before you can switch the real*16 type at compile time.
 
    We use the TARGET_MANGLE_DECL_ASSEMBLER_NAME hook to change this name.  We
-   only do this transformation if the __float128 type is enabled.  This
-   prevents us from doing the transformation on older 32-bit ports that might
-   have enabled using IEEE 128-bit floating point as the default long double
-   type.  */
+   only do this if the default is that long double is IBM extended double, and
+   the user asked for IEEE 128-bit.  */
 
 static tree
 rs6000_mangle_decl_assembler_name (tree decl, tree id)
 {
-  if (TARGET_FLOAT128_TYPE && TARGET_IEEEQUAD && TARGET_LONG_DOUBLE_128
+  if (!TARGET_IEEEQUAD_DEFAULT && TARGET_IEEEQUAD && TARGET_LONG_DOUBLE_128
       && TREE_CODE (decl) == FUNCTION_DECL
-      && DECL_IS_UNDECLARED_BUILTIN (decl)
-      && DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL)
+      && DECL_IS_UNDECLARED_BUILTIN (decl))
     {
       size_t len = IDENTIFIER_LENGTH (id);
       const char *name = IDENTIFIER_POINTER (id);
-      char *newname = NULL;
 
-      /* See if it is one of the built-in functions with an unusual name.  */
-      switch (DECL_FUNCTION_CODE (decl))
+      if (name[len - 1] == 'l')
 	{
-	case BUILT_IN_DREML:
-	  newname = xstrdup ("__remainderieee128");
-	  break;
-
-	case BUILT_IN_GAMMAL:
-	  newname = xstrdup ("__lgammaieee128");
-	  break;
-
-	case BUILT_IN_GAMMAL_R:
-	case BUILT_IN_LGAMMAL_R:
-	  newname = xstrdup ("__lgammaieee128_r");
-	  break;
-
-	case BUILT_IN_NEXTTOWARD:
-	  newname = xstrdup ("__nexttoward_to_ieee128");
-	  break;
-
-	case BUILT_IN_NEXTTOWARDF:
-	  newname = xstrdup ("__nexttowardf_to_ieee128");
-	  break;
-
-	case BUILT_IN_NEXTTOWARDL:
-	  newname = xstrdup ("__nexttowardieee128");
-	  break;
-
-	case BUILT_IN_POW10L:
-	  newname = xstrdup ("__exp10ieee128");
-	  break;
-
-	case BUILT_IN_SCALBL:
-	  newname = xstrdup ("__scalbieee128");
-	  break;
-
-	case BUILT_IN_SIGNIFICANDL:
-	  newname = xstrdup ("__significandieee128");
-	  break;
-
-	case BUILT_IN_SINCOSL:
-	  newname = xstrdup ("__sincosieee128");
-	  break;
-
-	default:
-	  break;
-	}
-
-      /* Update the __builtin_*printf and __builtin_*scanf functions.  */
-      if (!newname)
-	{
-	  size_t printf_len = strlen ("printf");
-	  size_t scanf_len = strlen ("scanf");
+	  bool uses_ieee128_p = false;
+	  tree type = TREE_TYPE (decl);
+	  machine_mode ret_mode = TYPE_MODE (type);
 
-	  if (len >= printf_len
-	      && strcmp (name + len - printf_len, "printf") == 0)
-	    newname = xasprintf ("__%sieee128", name);
-
-	  else if (len >= scanf_len
-		   && strcmp (name + len - scanf_len, "scanf") == 0)
-	    newname = xasprintf ("__isoc99_%sieee128", name);
-
-	  else if (name[len - 1] == 'l')
+	  /* See if the function returns a IEEE 128-bit floating point type or
+	     complex type.  */
+	  if (ret_mode == TFmode || ret_mode == TCmode)
+	    uses_ieee128_p = true;
+	  else
 	    {
-	      bool uses_ieee128_p = false;
-	      tree type = TREE_TYPE (decl);
-	      machine_mode ret_mode = TYPE_MODE (type);
-
-	      /* See if the function returns a IEEE 128-bit floating point type or
-		 complex type.  */
-	      if (ret_mode == TFmode || ret_mode == TCmode)
-		uses_ieee128_p = true;
-	      else
-		{
-		  function_args_iterator args_iter;
-		  tree arg;
+	      function_args_iterator args_iter;
+	      tree arg;
 
-		  /* See if the function passes a IEEE 128-bit floating point type
-		     or complex type.  */
-		  FOREACH_FUNCTION_ARGS (type, arg, args_iter)
+	      /* See if the function passes a IEEE 128-bit floating point type
+		 or complex type.  */
+	      FOREACH_FUNCTION_ARGS (type, arg, args_iter)
+		{
+		  machine_mode arg_mode = TYPE_MODE (arg);
+		  if (arg_mode == TFmode || arg_mode == TCmode)
 		    {
-		      machine_mode arg_mode = TYPE_MODE (arg);
-		      if (arg_mode == TFmode || arg_mode == TCmode)
-			{
-			  uses_ieee128_p = true;
-			  break;
-			}
+		      uses_ieee128_p = true;
+		      break;
 		    }
 		}
-
-	      /* If we passed or returned an IEEE 128-bit floating point type,
-		 change the name.  Use __<name>ieee128, instead of <name>l.  */
-	      if (uses_ieee128_p)
-		newname = xasprintf ("__%.*sieee128", (int)(len - 1), name);
 	    }
-	}
-
-      if (newname)
-	{
-	  if (TARGET_DEBUG_BUILTIN)
-	    fprintf (stderr, "Map %s => %s\n", name, newname);
 
-	  id = get_identifier (newname);
-	  free (newname);
+	  /* If we passed or returned an IEEE 128-bit floating point type,
+	     change the name.  */
+	  if (uses_ieee128_p)
+	    {
+	      char *name2 = (char *) alloca (len + 4);
+	      memcpy (name2, name, len - 1);
+	      strcpy (name2 + len - 1, "f128");
+	      id = get_identifier (name2);
+	    }
 	}
     }
 
diff --git a/gcc/testsuite/gcc.target/powerpc/float128-longdouble-math.c b/gcc/testsuite/gcc.target/powerpc/float128-longdouble-math.c
deleted file mode 100644
index 07934bb7357..00000000000
--- a/gcc/testsuite/gcc.target/powerpc/float128-longdouble-math.c
+++ /dev/null
@@ -1,442 +0,0 @@
-/* { dg-require-effective-target ppc_float128_hw } */
-/* { dg-options "-mdejagnu-cpu=power9 -O2 -mlong-double-128 -Wno-psabi -mabi=ieeelongdouble" } */
-
-/* Test if switching long double to IEEE 128-bit maps all of the math built-in
-   function names correctly.  We leave off the \M in matching the calls, so
-   power10 will match using bl foo@notoc.  */
-
-#ifdef DO_FUNC
-#define BUILTIN1(FUNC, ARG1)             FUNC (ARG1)
-#define BUILTIN2(FUNC, ARG1, ARG2)       FUNC (ARG1, ARG2)
-#define BUILTIN3(FUNC, ARG1, ARG2, ARG3) FUNC (ARG1, ARG2, ARG3)
-
-#else
-#define BUILTIN1(FUNC, ARG1)             __builtin_ ## FUNC (ARG1)
-#define BUILTIN2(FUNC, ARG1, ARG2)       __builtin_ ## FUNC (ARG1, ARG2)
-#define BUILTIN3(FUNC, ARG1, ARG2, ARG3) __builtin_ ## FUNC (ARG1, ARG2, ARG3)
-#endif
-
-/* Built-in functions that returns a long double and take one long double
-   argument.  */
-
-void
-return_ld_arg_ld (long double *p,
-		  long double *q)
-{
-  /* { dg-final { scan-assembler {\mbl __acoshieee128} } }  */
-  *p++ = BUILTIN1 (acoshl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __acosieee128} } }  */
-  *p++ = BUILTIN1 (acosl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __asinhieee128} } }  */
-  *p++ = BUILTIN1 (asinhl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __asinieee128} } }  */
-  *p++ = BUILTIN1 (asinl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __atanhieee128} } }  */
-  *p++ = BUILTIN1 (atanhl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __atanieee128} } }  */
-  *p++ = BUILTIN1 (atanl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __cbrtieee128} } }  */
-  *p++ = BUILTIN1 (cbrtl, *q++);
-
-  /* inline code.  */
-  /* { dg-final { scan-assembler {\mxsrqpi +[0-9]+,[0-9]+,[0-9]+,2} } }  */
-  *p++ = BUILTIN1 (ceill, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __coshieee128} } }  */
-  *p++ = BUILTIN1 (coshl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __cosieee128} } }  */
-  *p++ = BUILTIN1 (cosl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __erfcieee128} } }  */
-  *p++ = BUILTIN1 (erfcl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __erfieee128} } }  */
-  *p++ = BUILTIN1 (erfl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __exp10ieee128} } }  */
-  *p++ = BUILTIN1 (exp10l, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __exp2ieee128} } }  */
-  *p++ = BUILTIN1 (exp2l, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __expieee128} } }  */
-  *p++ = BUILTIN1 (expl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __expm1ieee128} } }  */
-  *p++ = BUILTIN1 (expm1l, *q++);
-
-  /* inline code.  */
-  /* { dg-final { scan-assembler {\mxsabsqp} } }  */
-  *p++ = BUILTIN1 (fabsl, *q++);
-
-  /* inline code.  */
-  /* { dg-final { scan-assembler {\mxsrqpi +[0-9]+,[0-9]+,[0-9]+,3} } }  */
-  *p++ = BUILTIN1 (floorl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __lgammaieee128} } }  */
-  *p++ = BUILTIN1 (gammal, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __j0ieee128} } }  */
-  *p++ = BUILTIN1 (j0l, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __j1ieee128} } }  */
-  *p++ = BUILTIN1 (j1l, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __log10ieee128} } }  */
-  *p++ = BUILTIN1 (log10l, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __log1pieee128} } }  */
-  *p++ = BUILTIN1 (log1pl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __log2ieee128} } }  */
-  *p++ = BUILTIN1 (log2l, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __logbieee128} } }  */
-  *p++ = BUILTIN1 (logbl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __logieee128} } }  */
-  *p++ = BUILTIN1 (logl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __nearbyintieee128} } }  */
-  *p++ = BUILTIN1 (nearbyintl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __exp10ieee128} } }  */
-  *p++ = BUILTIN1 (pow10l, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __rintieee128} } }  */
-  *p++ = BUILTIN1 (rintl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __roundevenieee128} } }  */
-  *p++ = BUILTIN1 (roundevenl, *q++);
-
-  /* inline code.  */
-  /* { dg-final { scan-assembler {\mxsrqpi +[0-9]+,[0-9]+,[0-9]+,0} } }  */
-  *p++ = BUILTIN1 (roundl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __significandieee128} } }  */
-  *p++ = BUILTIN1 (significandl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __sinhieee128} } }  */
-  *p++ = BUILTIN1 (sinhl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __sinieee128} } }  */
-  *p++ = BUILTIN1 (sinl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __sqrtieee128} } }  */
-  *p++ = BUILTIN1 (sqrtl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __tanhieee128} } }  */
-  *p++ = BUILTIN1 (tanhl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __tanieee128} } }  */
-  *p++ = BUILTIN1 (tanl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __tgammaieee128} } }  */
-  *p++ = BUILTIN1 (tgammal, *q++);
-
-  /* inline code.  */
-  /* { dg-final { scan-assembler {\mxsrqpi +[0-9]+,[0-9]+,[0-9]+,1} } }  */
-  *p++ = BUILTIN1 (truncl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __y0ieee128} } }  */
-  *p++ = BUILTIN1 (y0l, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __y1ieee128} } }  */
-  *p   = BUILTIN1 (y1l, *q);
-
-}
-
-/* Built-in functions that returns a long double and take two long double
-   arguments.  */
-
-void
-return_ld_arg_ld_ld (long double *p,
-		     long double *q,
-		     long double *r)
-{
-  /* { dg-final { scan-assembler {\mbl __atan2ieee128} } }  */
-  *p++ = BUILTIN2 (atan2l, *q++, *r++);
-
-  /* inline code.  */
-  /* { dg-final { scan-assembler {\mxscpsgnqp} } }  */
-  *p++ = BUILTIN2 (copysignl, *q++, *r++);
-
-  /* { dg-final { scan-assembler {\mbl __remainderieee128} } }  */
-  *p++ = BUILTIN2 (dreml, *q++, *r++);
-
-  /* { dg-final { scan-assembler {\mbl __fdimieee128} } }  */
-  *p++ = BUILTIN2 (fdiml, *q++, *r++);
-
-  /* { dg-final { scan-assembler {\mbl __fmaxieee128} } }  */
-  *p++ = BUILTIN2 (fmaxl, *q++, *r++);
-
-  /* { dg-final { scan-assembler {\mbl __fminieee128} } }  */
-  *p++ = BUILTIN2 (fminl, *q++, *r++);
-
-  /* { dg-final { scan-assembler {\mbl __fmodieee128} } }  */
-  *p++ = BUILTIN2 (fmodl, *q++, *r++);
-
-  /* { dg-final { scan-assembler {\mbl __hypotieee128} } }  */
-  *p++ = BUILTIN2 (hypotl, *q++, *r++);
-
-  /* { dg-final { scan-assembler {\mbl __nextafterieee128} } }  */
-  *p++ = BUILTIN2 (nextafterl, *q++, *r++);
-
-  /* { dg-final { scan-assembler {\mbl __nexttowardieee128} } }  */
-  *p++ = BUILTIN2 (nexttowardl, *q++, *r++);
-
-  /* { dg-final { scan-assembler {\mbl __powieee128} } }  */
-  *p++ = BUILTIN2 (powl, *q++, *r++);
-
-  /* { dg-final { scan-assembler {\mbl __scalbnieee128} } }  */
-  *p   = BUILTIN2 (scalbl, *q, *r);
-}
-
-/* Built-in function that returns a long double and take three long double
-   arguments.  */
-
-void
-return_ld_arg_ld_ld_ld (long double *p,
-			long double *q,
-			long double *r,
-			long double *s)
-{
-  /* inline code.  */
-  /* { dg-final { scan-assembler {\mxsmaddqp} } }  */
-  *p = BUILTIN3 (fmal, *q, *r, *s);
-}
-
-/* Built-in functions that returns a long double and take one
-   _Complex long double argument.  */
-
-void
-return_ld_arg_cld (long double *p,
-		   _Complex long double *q)
-{
-  /* { dg-final { scan-assembler {\mbl __cabsieee128} } }  */
-  *p++ = BUILTIN1 (cabsl, *q++);
-}
-
-/* Built-in functions that returns a _Complex long double and takes one
-   _Complex long double argument.  */
-
-void
-return_cld_arg_cld (_Complex long double *p,
-		    _Complex long double *q)
-{
-  /* { dg-final { scan-assembler {\mbl __cacoshieee128} } }  */
-  *p++ = BUILTIN1 (cacoshl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __cacosieee128} } }  */
-  *p++ = BUILTIN1 (cacosl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __casinhieee128} } }  */
-  *p++ = BUILTIN1 (casinhl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __casinieee128} } }  */
-  *p++ = BUILTIN1 (casinl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __catanhieee128} } }  */
-  *p++ = BUILTIN1 (catanhl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __catanieee128} } }  */
-  *p++ = BUILTIN1 (catanl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __ccoshieee128} } }  */
-  *p++ = BUILTIN1 (ccoshl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __ccosieee128} } }  */
-  *p++ = BUILTIN1 (ccosl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __cexpieee128} } }  */
-  *p++ = BUILTIN1 (cexpl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __clogieee128} } }  */
-  *p++ = BUILTIN1 (clogl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __clog10ieee128} } }  */
-  *p++ = BUILTIN1 (clog10l, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __cprojieee128} } }  */
-  *p++ = BUILTIN1 (cprojl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __csinhieee128} } }  */
-  *p++ = BUILTIN1 (csinhl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __csinieee128} } }  */
-  *p++ = BUILTIN1 (csinl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __csqrtieee128} } }  */
-  *p++ = BUILTIN1 (csqrtl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __ctanhieee128} } }  */
-  *p++ = BUILTIN1 (ctanhl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __ctanieee128} } }  */
-  *p   = BUILTIN1 (ctanl, *q);
-}
-
-/* Built-in functions that returns a _Complex long double and takes one
-   long double argument.  */
-
-void
-return_cld_arg_ld (_Complex long double *p,
-		   long double *q)
-{
-  /* { dg-final { scan-assembler {\mbl __sincosieee128} } }  */
-  *p = BUILTIN1 (cexpil, *q);
-}
-
-/* Built-in function that returns a _Complex long double and takes two
-   _Complex long double arguments.  */
-
-void
-return_cld_arg_cld_cld (_Complex long double *p,
-			_Complex long double *q,
-			_Complex long double *r)
-{
-  /* { dg-final { scan-assembler {\mbl __cpowieee128} } }  */
-  *p = BUILTIN2 (cpowl, *q, *r);
-}
-
-/* Built-in functions that returns a long double and takes a long double and a
-   pointer to an int arguments.  */
-
-void
-return_ld_arg_ld_pi (long double *p,
-		     long double *q,
-		     int **r)
-{
-  /* { dg-final { scan-assembler {\mbl __frexpieee128} } }  */
-  *p++ = BUILTIN2 (frexpl, *q++, *r++);
-
-  /* { dg-final { scan-assembler {\mbl __lgammaieee128_r} } }  */
-  *p++ = BUILTIN2 (gammal_r, *q++, *r++);
-}
-
-/* Built-in functions that returns a long double and takes a long double and an
-   int arguments.  */
-
-void
-return_ld_arg_ld_i (long double *p,
-		    long double *q,
-		    int *r)
-{
-  /* { dg-final { scan-assembler {\mbl __ldexpieee128} } }  */
-  *p++ = BUILTIN2 (ldexpl, *q++, *r++);
-
-  /* { dg-final { scan-assembler {\mbl __powikf2} } }  */
-  *p++ = BUILTIN2 (powil, *q++, *r++);
-
-  /* { dg-final { scan-assembler {\mbl __scalbnieee128} } }  */
-  *p   = BUILTIN2 (scalbnl, *q, *r);
-}
-
-/* Built-in function that returns a long double and takes a long double and a
-   long arguments.  */
-
-void
-return_ld_arg_ld_l (long double *p,
-		    long double *q,
-		    long *r)
-{
-  /* { dg-final { scan-assembler {\mbl __scalblnieee128} } }  */
-  *p = BUILTIN2 (scalblnl, *q, *r);
-}
-
-/* Built-in functions that returns a long double and takes a long double and a
-   long long arguments.  */
-
-void
-return_ld_arg_i_ld (long double *p,
-		    int *q,
-		    long double *r)
-{
-  /* { dg-final { scan-assembler {\mbl __jnieee128} } }  */
-  *p++ = BUILTIN2 (jnl, *q++, *r++);
-
-  /* { dg-final { scan-assembler {\mbl __ynieee128} } }  */
-  *p   = BUILTIN2 (ynl, *q, *r);
-}
-
-/* Built-in functions that returns a long double and takes a long double and a
-   pointer to a long double arguments.  */
-
-void
-return_ld_arg_ld_pld (long double *p,
-		      long double *q,
-		      long double **r)
-{
-  /* { dg-final { scan-assembler {\mbl __modfieee128} } }  */
-  *p = BUILTIN2 (modfl, *q, *r);
-}
-
-/* Built-in function that returns a long double and takes two long double and a
-   pointer to an int arguments.  */
-
-void
-return_ld_arg_ld_ld_pi (long double *p,
-			long double *q,
-			long double *r,
-			int **s)
-{
-  /* { dg-final { scan-assembler {\mbl __remquoieee128} } }  */
-  *p = BUILTIN3 (remquol, *q, *r, *s);
-}
-
-/* Built-in functions that return san int and takes one long double argument.  */
-
-void
-return_i_arg_ld (int *p,
-		 long double *q)
-{
-  /* { dg-final { scan-assembler {\mbl __ceilieee128} } }  */
-  *p++ = BUILTIN1 (iceill, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __floorieee128} } }  */
-  *p++ = BUILTIN1 (ifloorl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __ilogbieee128} } }  */
-  *p++ = BUILTIN1 (ilogbl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __lrintieee128} } }  */
-  *p++ = BUILTIN1 (irintl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __lroundieee128} } }  */
-  *p++ = BUILTIN1 (iroundl, *q++);
-
-  /* inline code.  */
-  /* { dg-final { scan-assembler {\mxscvqpswz} } }  */
-  *p++ = BUILTIN1 (signbitl, *q++);
-}
-
-/* Built-in function that returns a double and takes one double and one long
-   double arguments.  */
-
-void
-return_d_arg_d_ld (double *p,
-		   double *q,
-		   long double *r)
-{
-  /* { dg-final { scan-assembler {\mbl __nexttoward_to_ieee128} } }  */
-  *p = BUILTIN2 (nexttoward, *q, *r);
-}
-
-/* Built-in function that returns a float and takes one float and one long
-   double arguments.  */
-
-void
-return_f_arg_f_ld (float *p,
-		   float *q,
-		   long double *r)
-{
-  /* { dg-final { scan-assembler {\mbl __nexttowardf_to_ieee128} } }  */
-  *p = BUILTIN2 (nexttowardf, *q, *r);
-}
diff --git a/gcc/testsuite/gcc.target/powerpc/float128-longdouble-stdio.c b/gcc/testsuite/gcc.target/powerpc/float128-longdouble-stdio.c
deleted file mode 100644
index 39e59d949f9..00000000000
--- a/gcc/testsuite/gcc.target/powerpc/float128-longdouble-stdio.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* { dg-require-effective-target ppc_float128_hw } */
-/* { dg-options "-mdejagnu-cpu=power9 -O2 -mlong-double-128 -Wno-psabi -mabi=ieeelongdouble" } */
-
-/* Test if switching long double to IEEE 128-bit maps the printf and scanf
-   function names correctly.  We leave off the \M in matching the calls, so
-   power10 will match using bl foo@notoc.  */
-
-#include <stdlib.h>
-
-volatile long double x = 1.0L;
-volatile long double y, z;
-
-int
-main (void)
-{
-  char buffer[100];
-
-  /* { dg-final { scan-assembler {\mbl __sprintfieee128} } }  */
-  __builtin_sprintf (buffer, "%Lg", x);
-
-  /* { dg-final { scan-assembler {\mbl __printfieee128} } }  */
-  __builtin_printf ("x is %Lg [%s]\n", x, buffer);
-
-  /* { dg-final { scan-assembler {\mbl __isoc99_sscanfieee128} } }  */
-  __builtin_sscanf (buffer, "%Lg", &y);
-
-  __builtin_printf ("Type 1.0: ");
-
-  /* { dg-final { scan-assembler {\mbl __isoc99_scanfieee128} } }  */
-  __builtin_scanf ("%Lg", &z);
-
-  if (x != y || x != z)
-    abort ();
-
-  return 0;
-}
diff --git a/gcc/testsuite/gcc.target/powerpc/float128-math.c b/gcc/testsuite/gcc.target/powerpc/float128-math.c
index d1e22239718..4ad3b5b8363 100644
--- a/gcc/testsuite/gcc.target/powerpc/float128-math.c
+++ b/gcc/testsuite/gcc.target/powerpc/float128-math.c
@@ -1,20 +1,20 @@
+/* { dg-do compile { target { powerpc*-*-linux* } } } */
 /* { dg-require-effective-target ppc_float128_sw } */
 /* { dg-require-effective-target vsx_hw } */
-/* { dg-options "-mvsx -O2 -mfloat128 -mlong-double-128 -mabi=ieeelongdouble -Wno-psabi" } */
+/* { dg-options "-mvsx -O2 -mfloat128 -mabi=ieeelongdouble -Wno-psabi" } */
 
 /* Test whether we convert __builtin_<math>l to __builtin_<math>f128 if the
-   default long double type is IEEE 128-bit.  We leave off the \M in matching
-   the calls, so power10 will match using bl foo@notoc.  Also test that using
-   the explicit __builtin_<math>f128 function does not interfere with the
-   __builtin_<math>l function.  */
+   default long double type is IEEE 128-bit.  Also test that using the explicit
+   __builtin_<math>f128 function does not interfere with the __builtin_<math>l
+   function.  */
 
 extern __float128 sinf128 (__float128);
 
-void foo (__float128 *p, long double *q)
+void foo (__float128 *p, long double *q, long double *r)
 {
   *p = sinf128 (*p);
   *q = __builtin_sinl (*q);
 }
 
-/* { dg-final { scan-assembler     {\mbl __sinieee128} } } */
-/* { dg-final { scan-assembler-not {\mbl sinl}         } } */
+/* { dg-final { scan-assembler-times {\mbl sinf128\M} 2 } } */
+/* { dg-final { scan-assembler-not   {\mbl sinl\M}      } } */


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [gcc(refs/users/meissner/heads/work030)] Revert patch.
@ 2020-12-21 18:03 Michael Meissner
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Meissner @ 2020-12-21 18:03 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:b3e4c30c4a8a4915de32ba4967264aeb8f457edb

commit b3e4c30c4a8a4915de32ba4967264aeb8f457edb
Author: Michael Meissner <meissner@linux.ibm.com>
Date:   Mon Dec 21 13:02:36 2020 -0500

    Revert patch.
    
    libgcc/
    2020-12-17  Michael Meissner  <meissner@linux.ibm.com>
    
            Revert.
            * config/rs6000/t-float128 (fp128_dec_funcs): New macro.
            (ibm128_dec_funcs): New macro.
            (fp128_ppc_funcs): Add the Decimal <-> __float128 conversions.
            (fp128_dec_objs): Force Decimal <-> __float128 conversions to be
            compiled with -mabi=ieeelongdouble.
            (ibm128_dec_objs): Force Decimal <-> __float128 conversions to be
            compiled with -mabi=ieeelongdouble.
            (FP128_CFLAGS_DECIMAL): New macro.
            (IBM128_CFLAGS_DECIMAL): New macro.
            * config/rs6000/_dd_to_kf.c: New file.
            * config/rs6000/_kf_to_dd.c: New file.
            * config/rs6000/_kf_to_sd.c: New file.
            * config/rs6000/_kf_to_td.c: New file.
            * config/rs6000/_sd_to_kf.c: New file.
            * config/rs6000/_td_to_kf.c: New file.

Diff:
---
 libgcc/config/rs6000/_dd_to_kf.c | 58 ---------------------------------------
 libgcc/config/rs6000/_kf_to_dd.c | 57 --------------------------------------
 libgcc/config/rs6000/_kf_to_sd.c | 58 ---------------------------------------
 libgcc/config/rs6000/_kf_to_td.c | 56 --------------------------------------
 libgcc/config/rs6000/_sd_to_kf.c | 59 ----------------------------------------
 libgcc/config/rs6000/_td_to_kf.c | 58 ---------------------------------------
 libgcc/config/rs6000/t-float128  | 26 +-----------------
 7 files changed, 1 insertion(+), 371 deletions(-)

diff --git a/libgcc/config/rs6000/_dd_to_kf.c b/libgcc/config/rs6000/_dd_to_kf.c
deleted file mode 100644
index 93601fa280e..00000000000
--- a/libgcc/config/rs6000/_dd_to_kf.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Copyright (C) 1989-2020 Free Software Foundation, Inc.
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 3, or (at your option) any later
-version.
-
-GCC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-for more details.
-
-Under Section 7 of GPL version 3, you are granted additional
-permissions described in the GCC Runtime Library Exception, version
-3.1, as published by the Free Software Foundation.
-
-You should have received a copy of the GNU General Public License and
-a copy of the GCC Runtime Library Exception along with this program;
-see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
-<http://www.gnu.org/licenses/>.  */
-
-/* Decimal64 -> _Float128 conversion.  */
-
-/* FINE_GRAINED_LIBRARIES is used so we can isolate just to dd_to_tf conversion
-   function from dp-bits.c.  */
-#define FINE_GRAINED_LIBRARIES	1
-#define L_dd_to_tf		1
-#define WIDTH			64
-
-#if !defined(__LONG_DOUBLE_128__) || !defined(__LONG_DOUBLE_IEEE128__)
-#error "Long double is not IEEE 128-bit"
-#endif
-
-/* If we don't have at least GLIBC 2.32, the strtold used by dfp-bit.c does not
-   have support for float128.  Add an abort in case this is called.  */
-#include <features.h>
-
-#if ((__GLIBC__ * 1000) + __GLIBC_MINOR__) < 2032
-
-#include <stdlib.h>
-extern long double __dpd_extendddkf (_Decimal64);
-
-long double
-__dpd_extendddkf (_Decimal64 x __attribute__ ((unused)))
-{
-  abort ();
-}
-
-#else
-
-/* Map the external name to the float128 default.  */
-#define __dpd_extendddtf	__dpd_extendddkf
-
-/* Use dfp-bit.c to do the real work.  */
-#include "dfp-bit.c"
-#endif
diff --git a/libgcc/config/rs6000/_kf_to_dd.c b/libgcc/config/rs6000/_kf_to_dd.c
deleted file mode 100644
index fa4cc7e1716..00000000000
--- a/libgcc/config/rs6000/_kf_to_dd.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Copyright (C) 1989-2020 Free Software Foundation, Inc.
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 3, or (at your option) any later
-version.
-
-GCC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-for more details.
-
-Under Section 7 of GPL version 3, you are granted additional
-permissions described in the GCC Runtime Library Exception, version
-3.1, as published by the Free Software Foundation.
-
-You should have received a copy of the GNU General Public License and
-a copy of the GCC Runtime Library Exception along with this program;
-see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
-<http://www.gnu.org/licenses/>.  */
-
-/* _Float128 -> Decimal64 conversion.  */
-
-/* FINE_GRAINED_LIBRARIES is used so we can isolate just to tf_to_dd conversion
-   function from dp-bits.c.  */
-#define FINE_GRAINED_LIBRARIES	1
-#define L_tf_to_dd		1
-#define WIDTH			64
-
-#if !defined(__LONG_DOUBLE_128__) || !defined(__LONG_DOUBLE_IEEE128__)
-#error "Long double is not IEEE 128-bit"
-#endif
-
-/* If we don't have at least GLIBC 2.32, the strtold used by dfp-bit.c does not
-   have support for float128.  Add an abort in case this is called.  */
-#include <features.h>
-
-#if ((__GLIBC__ * 1000) + __GLIBC_MINOR__) < 2032
-
-#include <stdlib.h>
-extern _Decimal64 __dpd_trunckfdd (long double);
-
-_Decimal64
-__dpd_trunckfdd (long double x __attribute__ ((unused)))
-{
-  abort ();
-}
-
-#else
-/* Map the external name to the float128 default.  */
-#define __dpd_trunctfdd		__dpd_trunckfdd
-
-/* Use dfp-bit.c to do the real work.  */
-#include "dfp-bit.c"
-#endif
diff --git a/libgcc/config/rs6000/_kf_to_sd.c b/libgcc/config/rs6000/_kf_to_sd.c
deleted file mode 100644
index ec92d697f84..00000000000
--- a/libgcc/config/rs6000/_kf_to_sd.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Copyright (C) 1989-2020 Free Software Foundation, Inc.
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 3, or (at your option) any later
-version.
-
-GCC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-for more details.
-
-Under Section 7 of GPL version 3, you are granted additional
-permissions described in the GCC Runtime Library Exception, version
-3.1, as published by the Free Software Foundation.
-
-You should have received a copy of the GNU General Public License and
-a copy of the GCC Runtime Library Exception along with this program;
-see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
-<http://www.gnu.org/licenses/>.  */
-
-/* _Float128 -> Decimal32 conversion.  */
-
-/* FINE_GRAINED_LIBRARIES is used so we can isolate just to tf_to_sd conversion
-   function from dp-bits.c.  */
-#define FINE_GRAINED_LIBRARIES	1
-#define L_tf_to_sd		1
-#define WIDTH			32
-
-#if !defined(__LONG_DOUBLE_128__) || !defined(__LONG_DOUBLE_IEEE128__)
-#error "Long double is not IEEE 128-bit"
-#endif
-
-/* If we don't have at least GLIBC 2.32, the strtold used by dfp-bit.c does not
-   have support for float128.  Add an abort in case this is called.  */
-#include <features.h>
-
-#if ((__GLIBC__ * 1000) + __GLIBC_MINOR__) < 2032
-
-#include <stdlib.h>
-extern _Decimal32 __dpd_extendkfsd (long double);
-
-_Decimal32
-__dpd_extendkfsd (long double x __attribute__ ((unused)))
-{
-  abort ();
-}
-
-#else
-
-/* Map the external name to the float128 default.  */
-#define __dpd_trunctfsd	__dpd_trunckfsd
-
-/* Use dfp-bit.c to do the real work.  */
-#include "dfp-bit.c"
-#endif
diff --git a/libgcc/config/rs6000/_kf_to_td.c b/libgcc/config/rs6000/_kf_to_td.c
deleted file mode 100644
index 9a8f65647ea..00000000000
--- a/libgcc/config/rs6000/_kf_to_td.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Copyright (C) 1989-2020 Free Software Foundation, Inc.
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 3, or (at your option) any later
-version.
-
-GCC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-for more details.
-
-Under Section 7 of GPL version 3, you are granted additional
-permissions described in the GCC Runtime Library Exception, version
-3.1, as published by the Free Software Foundation.
-
-You should have received a copy of the GNU General Public License and
-a copy of the GCC Runtime Library Exception along with this program;
-see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
-<http://www.gnu.org/licenses/>.  */
-
-/* _Float128 -> Decimal128 conversion.  */
-
-/* FINE_GRAINED_LIBRARIES is used so we can isolate just to tf_to_td conversion
-   function from dp-bits.c.  */
-#define FINE_GRAINED_LIBRARIES	1
-#define L_tf_to_td		1
-#define WIDTH			128
-
-#if !defined(__LONG_DOUBLE_128__) || !defined(__LONG_DOUBLE_IEEE128__)
-#error "Long double is not IEEE 128-bit"
-#endif
-
-/* If we don't have at least GLIBC 2.32, the strtold used by dfp-bit.c does not
-   have support for float128.  Add an abort in case this is called.  */
-#include <features.h>
-
-#if ((__GLIBC__ * 1000) + __GLIBC_MINOR__) < 2032
-
-extern _Decimal128 __dpd_extendkftd (long double);
-
-_Decimal128
-__dpd_extendkftd (long double x __attribute__ ((unused)))
-{
-  abort ();
-}
-
-#else
-/* Map the external name to the float128 default.  */
-#define __dpd_extendtftd	__dpd_extendkftd
-
-/* Use dfp-bit.c to do the real work.  */
-#include "dfp-bit.c"
-#endif
diff --git a/libgcc/config/rs6000/_sd_to_kf.c b/libgcc/config/rs6000/_sd_to_kf.c
deleted file mode 100644
index 3c2f04d3f78..00000000000
--- a/libgcc/config/rs6000/_sd_to_kf.c
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Copyright (C) 1989-2020 Free Software Foundation, Inc.
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 3, or (at your option) any later
-version.
-
-GCC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-for more details.
-
-Under Section 7 of GPL version 3, you are granted additional
-permissions described in the GCC Runtime Library Exception, version
-3.1, as published by the Free Software Foundation.
-
-You should have received a copy of the GNU General Public License and
-a copy of the GCC Runtime Library Exception along with this program;
-see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
-<http://www.gnu.org/licenses/>.  */
-
-/* Decimal32 -> _Float128 conversion.  */
-
-/* FINE_GRAINED_LIBRARIES is used so we can isolate just to sd_to_tf conversion
-   function from dp-bits.c.  */
-#define FINE_GRAINED_LIBRARIES	1
-#define L_sd_to_tf		1
-#define WIDTH			32
-
-#if !defined(__LONG_DOUBLE_128__) || !defined(__LONG_DOUBLE_IEEE128__)
-#error "Long double is not IEEE 128-bit"
-#endif
-
-/* If we don't have at least GLIBC 2.32, the strtold used by dfp-bit.c does not
-   have support for float128.  Add an abort in case this is called.  */
-#include <features.h>
-
-#if ((__GLIBC__ * 1000) + __GLIBC_MINOR__) < 2032
-
-#include <stdlib.h>
-extern long double __dpd_extendsdkf (_Decimal32);
-
-long double
-__dpd_extendsdkf (_Decimal32 x __attribute__ ((unused)))
-{
-  abort ();
-}
-
-#else
-
-
-/* Map the external name to the float128 default.  */
-#define __dpd_extendsdtf	__dpd_extendsdkf
-
-/* Use dfp-bit.c to do the real work.  */
-#include "dfp-bit.c"
-#endif
diff --git a/libgcc/config/rs6000/_td_to_kf.c b/libgcc/config/rs6000/_td_to_kf.c
deleted file mode 100644
index 26eefabdabc..00000000000
--- a/libgcc/config/rs6000/_td_to_kf.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Copyright (C) 1989-2020 Free Software Foundation, Inc.
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 3, or (at your option) any later
-version.
-
-GCC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-for more details.
-
-Under Section 7 of GPL version 3, you are granted additional
-permissions described in the GCC Runtime Library Exception, version
-3.1, as published by the Free Software Foundation.
-
-You should have received a copy of the GNU General Public License and
-a copy of the GCC Runtime Library Exception along with this program;
-see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
-<http://www.gnu.org/licenses/>.  */
-
-/* Decimal128 -> _Float128 conversion.  */
-
-/* FINE_GRAINED_LIBRARIES is used so we can isolate just to td_to_tf conversion
-   function from dp-bits.c.  */
-#define FINE_GRAINED_LIBRARIES	1
-#define L_td_to_tf		1
-#define WIDTH			128
-
-#if !defined(__LONG_DOUBLE_128__) || !defined(__LONG_DOUBLE_IEEE128__)
-#error "Long double is not IEEE 128-bit"
-#endif
-
-/* If we don't have at least GLIBC 2.32, the strtold used by dfp-bit.c does not
-   have support for float128.  Add an abort in case this is called.  */
-#include <features.h>
-
-#if ((__GLIBC__ * 1000) + __GLIBC_MINOR__) < 2032
-
-#include <stdlib.h>
-extern long double __dpd_trunctdkf (_Decimal128);
-
-long double
-__dpd_trunctdkf (_Decimal128 x __attribute__ ((unused)))
-{
-  abort ();
-}
-
-#else
-
-/* Map the external name to the float128 default.  */
-#define __dpd_trunctdtf	__dpd_trunctdkf
-
-/* Use dfp-bit.c to do the real work.  */
-#include "dfp-bit.c"
-#endif
diff --git a/libgcc/config/rs6000/t-float128 b/libgcc/config/rs6000/t-float128
index 8b089d4433c..d5413445189 100644
--- a/libgcc/config/rs6000/t-float128
+++ b/libgcc/config/rs6000/t-float128
@@ -22,19 +22,10 @@ fp128_softfp_static_obj	= $(addsuffix -sw$(objext),$(fp128_softfp_funcs))
 fp128_softfp_shared_obj	= $(addsuffix -sw_s$(objext),$(fp128_softfp_funcs))
 fp128_softfp_obj	= $(fp128_softfp_static_obj) $(fp128_softfp_shared_obj)
 
-# Decimal <-> _Float128 conversions
-fp128_dec_funcs		= _kf_to_sd _kf_to_dd _kf_to_td \
-			  _sd_to_kf _dd_to_kf _td_to_kf
-
-# Decimal <-> __ibm128 conversions
-ibm128_dec_funcs	= _tf_to_sd _tf_to_dd _tf_to_td \
-			  _sd_to_tf _dd_to_tf _td_to_tf
-
 # New functions for software emulation
 fp128_ppc_funcs		= floattikf floatuntikf fixkfti fixunskfti \
 			  extendkftf2-sw trunctfkf2-sw \
-			  sfp-exceptions _mulkc3 _divkc3 _powikf2 \
-			  $(fp128_dec_funcs)
+			  sfp-exceptions _mulkc3 _divkc3 _powikf2
 
 fp128_ppc_src		= $(addprefix $(srcdir)/config/rs6000/,$(addsuffix \
 				.c,$(fp128_ppc_funcs)))
@@ -78,21 +69,6 @@ $(fp128_ppc_obj)	 : INTERNAL_CFLAGS += $(FP128_CFLAGS_SW)
 $(fp128_obj)		 : $(fp128_includes)
 $(fp128_obj)		 : $(srcdir)/config/rs6000/quad-float128.h
 
-# Force the TF mode to/from decimal functions to be compiled with IBM long
-# double.  Add building the KF mode to/from decimal conversions with explict
-# IEEE long double.
-fp128_dec_objs		= $(addsuffix $(objext),$(fp128_dec_funcs)) \
-			  $(addsuffix _s$(objext),$(fp128_dec_funcs))
-
-ibm128_dec_objs		= $(addsuffix $(objext),$(ibm128_dec_funcs)) \
-			  $(addsuffix _s$(objext),$(ibm128_dec_funcs))
-
-FP128_CFLAGS_DECIMAL	= -mno-gnu-attribute -Wno-psabi -mabi=ieeelongdouble
-IBM128_CFLAGS_DECIMAL	= -mno-gnu-attribute -Wno-psabi -mabi=ibmlongdouble
-
-$(fp128_dec_objs)	: INTERNAL_CFLAGS += $(FP128_CFLAGS_DECIMAL)
-$(ibm128_dec_objs)	: INTERNAL_CFLAGS += $(IBM128_CFLAGS_DECIMAL)
-
 $(fp128_softfp_src) : $(srcdir)/soft-fp/$(subst -sw,,$(subst kf,tf,$@)) $(fp128_dep)
 	@src="$(srcdir)/soft-fp/$(subst -sw,,$(subst kf,tf,$@))"; \
 	echo "Create $@"; \


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [gcc(refs/users/meissner/heads/work030)] Revert patch
@ 2020-12-18  1:18 Michael Meissner
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Meissner @ 2020-12-18  1:18 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:71a44122115abe611c38e57df10e06e81263f9e7

commit 71a44122115abe611c38e57df10e06e81263f9e7
Author: Michael Meissner <meissner@linux.ibm.com>
Date:   Thu Dec 17 20:18:05 2020 -0500

    Revert patch
    
    gcc/
    2020-12-17  Michael Meissner  <meissner@linux.ibm.com>
    
            Revert
            * config/rs6000/rs6000.c (ieee128_builtin_name): New function.
            (built_in_uses_long_double): New function.
            (rs6000_mangle_decl_assembler_name): Update support for mapping built-in
            function names for long double built-in functions if long double is
            IEEE 128-bit to catch all of the built-in functions that take or
            return long double arguments.
    
    gcc/testsuite/
    2020-12-17  Michael Meissner  <meissner@linux.ibm.com>
    
            Revert
            * gcc.target/powerpc/float128-longdouble-math.c: New test.
            * gcc.target/powerpc/float128-longdouble-stdio.c: New test.
            * gcc.target/powerpc/float128-math.c: Adjust test for new name
            being generated.  Add support for running test on power10.  Add
            support for running if long double defaults to 64-bits.

Diff:
---
 gcc/config/rs6000/rs6000.c                         | 231 ++---------
 .../gcc.target/powerpc/float128-longdouble-math.c  | 442 ---------------------
 .../gcc.target/powerpc/float128-longdouble-stdio.c |  36 --
 gcc/testsuite/gcc.target/powerpc/float128-math.c   |  16 +-
 4 files changed, 45 insertions(+), 680 deletions(-)

diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 9a368c341d1..72f5d4250b5 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -27095,162 +27095,6 @@ rs6000_globalize_decl_name (FILE * stream, tree decl)
 #endif
 
 \f
-/* If long double uses the IEEE 128-bit representation, return the name used
-   within GLIBC for the IEEE 128-bit long double built-in, instead of the
-   default IBM 128-bit long double built-in.  Or return NULL if the built-in
-   function does not use long double.  */
-
-static const char *
-ieee128_builtin_name (built_in_function fn)
-{
-  switch (fn)
-    {
-    default:			return NULL;
-    case BUILT_IN_ACOSHL:	return "__acoshieee128";
-    case BUILT_IN_ACOSL:	return "__acosieee128";
-    case BUILT_IN_ASINHL:	return "__asinhieee128";
-    case BUILT_IN_ASINL:	return "__asinieee128";
-    case BUILT_IN_ATAN2L:	return "__atan2ieee128";
-    case BUILT_IN_ATANHL:	return "__atanhieee128";
-    case BUILT_IN_ATANL:	return "__atanieee128";
-    case BUILT_IN_CABSL:	return "__cabsieee128";
-    case BUILT_IN_CACOSHL:	return "__cacoshieee128";
-    case BUILT_IN_CACOSL:	return "__cacosieee128";
-    case BUILT_IN_CARGL:	return "__cargieee128";
-    case BUILT_IN_CASINHL:	return "__casinhieee128";
-    case BUILT_IN_CASINL:	return "__casinieee128";
-    case BUILT_IN_CATANHL:	return "__catanhieee128";
-    case BUILT_IN_CATANL:	return "__catanieee128";
-    case BUILT_IN_CBRTL:	return "__cbrtieee128";
-    case BUILT_IN_CCOSHL:	return "__ccoshieee128";
-    case BUILT_IN_CCOSL:	return "__ccosieee128";
-    case BUILT_IN_CEILL:	return "__ceilieee128";
-    case BUILT_IN_CEXPL:	return "__cexpieee128";
-    case BUILT_IN_CIMAGL:	return "__cimagieee128";
-    case BUILT_IN_CLOG10L:	return "__clog10ieee128";
-    case BUILT_IN_CLOGL:	return "__clogieee128";
-    case BUILT_IN_CONJL:	return "__conjieee128";
-    case BUILT_IN_COPYSIGNL:	return "__copysignieee128";
-    case BUILT_IN_COSHL:	return "__coshieee128";
-    case BUILT_IN_COSL:		return "__cosieee128";
-    case BUILT_IN_CPOWL:	return "__cpowieee128";
-    case BUILT_IN_CPROJL:	return "__cprojieee128";
-    case BUILT_IN_CREALL:	return "__crealieee128";
-    case BUILT_IN_CSINHL:	return "__csinhieee128";
-    case BUILT_IN_CSINL:	return "__csinieee128";
-    case BUILT_IN_CSQRTL:	return "__csqrtieee128";
-    case BUILT_IN_CTANHL:	return "__ctanhieee128";
-    case BUILT_IN_CTANL:	return "__ctanieee128";
-    case BUILT_IN_DREML:	return "__remainderieee128";
-    case BUILT_IN_ERFCL:	return "__erfcieee128";
-    case BUILT_IN_ERFL:		return "__erfieee128";
-    case BUILT_IN_EXP10L:	return "__exp10ieee128";
-    case BUILT_IN_EXP2L:	return "__exp2ieee128";
-    case BUILT_IN_EXPL:		return "__expieee128";
-    case BUILT_IN_EXPM1L:	return "__expm1ieee128";
-    case BUILT_IN_FABSL:	return "__fabsieee128";
-    case BUILT_IN_FDIML:	return "__fdimieee128";
-    case BUILT_IN_FINITEL:	return "__finiteieee128";
-    case BUILT_IN_FLOORL:	return "__floorieee128";
-    case BUILT_IN_FMAL:		return "__fmaieee128";
-    case BUILT_IN_FMAXL:	return "__fmaxieee128";
-    case BUILT_IN_FMINL:	return "__fminieee128";
-    case BUILT_IN_FMODL:	return "__fmodieee128";
-    case BUILT_IN_FPRINTF:	return "__fprintfieee128";
-    case BUILT_IN_FREXPL:	return "__frexpieee128";
-    case BUILT_IN_FSCANF:	return "__isoc99_fscanfieee128";
-    case BUILT_IN_GAMMAL:	return "__lgammaieee128";
-    case BUILT_IN_GAMMAL_R:	return "__lgammaieee128_r";
-    case BUILT_IN_HYPOTL:	return "__hypotieee128";
-    case BUILT_IN_ILOGBL:	return "__ilogbieee128";
-    case BUILT_IN_ISINFL:	return "__isinfieee128";
-    case BUILT_IN_ISNANL:	return "__isnanieee128";
-    case BUILT_IN_J0L:		return "__j0ieee128";
-    case BUILT_IN_J1L:		return "__j1ieee128";
-    case BUILT_IN_JNL:		return "__jnieee128";
-    case BUILT_IN_LDEXPL:	return "__ldexpieee128";
-    case BUILT_IN_LGAMMAL:	return "__lgammaieee128";
-    case BUILT_IN_LGAMMAL_R:	return "__lgammaieee128_r";
-    case BUILT_IN_LLRINTL:	return "__llrintieee128";
-    case BUILT_IN_LLROUNDL:	return "__llroundieee128";
-    case BUILT_IN_LOG10L:	return "__log10ieee128";
-    case BUILT_IN_LOG1PL:	return "__log1pieee128";
-    case BUILT_IN_LOG2L:	return "__log2ieee128";
-    case BUILT_IN_LOGBL:	return "__logbieee128";
-    case BUILT_IN_LOGL:		return "__logieee128";
-    case BUILT_IN_LRINTL:	return "__lrintieee128";
-    case BUILT_IN_LROUNDL:	return "__lroundieee128";
-    case BUILT_IN_MODFL:	return "__modfieee128";
-    case BUILT_IN_NEARBYINTL:	return "__nearbyintieee128";
-    case BUILT_IN_NEXTAFTERL:	return "__nextafterieee128";
-    case BUILT_IN_NEXTTOWARD:	return "__nexttoward_to_ieee128";
-    case BUILT_IN_NEXTTOWARDF:	return "__nexttowardf_to_ieee128";
-    case BUILT_IN_NEXTTOWARDL:	return "__nexttowardieee128";
-    case BUILT_IN_POW10L:	return "__exp10ieee128";
-    case BUILT_IN_POWL:		return "__powieee128";
-    case BUILT_IN_PRINTF:	return "__printfieee128";
-    case BUILT_IN_REMAINDERL:	return "__remainderieee128";
-    case BUILT_IN_REMQUOL:	return "__remquoieee128";
-    case BUILT_IN_RINTL:	return "__rintieee128";
-    case BUILT_IN_ROUNDEVENL:	return "__roundevenieee128";
-    case BUILT_IN_ROUNDL:	return "__roundieee128";
-    case BUILT_IN_SCALBL:	return "__scalbieee128";
-    case BUILT_IN_SCALBLNL:	return "__scalblnieee128";
-    case BUILT_IN_SCALBNL:	return "__scalbnieee128";
-    case BUILT_IN_SCANF:	return "__isoc99_scanfieee128";
-    case BUILT_IN_SIGNBITL:	return "__signbitieee128";
-    case BUILT_IN_SIGNIFICANDL:	return "__significandieee128";
-    case BUILT_IN_SINCOSL:	return "__sincosieee128";
-    case BUILT_IN_SINHL:	return "__sinhieee128";
-    case BUILT_IN_SINL:		return "__sinieee128";
-    case BUILT_IN_SNPRINTF:	return "__snprintfieee128";
-    case BUILT_IN_SPRINTF:	return "__sprintfieee128";
-    case BUILT_IN_SQRTL:	return "__sqrtieee128";
-    case BUILT_IN_SSCANF:	return "__isoc99_sscanfieee128";
-    case BUILT_IN_TANHL:	return "__tanhieee128";
-    case BUILT_IN_TANL:		return "__tanieee128";
-    case BUILT_IN_TGAMMAL:	return "__tgammaieee128";
-    case BUILT_IN_TRUNCL:	return "__truncieee128";
-    case BUILT_IN_VFPRINTF:	return "__vfprintfieee128";
-    case BUILT_IN_VFSCANF:	return "__isoc99_vfscanfieee128";
-    case BUILT_IN_VPRINTF:	return "__vprintfieee128";
-    case BUILT_IN_VSCANF:	return "__isoc99_vscanfieee128";
-    case BUILT_IN_VSNPRINTF:	return "__vsnprintfieee128";
-    case BUILT_IN_VSPRINTF:	return "__vsprintfieee128";
-    case BUILT_IN_VSSCANF:	return "__isoc99_vsscanfieee128";
-    case BUILT_IN_Y0L:		return "__y0ieee128";
-    case BUILT_IN_Y1L:		return "__y1ieee128";
-    case BUILT_IN_YNL:		return "__ynieee128";
-    }
-}
-
-#if ENABLE_ASSERT_CHECKING
-/* Return true if a built-in function returns or passes a long double type.  */
-static bool
-built_in_uses_long_double (tree decl)
-{
-  tree type = TREE_TYPE (decl);
-  machine_mode ret_mode = TYPE_MODE (type);
-
-  /* See if the function returns a long double type.  */
-  if (ret_mode == TFmode || ret_mode == TCmode)
-    return true;
-
-  function_args_iterator args_iter;
-  tree arg;
-
-  /* See if the function passes a long double type.  */
-  FOREACH_FUNCTION_ARGS (type, arg, args_iter)
-    {
-      machine_mode arg_mode = TYPE_MODE (arg);
-      if (arg_mode == TFmode || arg_mode == TCmode)
-	return true;
-    }
-
-  return false;
-}
-#endif
-
 /* On 64-bit Linux and Freebsd systems, possibly switch the long double library
    function names from <foo>l to <foo>f128 if the default long double type is
    IEEE 128-bit.  Typically, with the C and C++ languages, the standard math.h
@@ -27271,52 +27115,51 @@ built_in_uses_long_double (tree decl)
 static tree
 rs6000_mangle_decl_assembler_name (tree decl, tree id)
 {
-  if (TARGET_FLOAT128_TYPE && TARGET_IEEEQUAD && TARGET_LONG_DOUBLE_128
+  if (!TARGET_IEEEQUAD_DEFAULT && TARGET_IEEEQUAD && TARGET_LONG_DOUBLE_128
       && TREE_CODE (decl) == FUNCTION_DECL
-      && DECL_IS_UNDECLARED_BUILTIN (decl)
-      && DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL)
+      && DECL_IS_UNDECLARED_BUILTIN (decl))
     {
+      size_t len = IDENTIFIER_LENGTH (id);
       const char *name = IDENTIFIER_POINTER (id);
-      const char *ieee_name = ieee128_builtin_name (DECL_FUNCTION_CODE (decl));
-      tree id_orig = id;
-
-      if (ieee_name)
-	id = get_identifier (ieee_name);
-
-      /* If we have checking enabled, see if any additional long double built-in
-	 functions were added.  We check for *printf functions, *scanf
-	 functions, and *l/*l_r functions that have explicit long double or
-	 Complex long double arguments or returns.  If the warning is printed,
-	 you need to update ieee128_builtin_name with the new built-in
-	 functions.  */
-#if ENABLE_ASSERT_CHECKING
-      else
-	{
-	  size_t len = IDENTIFIER_LENGTH (id);
-	  size_t printf_len = strlen ("printf");
-	  size_t scanf_len = strlen ("scanf");
-	  size_t l_r_len = strlen ("l_r");
 
-	  if (len >= printf_len
-	      && strcmp (name + len - printf_len, "printf") == 0)
-	    warning (0, "No IEEE 128-bit %qs built-in function", name);
+      if (name[len - 1] == 'l')
+	{
+	  bool uses_ieee128_p = false;
+	  tree type = TREE_TYPE (decl);
+	  machine_mode ret_mode = TYPE_MODE (type);
 
-	  else if (len >= scanf_len
-		   && strcmp (name + len - scanf_len, "scanf") == 0)
-	    warning (0, "No IEEE 128-bit %qs built-in function", name);
+	  /* See if the function returns a IEEE 128-bit floating point type or
+	     complex type.  */
+	  if (ret_mode == TFmode || ret_mode == TCmode)
+	    uses_ieee128_p = true;
+	  else
+	    {
+	      function_args_iterator args_iter;
+	      tree arg;
 
-	  else if (name[len - 1] == 'l' && built_in_uses_long_double (decl))
-	    warning (0, "No IEEE 128-bit %qs built-in function", name);
+	      /* See if the function passes a IEEE 128-bit floating point type
+		 or complex type.  */
+	      FOREACH_FUNCTION_ARGS (type, arg, args_iter)
+		{
+		  machine_mode arg_mode = TYPE_MODE (arg);
+		  if (arg_mode == TFmode || arg_mode == TCmode)
+		    {
+		      uses_ieee128_p = true;
+		      break;
+		    }
+		}
+	    }
 
-	  else if (len >= l_r_len
-		   && strcmp (name + len - l_r_len, "l_r") == 0
-		   && built_in_uses_long_double (decl))
-	    warning (0, "No IEEE 128-bit %qs built-in function", name);
+	  /* If we passed or returned an IEEE 128-bit floating point type,
+	     change the name.  */
+	  if (uses_ieee128_p)
+	    {
+	      char *name2 = (char *) alloca (len + 4);
+	      memcpy (name2, name, len - 1);
+	      strcpy (name2 + len - 1, "f128");
+	      id = get_identifier (name2);
+	    }
 	}
-#endif
-
-      if (id != id_orig && TARGET_DEBUG_BUILTIN)
-	fprintf (stderr, "Map %s => %s\n", name, IDENTIFIER_POINTER (id));
     }
 
   return id;
diff --git a/gcc/testsuite/gcc.target/powerpc/float128-longdouble-math.c b/gcc/testsuite/gcc.target/powerpc/float128-longdouble-math.c
deleted file mode 100644
index 07934bb7357..00000000000
--- a/gcc/testsuite/gcc.target/powerpc/float128-longdouble-math.c
+++ /dev/null
@@ -1,442 +0,0 @@
-/* { dg-require-effective-target ppc_float128_hw } */
-/* { dg-options "-mdejagnu-cpu=power9 -O2 -mlong-double-128 -Wno-psabi -mabi=ieeelongdouble" } */
-
-/* Test if switching long double to IEEE 128-bit maps all of the math built-in
-   function names correctly.  We leave off the \M in matching the calls, so
-   power10 will match using bl foo@notoc.  */
-
-#ifdef DO_FUNC
-#define BUILTIN1(FUNC, ARG1)             FUNC (ARG1)
-#define BUILTIN2(FUNC, ARG1, ARG2)       FUNC (ARG1, ARG2)
-#define BUILTIN3(FUNC, ARG1, ARG2, ARG3) FUNC (ARG1, ARG2, ARG3)
-
-#else
-#define BUILTIN1(FUNC, ARG1)             __builtin_ ## FUNC (ARG1)
-#define BUILTIN2(FUNC, ARG1, ARG2)       __builtin_ ## FUNC (ARG1, ARG2)
-#define BUILTIN3(FUNC, ARG1, ARG2, ARG3) __builtin_ ## FUNC (ARG1, ARG2, ARG3)
-#endif
-
-/* Built-in functions that returns a long double and take one long double
-   argument.  */
-
-void
-return_ld_arg_ld (long double *p,
-		  long double *q)
-{
-  /* { dg-final { scan-assembler {\mbl __acoshieee128} } }  */
-  *p++ = BUILTIN1 (acoshl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __acosieee128} } }  */
-  *p++ = BUILTIN1 (acosl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __asinhieee128} } }  */
-  *p++ = BUILTIN1 (asinhl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __asinieee128} } }  */
-  *p++ = BUILTIN1 (asinl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __atanhieee128} } }  */
-  *p++ = BUILTIN1 (atanhl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __atanieee128} } }  */
-  *p++ = BUILTIN1 (atanl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __cbrtieee128} } }  */
-  *p++ = BUILTIN1 (cbrtl, *q++);
-
-  /* inline code.  */
-  /* { dg-final { scan-assembler {\mxsrqpi +[0-9]+,[0-9]+,[0-9]+,2} } }  */
-  *p++ = BUILTIN1 (ceill, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __coshieee128} } }  */
-  *p++ = BUILTIN1 (coshl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __cosieee128} } }  */
-  *p++ = BUILTIN1 (cosl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __erfcieee128} } }  */
-  *p++ = BUILTIN1 (erfcl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __erfieee128} } }  */
-  *p++ = BUILTIN1 (erfl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __exp10ieee128} } }  */
-  *p++ = BUILTIN1 (exp10l, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __exp2ieee128} } }  */
-  *p++ = BUILTIN1 (exp2l, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __expieee128} } }  */
-  *p++ = BUILTIN1 (expl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __expm1ieee128} } }  */
-  *p++ = BUILTIN1 (expm1l, *q++);
-
-  /* inline code.  */
-  /* { dg-final { scan-assembler {\mxsabsqp} } }  */
-  *p++ = BUILTIN1 (fabsl, *q++);
-
-  /* inline code.  */
-  /* { dg-final { scan-assembler {\mxsrqpi +[0-9]+,[0-9]+,[0-9]+,3} } }  */
-  *p++ = BUILTIN1 (floorl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __lgammaieee128} } }  */
-  *p++ = BUILTIN1 (gammal, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __j0ieee128} } }  */
-  *p++ = BUILTIN1 (j0l, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __j1ieee128} } }  */
-  *p++ = BUILTIN1 (j1l, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __log10ieee128} } }  */
-  *p++ = BUILTIN1 (log10l, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __log1pieee128} } }  */
-  *p++ = BUILTIN1 (log1pl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __log2ieee128} } }  */
-  *p++ = BUILTIN1 (log2l, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __logbieee128} } }  */
-  *p++ = BUILTIN1 (logbl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __logieee128} } }  */
-  *p++ = BUILTIN1 (logl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __nearbyintieee128} } }  */
-  *p++ = BUILTIN1 (nearbyintl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __exp10ieee128} } }  */
-  *p++ = BUILTIN1 (pow10l, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __rintieee128} } }  */
-  *p++ = BUILTIN1 (rintl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __roundevenieee128} } }  */
-  *p++ = BUILTIN1 (roundevenl, *q++);
-
-  /* inline code.  */
-  /* { dg-final { scan-assembler {\mxsrqpi +[0-9]+,[0-9]+,[0-9]+,0} } }  */
-  *p++ = BUILTIN1 (roundl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __significandieee128} } }  */
-  *p++ = BUILTIN1 (significandl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __sinhieee128} } }  */
-  *p++ = BUILTIN1 (sinhl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __sinieee128} } }  */
-  *p++ = BUILTIN1 (sinl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __sqrtieee128} } }  */
-  *p++ = BUILTIN1 (sqrtl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __tanhieee128} } }  */
-  *p++ = BUILTIN1 (tanhl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __tanieee128} } }  */
-  *p++ = BUILTIN1 (tanl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __tgammaieee128} } }  */
-  *p++ = BUILTIN1 (tgammal, *q++);
-
-  /* inline code.  */
-  /* { dg-final { scan-assembler {\mxsrqpi +[0-9]+,[0-9]+,[0-9]+,1} } }  */
-  *p++ = BUILTIN1 (truncl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __y0ieee128} } }  */
-  *p++ = BUILTIN1 (y0l, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __y1ieee128} } }  */
-  *p   = BUILTIN1 (y1l, *q);
-
-}
-
-/* Built-in functions that returns a long double and take two long double
-   arguments.  */
-
-void
-return_ld_arg_ld_ld (long double *p,
-		     long double *q,
-		     long double *r)
-{
-  /* { dg-final { scan-assembler {\mbl __atan2ieee128} } }  */
-  *p++ = BUILTIN2 (atan2l, *q++, *r++);
-
-  /* inline code.  */
-  /* { dg-final { scan-assembler {\mxscpsgnqp} } }  */
-  *p++ = BUILTIN2 (copysignl, *q++, *r++);
-
-  /* { dg-final { scan-assembler {\mbl __remainderieee128} } }  */
-  *p++ = BUILTIN2 (dreml, *q++, *r++);
-
-  /* { dg-final { scan-assembler {\mbl __fdimieee128} } }  */
-  *p++ = BUILTIN2 (fdiml, *q++, *r++);
-
-  /* { dg-final { scan-assembler {\mbl __fmaxieee128} } }  */
-  *p++ = BUILTIN2 (fmaxl, *q++, *r++);
-
-  /* { dg-final { scan-assembler {\mbl __fminieee128} } }  */
-  *p++ = BUILTIN2 (fminl, *q++, *r++);
-
-  /* { dg-final { scan-assembler {\mbl __fmodieee128} } }  */
-  *p++ = BUILTIN2 (fmodl, *q++, *r++);
-
-  /* { dg-final { scan-assembler {\mbl __hypotieee128} } }  */
-  *p++ = BUILTIN2 (hypotl, *q++, *r++);
-
-  /* { dg-final { scan-assembler {\mbl __nextafterieee128} } }  */
-  *p++ = BUILTIN2 (nextafterl, *q++, *r++);
-
-  /* { dg-final { scan-assembler {\mbl __nexttowardieee128} } }  */
-  *p++ = BUILTIN2 (nexttowardl, *q++, *r++);
-
-  /* { dg-final { scan-assembler {\mbl __powieee128} } }  */
-  *p++ = BUILTIN2 (powl, *q++, *r++);
-
-  /* { dg-final { scan-assembler {\mbl __scalbnieee128} } }  */
-  *p   = BUILTIN2 (scalbl, *q, *r);
-}
-
-/* Built-in function that returns a long double and take three long double
-   arguments.  */
-
-void
-return_ld_arg_ld_ld_ld (long double *p,
-			long double *q,
-			long double *r,
-			long double *s)
-{
-  /* inline code.  */
-  /* { dg-final { scan-assembler {\mxsmaddqp} } }  */
-  *p = BUILTIN3 (fmal, *q, *r, *s);
-}
-
-/* Built-in functions that returns a long double and take one
-   _Complex long double argument.  */
-
-void
-return_ld_arg_cld (long double *p,
-		   _Complex long double *q)
-{
-  /* { dg-final { scan-assembler {\mbl __cabsieee128} } }  */
-  *p++ = BUILTIN1 (cabsl, *q++);
-}
-
-/* Built-in functions that returns a _Complex long double and takes one
-   _Complex long double argument.  */
-
-void
-return_cld_arg_cld (_Complex long double *p,
-		    _Complex long double *q)
-{
-  /* { dg-final { scan-assembler {\mbl __cacoshieee128} } }  */
-  *p++ = BUILTIN1 (cacoshl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __cacosieee128} } }  */
-  *p++ = BUILTIN1 (cacosl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __casinhieee128} } }  */
-  *p++ = BUILTIN1 (casinhl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __casinieee128} } }  */
-  *p++ = BUILTIN1 (casinl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __catanhieee128} } }  */
-  *p++ = BUILTIN1 (catanhl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __catanieee128} } }  */
-  *p++ = BUILTIN1 (catanl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __ccoshieee128} } }  */
-  *p++ = BUILTIN1 (ccoshl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __ccosieee128} } }  */
-  *p++ = BUILTIN1 (ccosl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __cexpieee128} } }  */
-  *p++ = BUILTIN1 (cexpl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __clogieee128} } }  */
-  *p++ = BUILTIN1 (clogl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __clog10ieee128} } }  */
-  *p++ = BUILTIN1 (clog10l, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __cprojieee128} } }  */
-  *p++ = BUILTIN1 (cprojl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __csinhieee128} } }  */
-  *p++ = BUILTIN1 (csinhl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __csinieee128} } }  */
-  *p++ = BUILTIN1 (csinl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __csqrtieee128} } }  */
-  *p++ = BUILTIN1 (csqrtl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __ctanhieee128} } }  */
-  *p++ = BUILTIN1 (ctanhl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __ctanieee128} } }  */
-  *p   = BUILTIN1 (ctanl, *q);
-}
-
-/* Built-in functions that returns a _Complex long double and takes one
-   long double argument.  */
-
-void
-return_cld_arg_ld (_Complex long double *p,
-		   long double *q)
-{
-  /* { dg-final { scan-assembler {\mbl __sincosieee128} } }  */
-  *p = BUILTIN1 (cexpil, *q);
-}
-
-/* Built-in function that returns a _Complex long double and takes two
-   _Complex long double arguments.  */
-
-void
-return_cld_arg_cld_cld (_Complex long double *p,
-			_Complex long double *q,
-			_Complex long double *r)
-{
-  /* { dg-final { scan-assembler {\mbl __cpowieee128} } }  */
-  *p = BUILTIN2 (cpowl, *q, *r);
-}
-
-/* Built-in functions that returns a long double and takes a long double and a
-   pointer to an int arguments.  */
-
-void
-return_ld_arg_ld_pi (long double *p,
-		     long double *q,
-		     int **r)
-{
-  /* { dg-final { scan-assembler {\mbl __frexpieee128} } }  */
-  *p++ = BUILTIN2 (frexpl, *q++, *r++);
-
-  /* { dg-final { scan-assembler {\mbl __lgammaieee128_r} } }  */
-  *p++ = BUILTIN2 (gammal_r, *q++, *r++);
-}
-
-/* Built-in functions that returns a long double and takes a long double and an
-   int arguments.  */
-
-void
-return_ld_arg_ld_i (long double *p,
-		    long double *q,
-		    int *r)
-{
-  /* { dg-final { scan-assembler {\mbl __ldexpieee128} } }  */
-  *p++ = BUILTIN2 (ldexpl, *q++, *r++);
-
-  /* { dg-final { scan-assembler {\mbl __powikf2} } }  */
-  *p++ = BUILTIN2 (powil, *q++, *r++);
-
-  /* { dg-final { scan-assembler {\mbl __scalbnieee128} } }  */
-  *p   = BUILTIN2 (scalbnl, *q, *r);
-}
-
-/* Built-in function that returns a long double and takes a long double and a
-   long arguments.  */
-
-void
-return_ld_arg_ld_l (long double *p,
-		    long double *q,
-		    long *r)
-{
-  /* { dg-final { scan-assembler {\mbl __scalblnieee128} } }  */
-  *p = BUILTIN2 (scalblnl, *q, *r);
-}
-
-/* Built-in functions that returns a long double and takes a long double and a
-   long long arguments.  */
-
-void
-return_ld_arg_i_ld (long double *p,
-		    int *q,
-		    long double *r)
-{
-  /* { dg-final { scan-assembler {\mbl __jnieee128} } }  */
-  *p++ = BUILTIN2 (jnl, *q++, *r++);
-
-  /* { dg-final { scan-assembler {\mbl __ynieee128} } }  */
-  *p   = BUILTIN2 (ynl, *q, *r);
-}
-
-/* Built-in functions that returns a long double and takes a long double and a
-   pointer to a long double arguments.  */
-
-void
-return_ld_arg_ld_pld (long double *p,
-		      long double *q,
-		      long double **r)
-{
-  /* { dg-final { scan-assembler {\mbl __modfieee128} } }  */
-  *p = BUILTIN2 (modfl, *q, *r);
-}
-
-/* Built-in function that returns a long double and takes two long double and a
-   pointer to an int arguments.  */
-
-void
-return_ld_arg_ld_ld_pi (long double *p,
-			long double *q,
-			long double *r,
-			int **s)
-{
-  /* { dg-final { scan-assembler {\mbl __remquoieee128} } }  */
-  *p = BUILTIN3 (remquol, *q, *r, *s);
-}
-
-/* Built-in functions that return san int and takes one long double argument.  */
-
-void
-return_i_arg_ld (int *p,
-		 long double *q)
-{
-  /* { dg-final { scan-assembler {\mbl __ceilieee128} } }  */
-  *p++ = BUILTIN1 (iceill, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __floorieee128} } }  */
-  *p++ = BUILTIN1 (ifloorl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __ilogbieee128} } }  */
-  *p++ = BUILTIN1 (ilogbl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __lrintieee128} } }  */
-  *p++ = BUILTIN1 (irintl, *q++);
-
-  /* { dg-final { scan-assembler {\mbl __lroundieee128} } }  */
-  *p++ = BUILTIN1 (iroundl, *q++);
-
-  /* inline code.  */
-  /* { dg-final { scan-assembler {\mxscvqpswz} } }  */
-  *p++ = BUILTIN1 (signbitl, *q++);
-}
-
-/* Built-in function that returns a double and takes one double and one long
-   double arguments.  */
-
-void
-return_d_arg_d_ld (double *p,
-		   double *q,
-		   long double *r)
-{
-  /* { dg-final { scan-assembler {\mbl __nexttoward_to_ieee128} } }  */
-  *p = BUILTIN2 (nexttoward, *q, *r);
-}
-
-/* Built-in function that returns a float and takes one float and one long
-   double arguments.  */
-
-void
-return_f_arg_f_ld (float *p,
-		   float *q,
-		   long double *r)
-{
-  /* { dg-final { scan-assembler {\mbl __nexttowardf_to_ieee128} } }  */
-  *p = BUILTIN2 (nexttowardf, *q, *r);
-}
diff --git a/gcc/testsuite/gcc.target/powerpc/float128-longdouble-stdio.c b/gcc/testsuite/gcc.target/powerpc/float128-longdouble-stdio.c
deleted file mode 100644
index 39e59d949f9..00000000000
--- a/gcc/testsuite/gcc.target/powerpc/float128-longdouble-stdio.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* { dg-require-effective-target ppc_float128_hw } */
-/* { dg-options "-mdejagnu-cpu=power9 -O2 -mlong-double-128 -Wno-psabi -mabi=ieeelongdouble" } */
-
-/* Test if switching long double to IEEE 128-bit maps the printf and scanf
-   function names correctly.  We leave off the \M in matching the calls, so
-   power10 will match using bl foo@notoc.  */
-
-#include <stdlib.h>
-
-volatile long double x = 1.0L;
-volatile long double y, z;
-
-int
-main (void)
-{
-  char buffer[100];
-
-  /* { dg-final { scan-assembler {\mbl __sprintfieee128} } }  */
-  __builtin_sprintf (buffer, "%Lg", x);
-
-  /* { dg-final { scan-assembler {\mbl __printfieee128} } }  */
-  __builtin_printf ("x is %Lg [%s]\n", x, buffer);
-
-  /* { dg-final { scan-assembler {\mbl __isoc99_sscanfieee128} } }  */
-  __builtin_sscanf (buffer, "%Lg", &y);
-
-  __builtin_printf ("Type 1.0: ");
-
-  /* { dg-final { scan-assembler {\mbl __isoc99_scanfieee128} } }  */
-  __builtin_scanf ("%Lg", &z);
-
-  if (x != y || x != z)
-    abort ();
-
-  return 0;
-}
diff --git a/gcc/testsuite/gcc.target/powerpc/float128-math.c b/gcc/testsuite/gcc.target/powerpc/float128-math.c
index d1e22239718..4ad3b5b8363 100644
--- a/gcc/testsuite/gcc.target/powerpc/float128-math.c
+++ b/gcc/testsuite/gcc.target/powerpc/float128-math.c
@@ -1,20 +1,20 @@
+/* { dg-do compile { target { powerpc*-*-linux* } } } */
 /* { dg-require-effective-target ppc_float128_sw } */
 /* { dg-require-effective-target vsx_hw } */
-/* { dg-options "-mvsx -O2 -mfloat128 -mlong-double-128 -mabi=ieeelongdouble -Wno-psabi" } */
+/* { dg-options "-mvsx -O2 -mfloat128 -mabi=ieeelongdouble -Wno-psabi" } */
 
 /* Test whether we convert __builtin_<math>l to __builtin_<math>f128 if the
-   default long double type is IEEE 128-bit.  We leave off the \M in matching
-   the calls, so power10 will match using bl foo@notoc.  Also test that using
-   the explicit __builtin_<math>f128 function does not interfere with the
-   __builtin_<math>l function.  */
+   default long double type is IEEE 128-bit.  Also test that using the explicit
+   __builtin_<math>f128 function does not interfere with the __builtin_<math>l
+   function.  */
 
 extern __float128 sinf128 (__float128);
 
-void foo (__float128 *p, long double *q)
+void foo (__float128 *p, long double *q, long double *r)
 {
   *p = sinf128 (*p);
   *q = __builtin_sinl (*q);
 }
 
-/* { dg-final { scan-assembler     {\mbl __sinieee128} } } */
-/* { dg-final { scan-assembler-not {\mbl sinl}         } } */
+/* { dg-final { scan-assembler-times {\mbl sinf128\M} 2 } } */
+/* { dg-final { scan-assembler-not   {\mbl sinl\M}      } } */


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [gcc(refs/users/meissner/heads/work030)] Revert patch.
@ 2020-12-17  5:32 Michael Meissner
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Meissner @ 2020-12-17  5:32 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:3d9af5116b6afd9a962a2ad381a93ad4c90bc147

commit 3d9af5116b6afd9a962a2ad381a93ad4c90bc147
Author: Michael Meissner <meissner@linux.ibm.com>
Date:   Thu Dec 17 00:31:13 2020 -0500

    Revert patch.
    
    gcc/
    2020-12-16  Michael Meissner  <meissner@linux.ibm.com>
                Alan Modra  <amodra@gmail.com>
    
            Revert:
            PR gcc/97791
            * config/rs6000/rs6000-call.c (init_cumulative_args): Only set
            that long double was returned if the type is actually long
            double.
            (rs6000_function_arg_advance_1): Only set that long double was
            passed if the type is actually long double.
            * config/rs6000/rs6000.h: Uninteded change

Diff:
---
 gcc/config/rs6000/rs6000-call.c | 23 +++++++++--------------
 gcc/config/rs6000/rs6000.h      |  6 ------
 2 files changed, 9 insertions(+), 20 deletions(-)

diff --git a/gcc/config/rs6000/rs6000-call.c b/gcc/config/rs6000/rs6000-call.c
index 3c2652470b6..45bc048b5c7 100644
--- a/gcc/config/rs6000/rs6000-call.c
+++ b/gcc/config/rs6000/rs6000-call.c
@@ -6554,14 +6554,12 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, tree fntype,
 	  if (SCALAR_FLOAT_MODE_P (return_mode))
 	    {
 	      rs6000_passes_float = true;
-
-	      /* If GNU attributes are enabled, mark if the function returns
-		 long double.  We do not mark if the function returns a type
-		 such as __ibm128 that uses the same modes as the current long
-		 double type, only if an actual long double type was used.  */
 	      if ((HAVE_LD_PPC_GNU_ATTR_LONG_DOUBLE || TARGET_64BIT)
-		  && return_type != NULL
-		  && TYPE_MAIN_VARIANT (return_type) == long_double_type_node)
+		  && (FLOAT128_IBM_P (return_mode)
+		      || FLOAT128_IEEE_P (return_mode)
+		      || (return_type != NULL
+			  && (TYPE_MAIN_VARIANT (return_type)
+			      == long_double_type_node))))
 		rs6000_passes_long_double = true;
 
 	      /* Note if we passed or return a IEEE 128-bit type.  We changed
@@ -6996,14 +6994,11 @@ rs6000_function_arg_advance_1 (CUMULATIVE_ARGS *cum, machine_mode mode,
       if (SCALAR_FLOAT_MODE_P (mode))
 	{
 	  rs6000_passes_float = true;
-
-	  /* If GNU attributes are enabled, mark if the function passes long
-	     double.  We do not mark if the function returns a type such as
-	     __ibm128 that uses the same modes as the current long double type,
-	     only if an actual long double type was used.  */
 	  if ((HAVE_LD_PPC_GNU_ATTR_LONG_DOUBLE || TARGET_64BIT)
-	      && type != NULL
-	      && TYPE_MAIN_VARIANT (type) == long_double_type_node)
+	      && (FLOAT128_IBM_P (mode)
+		  || FLOAT128_IEEE_P (mode)
+		  || (type != NULL
+		      && TYPE_MAIN_VARIANT (type) == long_double_type_node)))
 	    rs6000_passes_long_double = true;
 
 	  /* Note if we passed or return a IEEE 128-bit type.  We changed the
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index fb0d3d85b4b..9e6882e95e5 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -509,12 +509,6 @@ extern int rs6000_vector_align[];
 #define TARGET_MINMAX	(TARGET_HARD_FLOAT && TARGET_PPC_GFXOPT		\
 			 && (TARGET_P9_MINMAX || !flag_trapping_math))
 
-/* Whether the '__ibm128' keywork is enabled.  We enable __ibm128 either if the
-   IEEE 128-bit floating point support is enabled or if the long double support
-   uses the 128-bit IBM extended double format.  */
-#define TARGET_IBM128	(TARGET_FLOAT128_TYPE				\
-			 || (!TARGET_IEEEQUAD && TARGET_LONG_DOUBLE_128))
-
 /* In switching from using target_flags to using rs6000_isa_flags, the options
    machinery creates OPTION_MASK_<xxx> instead of MASK_<xxx>.  For now map
    OPTION_MASK_<xxx> back into MASK_<xxx>.  */


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [gcc(refs/users/meissner/heads/work030)] Revert patch.
@ 2020-12-17  5:14 Michael Meissner
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Meissner @ 2020-12-17  5:14 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:9107b1d50204f94890ce111f636cbc8378116254

commit 9107b1d50204f94890ce111f636cbc8378116254
Author: Michael Meissner <meissner@linux.ibm.com>
Date:   Thu Dec 17 00:13:27 2020 -0500

    Revert patch.
    
    gcc/
    2020-12-16  Michael Meissner  <meissner@linux.ibm.com>
                Alan Modra  <amodra@gmail.com>
    
            Revert
            PR gcc/97791
            * config/rs6000/rs6000-call.c (init_cumulative_args): Only set
            that long double was returned if the type is actually long
            double.
            (rs6000_function_arg_advance_1): Only set that long double was
            passed if the type is actually long double.

Diff:
---
 gcc/config/rs6000/rs6000-call.c | 23 +++++++++--------------
 1 file changed, 9 insertions(+), 14 deletions(-)

diff --git a/gcc/config/rs6000/rs6000-call.c b/gcc/config/rs6000/rs6000-call.c
index d040254d401..45bc048b5c7 100644
--- a/gcc/config/rs6000/rs6000-call.c
+++ b/gcc/config/rs6000/rs6000-call.c
@@ -6554,14 +6554,12 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, tree fntype,
 	  if (SCALAR_FLOAT_MODE_P (return_mode))
 	    {
 	      rs6000_passes_float = true;
-
-	      /* If we have GNU attributes enabled, mark if the function returns
-		 long double.  We do not mark if the function returns a type
-		 such as __ibm128 that uses the same modes as the current long
-		 double type, only if an actual long double type was used.  */
 	      if ((HAVE_LD_PPC_GNU_ATTR_LONG_DOUBLE || TARGET_64BIT)
-		  && return_type != NULL
-		  && TYPE_MAIN_VARIANT (return_type) == long_double_type_node)
+		  && (FLOAT128_IBM_P (return_mode)
+		      || FLOAT128_IEEE_P (return_mode)
+		      || (return_type != NULL
+			  && (TYPE_MAIN_VARIANT (return_type)
+			      == long_double_type_node))))
 		rs6000_passes_long_double = true;
 
 	      /* Note if we passed or return a IEEE 128-bit type.  We changed
@@ -6996,14 +6994,11 @@ rs6000_function_arg_advance_1 (CUMULATIVE_ARGS *cum, machine_mode mode,
       if (SCALAR_FLOAT_MODE_P (mode))
 	{
 	  rs6000_passes_float = true;
-
-	  /* If we have GNU attributes enabled, mark if the function passes long
-	     double.  We do not mark if the function returns a type such as
-	     __ibm128 that uses the same modes as the current long double type,
-	     only if an actual long double type was used.  */
 	  if ((HAVE_LD_PPC_GNU_ATTR_LONG_DOUBLE || TARGET_64BIT)
-	      && type != NULL
-	      && TYPE_MAIN_VARIANT (type) == long_double_type_node)
+	      && (FLOAT128_IBM_P (mode)
+		  || FLOAT128_IEEE_P (mode)
+		  || (type != NULL
+		      && TYPE_MAIN_VARIANT (type) == long_double_type_node)))
 	    rs6000_passes_long_double = true;
 
 	  /* Note if we passed or return a IEEE 128-bit type.  We changed the


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-12-21 18:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-17 18:31 [gcc(refs/users/meissner/heads/work030)] Revert patch Michael Meissner
  -- strict thread matches above, loose matches on Subject: below --
2020-12-21 18:03 Michael Meissner
2020-12-18  1:18 Michael Meissner
2020-12-17  5:32 Michael Meissner
2020-12-17  5:14 Michael Meissner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).