public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/wschmidt/heads/builtins4)] rs6000: Disable unnecessary initialization for new support
@ 2020-12-16 18:07 William Schmidt
  0 siblings, 0 replies; 5+ messages in thread
From: William Schmidt @ 2020-12-16 18:07 UTC (permalink / raw)
  To: gcc-cvs

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

commit acaaa32819f2be86164d7618f8dae2417be2e46d
Author: Bill Schmidt <wschmidt@linux.ibm.com>
Date:   Mon Nov 2 10:21:55 2020 -0500

    rs6000: Disable unnecessary initialization for new support
    
    2020-11-02  Bill Schmidt  <wschmidt@linux.ibm.com>
    
            * config/rs6000/rs6000-call.c (rs6000-init_builtins): Gate special
            cases with !new_builtins_are_live.

Diff:
---
 gcc/config/rs6000/rs6000-call.c | 227 +++++++++++++++++++++-------------------
 1 file changed, 121 insertions(+), 106 deletions(-)

diff --git a/gcc/config/rs6000/rs6000-call.c b/gcc/config/rs6000/rs6000-call.c
index d9e4857259e..92755c360e0 100644
--- a/gcc/config/rs6000/rs6000-call.c
+++ b/gcc/config/rs6000/rs6000-call.c
@@ -13587,114 +13587,129 @@ rs6000_init_builtins (void)
   /* Execute the autogenerated initialization code for builtins.  */
   rs6000_autoinit_builtins ();
 
-  /* Create Altivec, VSX and MMA builtins on machines with at least the
-     general purpose extensions (970 and newer) to allow the use of
-     the target attribute.  */
-  if (TARGET_EXTRA_BUILTINS)
+  if (!new_builtins_are_live)
     {
-      altivec_init_builtins ();
-      mma_init_builtins ();
-    }
-  if (TARGET_HTM)
-    htm_init_builtins ();
-
-  if (TARGET_EXTRA_BUILTINS)
-    rs6000_common_init_builtins ();
-
-  ftype = builtin_function_type (DFmode, DFmode, DFmode, VOIDmode,
-				 RS6000_BUILTIN_RECIP, "__builtin_recipdiv");
-  def_builtin ("__builtin_recipdiv", ftype, RS6000_BUILTIN_RECIP);
-
-  ftype = builtin_function_type (SFmode, SFmode, SFmode, VOIDmode,
-				 RS6000_BUILTIN_RECIPF, "__builtin_recipdivf");
-  def_builtin ("__builtin_recipdivf", ftype, RS6000_BUILTIN_RECIPF);
-
-  ftype = builtin_function_type (DFmode, DFmode, VOIDmode, VOIDmode,
-				 RS6000_BUILTIN_RSQRT, "__builtin_rsqrt");
-  def_builtin ("__builtin_rsqrt", ftype, RS6000_BUILTIN_RSQRT);
-
-  ftype = builtin_function_type (SFmode, SFmode, VOIDmode, VOIDmode,
-				 RS6000_BUILTIN_RSQRTF, "__builtin_rsqrtf");
-  def_builtin ("__builtin_rsqrtf", ftype, RS6000_BUILTIN_RSQRTF);
-
-  mode = (TARGET_64BIT) ? DImode : SImode;
-  ftype = builtin_function_type (mode, mode, mode, VOIDmode,
-				 POWER7_BUILTIN_BPERMD, "__builtin_bpermd");
-  def_builtin ("__builtin_bpermd", ftype, POWER7_BUILTIN_BPERMD);
-
-  ftype = build_function_type_list (unsigned_intDI_type_node,
-				    NULL_TREE);
-  def_builtin ("__builtin_ppc_get_timebase", ftype, RS6000_BUILTIN_GET_TB);
-
-  if (TARGET_64BIT)
-    ftype = build_function_type_list (unsigned_intDI_type_node,
-				      NULL_TREE);
-  else
-    ftype = build_function_type_list (unsigned_intSI_type_node,
-				      NULL_TREE);
-  def_builtin ("__builtin_ppc_mftb", ftype, RS6000_BUILTIN_MFTB);
-
-  ftype = build_function_type_list (double_type_node, NULL_TREE);
-  def_builtin ("__builtin_mffs", ftype, RS6000_BUILTIN_MFFS);
-
-  ftype = build_function_type_list (double_type_node, NULL_TREE);
-  def_builtin ("__builtin_mffsl", ftype, RS6000_BUILTIN_MFFSL);
-
-  ftype = build_function_type_list (void_type_node,
-				    intSI_type_node,
-				    NULL_TREE);
-  def_builtin ("__builtin_mtfsb0", ftype, RS6000_BUILTIN_MTFSB0);
-
-  ftype = build_function_type_list (void_type_node,
-				    intSI_type_node,
-				    NULL_TREE);
-  def_builtin ("__builtin_mtfsb1", ftype, RS6000_BUILTIN_MTFSB1);
-
-  ftype = build_function_type_list (void_type_node,
-				    intDI_type_node,
-				    NULL_TREE);
-  def_builtin ("__builtin_set_fpscr_rn", ftype, RS6000_BUILTIN_SET_FPSCR_RN);
-
-  ftype = build_function_type_list (void_type_node,
-				    intDI_type_node,
-				    NULL_TREE);
-  def_builtin ("__builtin_set_fpscr_drn", ftype, RS6000_BUILTIN_SET_FPSCR_DRN);
-
-  ftype = build_function_type_list (void_type_node,
-				    intSI_type_node, double_type_node,
-				    NULL_TREE);
-  def_builtin ("__builtin_mtfsf", ftype, RS6000_BUILTIN_MTFSF);
-
-  ftype = build_function_type_list (void_type_node, NULL_TREE);
-  def_builtin ("__builtin_cpu_init", ftype, RS6000_BUILTIN_CPU_INIT);
-  def_builtin ("__builtin_ppc_speculation_barrier", ftype,
-	       MISC_BUILTIN_SPEC_BARRIER);
-
-  ftype = build_function_type_list (bool_int_type_node, const_ptr_type_node,
-				    NULL_TREE);
-  def_builtin ("__builtin_cpu_is", ftype, RS6000_BUILTIN_CPU_IS);
-  def_builtin ("__builtin_cpu_supports", ftype, RS6000_BUILTIN_CPU_SUPPORTS);
-
-  if (TARGET_XCOFF)
-    {
-      /* AIX libm provides clog as __clog.  */
-      if ((tdecl = builtin_decl_explicit (BUILT_IN_CLOG)) != NULL_TREE)
-	set_user_assembler_name (tdecl, "__clog");
-
-      /* When long double is 64 bit, some long double builtins of libc
-	 functions (like __builtin_frexpl) must call the double version
-	 (frexp) not the long double version (frexpl) that expects a 128 bit
-	 argument.  */
-      if (! TARGET_LONG_DOUBLE_128)
+      /* Create Altivec, VSX and MMA builtins on machines with at least the
+	 general purpose extensions (970 and newer) to allow the use of
+	 the target attribute.  */
+      if (TARGET_EXTRA_BUILTINS)
 	{
-	  if ((tdecl = builtin_decl_explicit (BUILT_IN_FMODL)) != NULL_TREE)
-	    set_user_assembler_name (tdecl, "fmod");
-	  if ((tdecl = builtin_decl_explicit (BUILT_IN_FREXPL)) != NULL_TREE)
-	    set_user_assembler_name (tdecl, "frexp");
-	  if ((tdecl = builtin_decl_explicit (BUILT_IN_LDEXPL)) != NULL_TREE)
-	    set_user_assembler_name (tdecl, "ldexp");
-	  if ((tdecl = builtin_decl_explicit (BUILT_IN_MODFL)) != NULL_TREE)
-	    set_user_assembler_name (tdecl, "modf");
+	  altivec_init_builtins ();
+	  mma_init_builtins ();
+	}
+      if (TARGET_HTM)
+	htm_init_builtins ();
+
+      if (TARGET_EXTRA_BUILTINS)
+	rs6000_common_init_builtins ();
+
+      ftype = builtin_function_type (DFmode, DFmode, DFmode, VOIDmode,
+				     RS6000_BUILTIN_RECIP,
+				     "__builtin_recipdiv");
+      def_builtin ("__builtin_recipdiv", ftype, RS6000_BUILTIN_RECIP);
+
+      ftype = builtin_function_type (SFmode, SFmode, SFmode, VOIDmode,
+				     RS6000_BUILTIN_RECIPF,
+				     "__builtin_recipdivf");
+      def_builtin ("__builtin_recipdivf", ftype, RS6000_BUILTIN_RECIPF);
+
+      ftype = builtin_function_type (DFmode, DFmode, VOIDmode, VOIDmode,
+				     RS6000_BUILTIN_RSQRT, "__builtin_rsqrt");
+      def_builtin ("__builtin_rsqrt", ftype, RS6000_BUILTIN_RSQRT);
+
+      ftype = builtin_function_type (SFmode, SFmode, VOIDmode, VOIDmode,
+				     RS6000_BUILTIN_RSQRTF,
+				     "__builtin_rsqrtf");
+      def_builtin ("__builtin_rsqrtf", ftype, RS6000_BUILTIN_RSQRTF);
+
+      mode = (TARGET_64BIT) ? DImode : SImode;
+      ftype = builtin_function_type (mode, mode, mode, VOIDmode,
+				     POWER7_BUILTIN_BPERMD,
+				     "__builtin_bpermd");
+      def_builtin ("__builtin_bpermd", ftype, POWER7_BUILTIN_BPERMD);
+
+      ftype = build_function_type_list (unsigned_intDI_type_node,
+					NULL_TREE);
+      def_builtin ("__builtin_ppc_get_timebase", ftype, RS6000_BUILTIN_GET_TB);
+
+      if (TARGET_64BIT)
+	ftype = build_function_type_list (unsigned_intDI_type_node,
+					  NULL_TREE);
+      else
+	ftype = build_function_type_list (unsigned_intSI_type_node,
+					  NULL_TREE);
+      def_builtin ("__builtin_ppc_mftb", ftype, RS6000_BUILTIN_MFTB);
+
+      ftype = build_function_type_list (double_type_node, NULL_TREE);
+      def_builtin ("__builtin_mffs", ftype, RS6000_BUILTIN_MFFS);
+
+      ftype = build_function_type_list (double_type_node, NULL_TREE);
+      def_builtin ("__builtin_mffsl", ftype, RS6000_BUILTIN_MFFSL);
+
+      ftype = build_function_type_list (void_type_node,
+					intSI_type_node,
+					NULL_TREE);
+      def_builtin ("__builtin_mtfsb0", ftype, RS6000_BUILTIN_MTFSB0);
+
+      ftype = build_function_type_list (void_type_node,
+					intSI_type_node,
+					NULL_TREE);
+      def_builtin ("__builtin_mtfsb1", ftype, RS6000_BUILTIN_MTFSB1);
+
+      ftype = build_function_type_list (void_type_node,
+					intDI_type_node,
+					NULL_TREE);
+      def_builtin ("__builtin_set_fpscr_rn", ftype,
+		   RS6000_BUILTIN_SET_FPSCR_RN);
+
+      ftype = build_function_type_list (void_type_node,
+					intDI_type_node,
+					NULL_TREE);
+      def_builtin ("__builtin_set_fpscr_drn", ftype,
+		   RS6000_BUILTIN_SET_FPSCR_DRN);
+
+      ftype = build_function_type_list (void_type_node,
+					intSI_type_node, double_type_node,
+					NULL_TREE);
+      def_builtin ("__builtin_mtfsf", ftype, RS6000_BUILTIN_MTFSF);
+
+      ftype = build_function_type_list (void_type_node, NULL_TREE);
+      def_builtin ("__builtin_cpu_init", ftype, RS6000_BUILTIN_CPU_INIT);
+      def_builtin ("__builtin_ppc_speculation_barrier", ftype,
+		   MISC_BUILTIN_SPEC_BARRIER);
+
+      ftype = build_function_type_list (bool_int_type_node,
+					const_ptr_type_node,
+					NULL_TREE);
+      def_builtin ("__builtin_cpu_is", ftype, RS6000_BUILTIN_CPU_IS);
+      def_builtin ("__builtin_cpu_supports", ftype,
+		   RS6000_BUILTIN_CPU_SUPPORTS);
+
+      if (TARGET_XCOFF)
+	{
+	  /* AIX libm provides clog as __clog.  */
+	  if ((tdecl = builtin_decl_explicit (BUILT_IN_CLOG)) != NULL_TREE)
+	    set_user_assembler_name (tdecl, "__clog");
+
+	  /* When long double is 64 bit, some long double builtins of libc
+	     functions (like __builtin_frexpl) must call the double version
+	     (frexp) not the long double version (frexpl) that expects a
+	     128-bit argument.  */
+	  if (! TARGET_LONG_DOUBLE_128)
+	    {
+	      if ((tdecl = builtin_decl_explicit (BUILT_IN_FMODL))
+		  != NULL_TREE)
+		set_user_assembler_name (tdecl, "fmod");
+	      if ((tdecl = builtin_decl_explicit (BUILT_IN_FREXPL))
+		  != NULL_TREE)
+		set_user_assembler_name (tdecl, "frexp");
+	      if ((tdecl = builtin_decl_explicit (BUILT_IN_LDEXPL))
+		  != NULL_TREE)
+		set_user_assembler_name (tdecl, "ldexp");
+	      if ((tdecl = builtin_decl_explicit (BUILT_IN_MODFL))
+		  != NULL_TREE)
+		set_user_assembler_name (tdecl, "modf");
+	    }
 	}
     }


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

* [gcc(refs/users/wschmidt/heads/builtins4)] rs6000: Disable unnecessary initialization for new support
@ 2021-02-07 18:13 William Schmidt
  0 siblings, 0 replies; 5+ messages in thread
From: William Schmidt @ 2021-02-07 18:13 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:97e84a7cd6b265affbaf675bc553d27bfcb694e8

commit 97e84a7cd6b265affbaf675bc553d27bfcb694e8
Author: Bill Schmidt <wschmidt@linux.ibm.com>
Date:   Mon Nov 2 10:21:55 2020 -0500

    rs6000: Disable unnecessary initialization for new support
    
    2020-11-02  Bill Schmidt  <wschmidt@linux.ibm.com>
    
            * config/rs6000/rs6000-call.c (rs6000-init_builtins): Gate special
            cases with !new_builtins_are_live.

Diff:
---
 gcc/config/rs6000/rs6000-call.c | 227 +++++++++++++++++++++-------------------
 1 file changed, 121 insertions(+), 106 deletions(-)

diff --git a/gcc/config/rs6000/rs6000-call.c b/gcc/config/rs6000/rs6000-call.c
index c4b8df4d0d0..879d27e3c9d 100644
--- a/gcc/config/rs6000/rs6000-call.c
+++ b/gcc/config/rs6000/rs6000-call.c
@@ -13634,114 +13634,129 @@ rs6000_init_builtins (void)
   /* Execute the autogenerated initialization code for builtins.  */
   rs6000_autoinit_builtins ();
 
-  /* Create Altivec, VSX and MMA builtins on machines with at least the
-     general purpose extensions (970 and newer) to allow the use of
-     the target attribute.  */
-  if (TARGET_EXTRA_BUILTINS)
+  if (!new_builtins_are_live)
     {
-      altivec_init_builtins ();
-      mma_init_builtins ();
-    }
-  if (TARGET_HTM)
-    htm_init_builtins ();
-
-  if (TARGET_EXTRA_BUILTINS)
-    rs6000_common_init_builtins ();
-
-  ftype = builtin_function_type (DFmode, DFmode, DFmode, VOIDmode,
-				 RS6000_BUILTIN_RECIP, "__builtin_recipdiv");
-  def_builtin ("__builtin_recipdiv", ftype, RS6000_BUILTIN_RECIP);
-
-  ftype = builtin_function_type (SFmode, SFmode, SFmode, VOIDmode,
-				 RS6000_BUILTIN_RECIPF, "__builtin_recipdivf");
-  def_builtin ("__builtin_recipdivf", ftype, RS6000_BUILTIN_RECIPF);
-
-  ftype = builtin_function_type (DFmode, DFmode, VOIDmode, VOIDmode,
-				 RS6000_BUILTIN_RSQRT, "__builtin_rsqrt");
-  def_builtin ("__builtin_rsqrt", ftype, RS6000_BUILTIN_RSQRT);
-
-  ftype = builtin_function_type (SFmode, SFmode, VOIDmode, VOIDmode,
-				 RS6000_BUILTIN_RSQRTF, "__builtin_rsqrtf");
-  def_builtin ("__builtin_rsqrtf", ftype, RS6000_BUILTIN_RSQRTF);
-
-  mode = (TARGET_64BIT) ? DImode : SImode;
-  ftype = builtin_function_type (mode, mode, mode, VOIDmode,
-				 POWER7_BUILTIN_BPERMD, "__builtin_bpermd");
-  def_builtin ("__builtin_bpermd", ftype, POWER7_BUILTIN_BPERMD);
-
-  ftype = build_function_type_list (unsigned_intDI_type_node,
-				    NULL_TREE);
-  def_builtin ("__builtin_ppc_get_timebase", ftype, RS6000_BUILTIN_GET_TB);
-
-  if (TARGET_64BIT)
-    ftype = build_function_type_list (unsigned_intDI_type_node,
-				      NULL_TREE);
-  else
-    ftype = build_function_type_list (unsigned_intSI_type_node,
-				      NULL_TREE);
-  def_builtin ("__builtin_ppc_mftb", ftype, RS6000_BUILTIN_MFTB);
-
-  ftype = build_function_type_list (double_type_node, NULL_TREE);
-  def_builtin ("__builtin_mffs", ftype, RS6000_BUILTIN_MFFS);
-
-  ftype = build_function_type_list (double_type_node, NULL_TREE);
-  def_builtin ("__builtin_mffsl", ftype, RS6000_BUILTIN_MFFSL);
-
-  ftype = build_function_type_list (void_type_node,
-				    intSI_type_node,
-				    NULL_TREE);
-  def_builtin ("__builtin_mtfsb0", ftype, RS6000_BUILTIN_MTFSB0);
-
-  ftype = build_function_type_list (void_type_node,
-				    intSI_type_node,
-				    NULL_TREE);
-  def_builtin ("__builtin_mtfsb1", ftype, RS6000_BUILTIN_MTFSB1);
-
-  ftype = build_function_type_list (void_type_node,
-				    intDI_type_node,
-				    NULL_TREE);
-  def_builtin ("__builtin_set_fpscr_rn", ftype, RS6000_BUILTIN_SET_FPSCR_RN);
-
-  ftype = build_function_type_list (void_type_node,
-				    intDI_type_node,
-				    NULL_TREE);
-  def_builtin ("__builtin_set_fpscr_drn", ftype, RS6000_BUILTIN_SET_FPSCR_DRN);
-
-  ftype = build_function_type_list (void_type_node,
-				    intSI_type_node, double_type_node,
-				    NULL_TREE);
-  def_builtin ("__builtin_mtfsf", ftype, RS6000_BUILTIN_MTFSF);
-
-  ftype = build_function_type_list (void_type_node, NULL_TREE);
-  def_builtin ("__builtin_cpu_init", ftype, RS6000_BUILTIN_CPU_INIT);
-  def_builtin ("__builtin_ppc_speculation_barrier", ftype,
-	       MISC_BUILTIN_SPEC_BARRIER);
-
-  ftype = build_function_type_list (bool_int_type_node, const_ptr_type_node,
-				    NULL_TREE);
-  def_builtin ("__builtin_cpu_is", ftype, RS6000_BUILTIN_CPU_IS);
-  def_builtin ("__builtin_cpu_supports", ftype, RS6000_BUILTIN_CPU_SUPPORTS);
-
-  if (TARGET_XCOFF)
-    {
-      /* AIX libm provides clog as __clog.  */
-      if ((tdecl = builtin_decl_explicit (BUILT_IN_CLOG)) != NULL_TREE)
-	set_user_assembler_name (tdecl, "__clog");
-
-      /* When long double is 64 bit, some long double builtins of libc
-	 functions (like __builtin_frexpl) must call the double version
-	 (frexp) not the long double version (frexpl) that expects a 128 bit
-	 argument.  */
-      if (! TARGET_LONG_DOUBLE_128)
+      /* Create Altivec, VSX and MMA builtins on machines with at least the
+	 general purpose extensions (970 and newer) to allow the use of
+	 the target attribute.  */
+      if (TARGET_EXTRA_BUILTINS)
 	{
-	  if ((tdecl = builtin_decl_explicit (BUILT_IN_FMODL)) != NULL_TREE)
-	    set_user_assembler_name (tdecl, "fmod");
-	  if ((tdecl = builtin_decl_explicit (BUILT_IN_FREXPL)) != NULL_TREE)
-	    set_user_assembler_name (tdecl, "frexp");
-	  if ((tdecl = builtin_decl_explicit (BUILT_IN_LDEXPL)) != NULL_TREE)
-	    set_user_assembler_name (tdecl, "ldexp");
-	  if ((tdecl = builtin_decl_explicit (BUILT_IN_MODFL)) != NULL_TREE)
-	    set_user_assembler_name (tdecl, "modf");
+	  altivec_init_builtins ();
+	  mma_init_builtins ();
+	}
+      if (TARGET_HTM)
+	htm_init_builtins ();
+
+      if (TARGET_EXTRA_BUILTINS)
+	rs6000_common_init_builtins ();
+
+      ftype = builtin_function_type (DFmode, DFmode, DFmode, VOIDmode,
+				     RS6000_BUILTIN_RECIP,
+				     "__builtin_recipdiv");
+      def_builtin ("__builtin_recipdiv", ftype, RS6000_BUILTIN_RECIP);
+
+      ftype = builtin_function_type (SFmode, SFmode, SFmode, VOIDmode,
+				     RS6000_BUILTIN_RECIPF,
+				     "__builtin_recipdivf");
+      def_builtin ("__builtin_recipdivf", ftype, RS6000_BUILTIN_RECIPF);
+
+      ftype = builtin_function_type (DFmode, DFmode, VOIDmode, VOIDmode,
+				     RS6000_BUILTIN_RSQRT, "__builtin_rsqrt");
+      def_builtin ("__builtin_rsqrt", ftype, RS6000_BUILTIN_RSQRT);
+
+      ftype = builtin_function_type (SFmode, SFmode, VOIDmode, VOIDmode,
+				     RS6000_BUILTIN_RSQRTF,
+				     "__builtin_rsqrtf");
+      def_builtin ("__builtin_rsqrtf", ftype, RS6000_BUILTIN_RSQRTF);
+
+      mode = (TARGET_64BIT) ? DImode : SImode;
+      ftype = builtin_function_type (mode, mode, mode, VOIDmode,
+				     POWER7_BUILTIN_BPERMD,
+				     "__builtin_bpermd");
+      def_builtin ("__builtin_bpermd", ftype, POWER7_BUILTIN_BPERMD);
+
+      ftype = build_function_type_list (unsigned_intDI_type_node,
+					NULL_TREE);
+      def_builtin ("__builtin_ppc_get_timebase", ftype, RS6000_BUILTIN_GET_TB);
+
+      if (TARGET_64BIT)
+	ftype = build_function_type_list (unsigned_intDI_type_node,
+					  NULL_TREE);
+      else
+	ftype = build_function_type_list (unsigned_intSI_type_node,
+					  NULL_TREE);
+      def_builtin ("__builtin_ppc_mftb", ftype, RS6000_BUILTIN_MFTB);
+
+      ftype = build_function_type_list (double_type_node, NULL_TREE);
+      def_builtin ("__builtin_mffs", ftype, RS6000_BUILTIN_MFFS);
+
+      ftype = build_function_type_list (double_type_node, NULL_TREE);
+      def_builtin ("__builtin_mffsl", ftype, RS6000_BUILTIN_MFFSL);
+
+      ftype = build_function_type_list (void_type_node,
+					intSI_type_node,
+					NULL_TREE);
+      def_builtin ("__builtin_mtfsb0", ftype, RS6000_BUILTIN_MTFSB0);
+
+      ftype = build_function_type_list (void_type_node,
+					intSI_type_node,
+					NULL_TREE);
+      def_builtin ("__builtin_mtfsb1", ftype, RS6000_BUILTIN_MTFSB1);
+
+      ftype = build_function_type_list (void_type_node,
+					intDI_type_node,
+					NULL_TREE);
+      def_builtin ("__builtin_set_fpscr_rn", ftype,
+		   RS6000_BUILTIN_SET_FPSCR_RN);
+
+      ftype = build_function_type_list (void_type_node,
+					intDI_type_node,
+					NULL_TREE);
+      def_builtin ("__builtin_set_fpscr_drn", ftype,
+		   RS6000_BUILTIN_SET_FPSCR_DRN);
+
+      ftype = build_function_type_list (void_type_node,
+					intSI_type_node, double_type_node,
+					NULL_TREE);
+      def_builtin ("__builtin_mtfsf", ftype, RS6000_BUILTIN_MTFSF);
+
+      ftype = build_function_type_list (void_type_node, NULL_TREE);
+      def_builtin ("__builtin_cpu_init", ftype, RS6000_BUILTIN_CPU_INIT);
+      def_builtin ("__builtin_ppc_speculation_barrier", ftype,
+		   MISC_BUILTIN_SPEC_BARRIER);
+
+      ftype = build_function_type_list (bool_int_type_node,
+					const_ptr_type_node,
+					NULL_TREE);
+      def_builtin ("__builtin_cpu_is", ftype, RS6000_BUILTIN_CPU_IS);
+      def_builtin ("__builtin_cpu_supports", ftype,
+		   RS6000_BUILTIN_CPU_SUPPORTS);
+
+      if (TARGET_XCOFF)
+	{
+	  /* AIX libm provides clog as __clog.  */
+	  if ((tdecl = builtin_decl_explicit (BUILT_IN_CLOG)) != NULL_TREE)
+	    set_user_assembler_name (tdecl, "__clog");
+
+	  /* When long double is 64 bit, some long double builtins of libc
+	     functions (like __builtin_frexpl) must call the double version
+	     (frexp) not the long double version (frexpl) that expects a
+	     128-bit argument.  */
+	  if (! TARGET_LONG_DOUBLE_128)
+	    {
+	      if ((tdecl = builtin_decl_explicit (BUILT_IN_FMODL))
+		  != NULL_TREE)
+		set_user_assembler_name (tdecl, "fmod");
+	      if ((tdecl = builtin_decl_explicit (BUILT_IN_FREXPL))
+		  != NULL_TREE)
+		set_user_assembler_name (tdecl, "frexp");
+	      if ((tdecl = builtin_decl_explicit (BUILT_IN_LDEXPL))
+		  != NULL_TREE)
+		set_user_assembler_name (tdecl, "ldexp");
+	      if ((tdecl = builtin_decl_explicit (BUILT_IN_MODFL))
+		  != NULL_TREE)
+		set_user_assembler_name (tdecl, "modf");
+	    }
 	}
     }


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

* [gcc(refs/users/wschmidt/heads/builtins4)] rs6000: Disable unnecessary initialization for new support
@ 2020-11-24 16:44 William Schmidt
  0 siblings, 0 replies; 5+ messages in thread
From: William Schmidt @ 2020-11-24 16:44 UTC (permalink / raw)
  To: gcc-cvs

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

commit f0b51c08b10283e5058d69ce71fe5bc71481120d
Author: Bill Schmidt <wschmidt@linux.ibm.com>
Date:   Mon Nov 2 10:21:55 2020 -0500

    rs6000: Disable unnecessary initialization for new support
    
    2020-11-02  Bill Schmidt  <wschmidt@linux.ibm.com>
    
            * config/rs6000/rs6000-call.c (rs6000-init_builtins): Gate special
            cases with !new_builtins_are_live.

Diff:
---
 gcc/config/rs6000/rs6000-call.c | 227 +++++++++++++++++++++-------------------
 1 file changed, 121 insertions(+), 106 deletions(-)

diff --git a/gcc/config/rs6000/rs6000-call.c b/gcc/config/rs6000/rs6000-call.c
index 7cc2b6c4f94..ef0eda85ef4 100644
--- a/gcc/config/rs6000/rs6000-call.c
+++ b/gcc/config/rs6000/rs6000-call.c
@@ -13587,114 +13587,129 @@ rs6000_init_builtins (void)
   /* Execute the autogenerated initialization code for builtins.  */
   rs6000_autoinit_builtins ();
 
-  /* Create Altivec, VSX and MMA builtins on machines with at least the
-     general purpose extensions (970 and newer) to allow the use of
-     the target attribute.  */
-  if (TARGET_EXTRA_BUILTINS)
+  if (!new_builtins_are_live)
     {
-      altivec_init_builtins ();
-      mma_init_builtins ();
-    }
-  if (TARGET_HTM)
-    htm_init_builtins ();
-
-  if (TARGET_EXTRA_BUILTINS)
-    rs6000_common_init_builtins ();
-
-  ftype = builtin_function_type (DFmode, DFmode, DFmode, VOIDmode,
-				 RS6000_BUILTIN_RECIP, "__builtin_recipdiv");
-  def_builtin ("__builtin_recipdiv", ftype, RS6000_BUILTIN_RECIP);
-
-  ftype = builtin_function_type (SFmode, SFmode, SFmode, VOIDmode,
-				 RS6000_BUILTIN_RECIPF, "__builtin_recipdivf");
-  def_builtin ("__builtin_recipdivf", ftype, RS6000_BUILTIN_RECIPF);
-
-  ftype = builtin_function_type (DFmode, DFmode, VOIDmode, VOIDmode,
-				 RS6000_BUILTIN_RSQRT, "__builtin_rsqrt");
-  def_builtin ("__builtin_rsqrt", ftype, RS6000_BUILTIN_RSQRT);
-
-  ftype = builtin_function_type (SFmode, SFmode, VOIDmode, VOIDmode,
-				 RS6000_BUILTIN_RSQRTF, "__builtin_rsqrtf");
-  def_builtin ("__builtin_rsqrtf", ftype, RS6000_BUILTIN_RSQRTF);
-
-  mode = (TARGET_64BIT) ? DImode : SImode;
-  ftype = builtin_function_type (mode, mode, mode, VOIDmode,
-				 POWER7_BUILTIN_BPERMD, "__builtin_bpermd");
-  def_builtin ("__builtin_bpermd", ftype, POWER7_BUILTIN_BPERMD);
-
-  ftype = build_function_type_list (unsigned_intDI_type_node,
-				    NULL_TREE);
-  def_builtin ("__builtin_ppc_get_timebase", ftype, RS6000_BUILTIN_GET_TB);
-
-  if (TARGET_64BIT)
-    ftype = build_function_type_list (unsigned_intDI_type_node,
-				      NULL_TREE);
-  else
-    ftype = build_function_type_list (unsigned_intSI_type_node,
-				      NULL_TREE);
-  def_builtin ("__builtin_ppc_mftb", ftype, RS6000_BUILTIN_MFTB);
-
-  ftype = build_function_type_list (double_type_node, NULL_TREE);
-  def_builtin ("__builtin_mffs", ftype, RS6000_BUILTIN_MFFS);
-
-  ftype = build_function_type_list (double_type_node, NULL_TREE);
-  def_builtin ("__builtin_mffsl", ftype, RS6000_BUILTIN_MFFSL);
-
-  ftype = build_function_type_list (void_type_node,
-				    intSI_type_node,
-				    NULL_TREE);
-  def_builtin ("__builtin_mtfsb0", ftype, RS6000_BUILTIN_MTFSB0);
-
-  ftype = build_function_type_list (void_type_node,
-				    intSI_type_node,
-				    NULL_TREE);
-  def_builtin ("__builtin_mtfsb1", ftype, RS6000_BUILTIN_MTFSB1);
-
-  ftype = build_function_type_list (void_type_node,
-				    intDI_type_node,
-				    NULL_TREE);
-  def_builtin ("__builtin_set_fpscr_rn", ftype, RS6000_BUILTIN_SET_FPSCR_RN);
-
-  ftype = build_function_type_list (void_type_node,
-				    intDI_type_node,
-				    NULL_TREE);
-  def_builtin ("__builtin_set_fpscr_drn", ftype, RS6000_BUILTIN_SET_FPSCR_DRN);
-
-  ftype = build_function_type_list (void_type_node,
-				    intSI_type_node, double_type_node,
-				    NULL_TREE);
-  def_builtin ("__builtin_mtfsf", ftype, RS6000_BUILTIN_MTFSF);
-
-  ftype = build_function_type_list (void_type_node, NULL_TREE);
-  def_builtin ("__builtin_cpu_init", ftype, RS6000_BUILTIN_CPU_INIT);
-  def_builtin ("__builtin_ppc_speculation_barrier", ftype,
-	       MISC_BUILTIN_SPEC_BARRIER);
-
-  ftype = build_function_type_list (bool_int_type_node, const_ptr_type_node,
-				    NULL_TREE);
-  def_builtin ("__builtin_cpu_is", ftype, RS6000_BUILTIN_CPU_IS);
-  def_builtin ("__builtin_cpu_supports", ftype, RS6000_BUILTIN_CPU_SUPPORTS);
-
-  if (TARGET_XCOFF)
-    {
-      /* AIX libm provides clog as __clog.  */
-      if ((tdecl = builtin_decl_explicit (BUILT_IN_CLOG)) != NULL_TREE)
-	set_user_assembler_name (tdecl, "__clog");
-
-      /* When long double is 64 bit, some long double builtins of libc
-	 functions (like __builtin_frexpl) must call the double version
-	 (frexp) not the long double version (frexpl) that expects a 128 bit
-	 argument.  */
-      if (! TARGET_LONG_DOUBLE_128)
+      /* Create Altivec, VSX and MMA builtins on machines with at least the
+	 general purpose extensions (970 and newer) to allow the use of
+	 the target attribute.  */
+      if (TARGET_EXTRA_BUILTINS)
 	{
-	  if ((tdecl = builtin_decl_explicit (BUILT_IN_FMODL)) != NULL_TREE)
-	    set_user_assembler_name (tdecl, "fmod");
-	  if ((tdecl = builtin_decl_explicit (BUILT_IN_FREXPL)) != NULL_TREE)
-	    set_user_assembler_name (tdecl, "frexp");
-	  if ((tdecl = builtin_decl_explicit (BUILT_IN_LDEXPL)) != NULL_TREE)
-	    set_user_assembler_name (tdecl, "ldexp");
-	  if ((tdecl = builtin_decl_explicit (BUILT_IN_MODFL)) != NULL_TREE)
-	    set_user_assembler_name (tdecl, "modf");
+	  altivec_init_builtins ();
+	  mma_init_builtins ();
+	}
+      if (TARGET_HTM)
+	htm_init_builtins ();
+
+      if (TARGET_EXTRA_BUILTINS)
+	rs6000_common_init_builtins ();
+
+      ftype = builtin_function_type (DFmode, DFmode, DFmode, VOIDmode,
+				     RS6000_BUILTIN_RECIP,
+				     "__builtin_recipdiv");
+      def_builtin ("__builtin_recipdiv", ftype, RS6000_BUILTIN_RECIP);
+
+      ftype = builtin_function_type (SFmode, SFmode, SFmode, VOIDmode,
+				     RS6000_BUILTIN_RECIPF,
+				     "__builtin_recipdivf");
+      def_builtin ("__builtin_recipdivf", ftype, RS6000_BUILTIN_RECIPF);
+
+      ftype = builtin_function_type (DFmode, DFmode, VOIDmode, VOIDmode,
+				     RS6000_BUILTIN_RSQRT, "__builtin_rsqrt");
+      def_builtin ("__builtin_rsqrt", ftype, RS6000_BUILTIN_RSQRT);
+
+      ftype = builtin_function_type (SFmode, SFmode, VOIDmode, VOIDmode,
+				     RS6000_BUILTIN_RSQRTF,
+				     "__builtin_rsqrtf");
+      def_builtin ("__builtin_rsqrtf", ftype, RS6000_BUILTIN_RSQRTF);
+
+      mode = (TARGET_64BIT) ? DImode : SImode;
+      ftype = builtin_function_type (mode, mode, mode, VOIDmode,
+				     POWER7_BUILTIN_BPERMD,
+				     "__builtin_bpermd");
+      def_builtin ("__builtin_bpermd", ftype, POWER7_BUILTIN_BPERMD);
+
+      ftype = build_function_type_list (unsigned_intDI_type_node,
+					NULL_TREE);
+      def_builtin ("__builtin_ppc_get_timebase", ftype, RS6000_BUILTIN_GET_TB);
+
+      if (TARGET_64BIT)
+	ftype = build_function_type_list (unsigned_intDI_type_node,
+					  NULL_TREE);
+      else
+	ftype = build_function_type_list (unsigned_intSI_type_node,
+					  NULL_TREE);
+      def_builtin ("__builtin_ppc_mftb", ftype, RS6000_BUILTIN_MFTB);
+
+      ftype = build_function_type_list (double_type_node, NULL_TREE);
+      def_builtin ("__builtin_mffs", ftype, RS6000_BUILTIN_MFFS);
+
+      ftype = build_function_type_list (double_type_node, NULL_TREE);
+      def_builtin ("__builtin_mffsl", ftype, RS6000_BUILTIN_MFFSL);
+
+      ftype = build_function_type_list (void_type_node,
+					intSI_type_node,
+					NULL_TREE);
+      def_builtin ("__builtin_mtfsb0", ftype, RS6000_BUILTIN_MTFSB0);
+
+      ftype = build_function_type_list (void_type_node,
+					intSI_type_node,
+					NULL_TREE);
+      def_builtin ("__builtin_mtfsb1", ftype, RS6000_BUILTIN_MTFSB1);
+
+      ftype = build_function_type_list (void_type_node,
+					intDI_type_node,
+					NULL_TREE);
+      def_builtin ("__builtin_set_fpscr_rn", ftype,
+		   RS6000_BUILTIN_SET_FPSCR_RN);
+
+      ftype = build_function_type_list (void_type_node,
+					intDI_type_node,
+					NULL_TREE);
+      def_builtin ("__builtin_set_fpscr_drn", ftype,
+		   RS6000_BUILTIN_SET_FPSCR_DRN);
+
+      ftype = build_function_type_list (void_type_node,
+					intSI_type_node, double_type_node,
+					NULL_TREE);
+      def_builtin ("__builtin_mtfsf", ftype, RS6000_BUILTIN_MTFSF);
+
+      ftype = build_function_type_list (void_type_node, NULL_TREE);
+      def_builtin ("__builtin_cpu_init", ftype, RS6000_BUILTIN_CPU_INIT);
+      def_builtin ("__builtin_ppc_speculation_barrier", ftype,
+		   MISC_BUILTIN_SPEC_BARRIER);
+
+      ftype = build_function_type_list (bool_int_type_node,
+					const_ptr_type_node,
+					NULL_TREE);
+      def_builtin ("__builtin_cpu_is", ftype, RS6000_BUILTIN_CPU_IS);
+      def_builtin ("__builtin_cpu_supports", ftype,
+		   RS6000_BUILTIN_CPU_SUPPORTS);
+
+      if (TARGET_XCOFF)
+	{
+	  /* AIX libm provides clog as __clog.  */
+	  if ((tdecl = builtin_decl_explicit (BUILT_IN_CLOG)) != NULL_TREE)
+	    set_user_assembler_name (tdecl, "__clog");
+
+	  /* When long double is 64 bit, some long double builtins of libc
+	     functions (like __builtin_frexpl) must call the double version
+	     (frexp) not the long double version (frexpl) that expects a
+	     128-bit argument.  */
+	  if (! TARGET_LONG_DOUBLE_128)
+	    {
+	      if ((tdecl = builtin_decl_explicit (BUILT_IN_FMODL))
+		  != NULL_TREE)
+		set_user_assembler_name (tdecl, "fmod");
+	      if ((tdecl = builtin_decl_explicit (BUILT_IN_FREXPL))
+		  != NULL_TREE)
+		set_user_assembler_name (tdecl, "frexp");
+	      if ((tdecl = builtin_decl_explicit (BUILT_IN_LDEXPL))
+		  != NULL_TREE)
+		set_user_assembler_name (tdecl, "ldexp");
+	      if ((tdecl = builtin_decl_explicit (BUILT_IN_MODFL))
+		  != NULL_TREE)
+		set_user_assembler_name (tdecl, "modf");
+	    }
 	}
     }


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

* [gcc(refs/users/wschmidt/heads/builtins4)] rs6000: Disable unnecessary initialization for new support
@ 2020-11-02 22:08 William Schmidt
  0 siblings, 0 replies; 5+ messages in thread
From: William Schmidt @ 2020-11-02 22:08 UTC (permalink / raw)
  To: gcc-cvs

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

commit de3d42f873e8bcceca4f881e104396d5a0bce0bd
Author: Bill Schmidt <wschmidt@linux.ibm.com>
Date:   Mon Nov 2 10:21:55 2020 -0500

    rs6000: Disable unnecessary initialization for new support
    
    2020-11-02  Bill Schmidt  <wschmidt@linux.ibm.com>
    
            * config/rs6000/rs6000-call.c (rs6000-init_builtins): Gate special
            cases with !new_builtins_are_live.

Diff:
---
 gcc/config/rs6000/rs6000-call.c | 227 +++++++++++++++++++++-------------------
 1 file changed, 121 insertions(+), 106 deletions(-)

diff --git a/gcc/config/rs6000/rs6000-call.c b/gcc/config/rs6000/rs6000-call.c
index 04b1745ee4e..4154a1eb099 100644
--- a/gcc/config/rs6000/rs6000-call.c
+++ b/gcc/config/rs6000/rs6000-call.c
@@ -13478,114 +13478,129 @@ rs6000_init_builtins (void)
   /* Execute the autogenerated initialization code for builtins.  */
   rs6000_autoinit_builtins ();
 
-  /* Create Altivec, VSX and MMA builtins on machines with at least the
-     general purpose extensions (970 and newer) to allow the use of
-     the target attribute.  */
-  if (TARGET_EXTRA_BUILTINS)
+  if (!new_builtins_are_live)
     {
-      altivec_init_builtins ();
-      mma_init_builtins ();
-    }
-  if (TARGET_HTM)
-    htm_init_builtins ();
-
-  if (TARGET_EXTRA_BUILTINS)
-    rs6000_common_init_builtins ();
-
-  ftype = builtin_function_type (DFmode, DFmode, DFmode, VOIDmode,
-				 RS6000_BUILTIN_RECIP, "__builtin_recipdiv");
-  def_builtin ("__builtin_recipdiv", ftype, RS6000_BUILTIN_RECIP);
-
-  ftype = builtin_function_type (SFmode, SFmode, SFmode, VOIDmode,
-				 RS6000_BUILTIN_RECIPF, "__builtin_recipdivf");
-  def_builtin ("__builtin_recipdivf", ftype, RS6000_BUILTIN_RECIPF);
-
-  ftype = builtin_function_type (DFmode, DFmode, VOIDmode, VOIDmode,
-				 RS6000_BUILTIN_RSQRT, "__builtin_rsqrt");
-  def_builtin ("__builtin_rsqrt", ftype, RS6000_BUILTIN_RSQRT);
-
-  ftype = builtin_function_type (SFmode, SFmode, VOIDmode, VOIDmode,
-				 RS6000_BUILTIN_RSQRTF, "__builtin_rsqrtf");
-  def_builtin ("__builtin_rsqrtf", ftype, RS6000_BUILTIN_RSQRTF);
-
-  mode = (TARGET_64BIT) ? DImode : SImode;
-  ftype = builtin_function_type (mode, mode, mode, VOIDmode,
-				 POWER7_BUILTIN_BPERMD, "__builtin_bpermd");
-  def_builtin ("__builtin_bpermd", ftype, POWER7_BUILTIN_BPERMD);
-
-  ftype = build_function_type_list (unsigned_intDI_type_node,
-				    NULL_TREE);
-  def_builtin ("__builtin_ppc_get_timebase", ftype, RS6000_BUILTIN_GET_TB);
-
-  if (TARGET_64BIT)
-    ftype = build_function_type_list (unsigned_intDI_type_node,
-				      NULL_TREE);
-  else
-    ftype = build_function_type_list (unsigned_intSI_type_node,
-				      NULL_TREE);
-  def_builtin ("__builtin_ppc_mftb", ftype, RS6000_BUILTIN_MFTB);
-
-  ftype = build_function_type_list (double_type_node, NULL_TREE);
-  def_builtin ("__builtin_mffs", ftype, RS6000_BUILTIN_MFFS);
-
-  ftype = build_function_type_list (double_type_node, NULL_TREE);
-  def_builtin ("__builtin_mffsl", ftype, RS6000_BUILTIN_MFFSL);
-
-  ftype = build_function_type_list (void_type_node,
-				    intSI_type_node,
-				    NULL_TREE);
-  def_builtin ("__builtin_mtfsb0", ftype, RS6000_BUILTIN_MTFSB0);
-
-  ftype = build_function_type_list (void_type_node,
-				    intSI_type_node,
-				    NULL_TREE);
-  def_builtin ("__builtin_mtfsb1", ftype, RS6000_BUILTIN_MTFSB1);
-
-  ftype = build_function_type_list (void_type_node,
-				    intDI_type_node,
-				    NULL_TREE);
-  def_builtin ("__builtin_set_fpscr_rn", ftype, RS6000_BUILTIN_SET_FPSCR_RN);
-
-  ftype = build_function_type_list (void_type_node,
-				    intDI_type_node,
-				    NULL_TREE);
-  def_builtin ("__builtin_set_fpscr_drn", ftype, RS6000_BUILTIN_SET_FPSCR_DRN);
-
-  ftype = build_function_type_list (void_type_node,
-				    intSI_type_node, double_type_node,
-				    NULL_TREE);
-  def_builtin ("__builtin_mtfsf", ftype, RS6000_BUILTIN_MTFSF);
-
-  ftype = build_function_type_list (void_type_node, NULL_TREE);
-  def_builtin ("__builtin_cpu_init", ftype, RS6000_BUILTIN_CPU_INIT);
-  def_builtin ("__builtin_ppc_speculation_barrier", ftype,
-	       MISC_BUILTIN_SPEC_BARRIER);
-
-  ftype = build_function_type_list (bool_int_type_node, const_ptr_type_node,
-				    NULL_TREE);
-  def_builtin ("__builtin_cpu_is", ftype, RS6000_BUILTIN_CPU_IS);
-  def_builtin ("__builtin_cpu_supports", ftype, RS6000_BUILTIN_CPU_SUPPORTS);
-
-  if (TARGET_XCOFF)
-    {
-      /* AIX libm provides clog as __clog.  */
-      if ((tdecl = builtin_decl_explicit (BUILT_IN_CLOG)) != NULL_TREE)
-	set_user_assembler_name (tdecl, "__clog");
-
-      /* When long double is 64 bit, some long double builtins of libc
-	 functions (like __builtin_frexpl) must call the double version
-	 (frexp) not the long double version (frexpl) that expects a 128 bit
-	 argument.  */
-      if (! TARGET_LONG_DOUBLE_128)
+      /* Create Altivec, VSX and MMA builtins on machines with at least the
+	 general purpose extensions (970 and newer) to allow the use of
+	 the target attribute.  */
+      if (TARGET_EXTRA_BUILTINS)
 	{
-	  if ((tdecl = builtin_decl_explicit (BUILT_IN_FMODL)) != NULL_TREE)
-	    set_user_assembler_name (tdecl, "fmod");
-	  if ((tdecl = builtin_decl_explicit (BUILT_IN_FREXPL)) != NULL_TREE)
-	    set_user_assembler_name (tdecl, "frexp");
-	  if ((tdecl = builtin_decl_explicit (BUILT_IN_LDEXPL)) != NULL_TREE)
-	    set_user_assembler_name (tdecl, "ldexp");
-	  if ((tdecl = builtin_decl_explicit (BUILT_IN_MODFL)) != NULL_TREE)
-	    set_user_assembler_name (tdecl, "modf");
+	  altivec_init_builtins ();
+	  mma_init_builtins ();
+	}
+      if (TARGET_HTM)
+	htm_init_builtins ();
+
+      if (TARGET_EXTRA_BUILTINS)
+	rs6000_common_init_builtins ();
+
+      ftype = builtin_function_type (DFmode, DFmode, DFmode, VOIDmode,
+				     RS6000_BUILTIN_RECIP,
+				     "__builtin_recipdiv");
+      def_builtin ("__builtin_recipdiv", ftype, RS6000_BUILTIN_RECIP);
+
+      ftype = builtin_function_type (SFmode, SFmode, SFmode, VOIDmode,
+				     RS6000_BUILTIN_RECIPF,
+				     "__builtin_recipdivf");
+      def_builtin ("__builtin_recipdivf", ftype, RS6000_BUILTIN_RECIPF);
+
+      ftype = builtin_function_type (DFmode, DFmode, VOIDmode, VOIDmode,
+				     RS6000_BUILTIN_RSQRT, "__builtin_rsqrt");
+      def_builtin ("__builtin_rsqrt", ftype, RS6000_BUILTIN_RSQRT);
+
+      ftype = builtin_function_type (SFmode, SFmode, VOIDmode, VOIDmode,
+				     RS6000_BUILTIN_RSQRTF,
+				     "__builtin_rsqrtf");
+      def_builtin ("__builtin_rsqrtf", ftype, RS6000_BUILTIN_RSQRTF);
+
+      mode = (TARGET_64BIT) ? DImode : SImode;
+      ftype = builtin_function_type (mode, mode, mode, VOIDmode,
+				     POWER7_BUILTIN_BPERMD,
+				     "__builtin_bpermd");
+      def_builtin ("__builtin_bpermd", ftype, POWER7_BUILTIN_BPERMD);
+
+      ftype = build_function_type_list (unsigned_intDI_type_node,
+					NULL_TREE);
+      def_builtin ("__builtin_ppc_get_timebase", ftype, RS6000_BUILTIN_GET_TB);
+
+      if (TARGET_64BIT)
+	ftype = build_function_type_list (unsigned_intDI_type_node,
+					  NULL_TREE);
+      else
+	ftype = build_function_type_list (unsigned_intSI_type_node,
+					  NULL_TREE);
+      def_builtin ("__builtin_ppc_mftb", ftype, RS6000_BUILTIN_MFTB);
+
+      ftype = build_function_type_list (double_type_node, NULL_TREE);
+      def_builtin ("__builtin_mffs", ftype, RS6000_BUILTIN_MFFS);
+
+      ftype = build_function_type_list (double_type_node, NULL_TREE);
+      def_builtin ("__builtin_mffsl", ftype, RS6000_BUILTIN_MFFSL);
+
+      ftype = build_function_type_list (void_type_node,
+					intSI_type_node,
+					NULL_TREE);
+      def_builtin ("__builtin_mtfsb0", ftype, RS6000_BUILTIN_MTFSB0);
+
+      ftype = build_function_type_list (void_type_node,
+					intSI_type_node,
+					NULL_TREE);
+      def_builtin ("__builtin_mtfsb1", ftype, RS6000_BUILTIN_MTFSB1);
+
+      ftype = build_function_type_list (void_type_node,
+					intDI_type_node,
+					NULL_TREE);
+      def_builtin ("__builtin_set_fpscr_rn", ftype,
+		   RS6000_BUILTIN_SET_FPSCR_RN);
+
+      ftype = build_function_type_list (void_type_node,
+					intDI_type_node,
+					NULL_TREE);
+      def_builtin ("__builtin_set_fpscr_drn", ftype,
+		   RS6000_BUILTIN_SET_FPSCR_DRN);
+
+      ftype = build_function_type_list (void_type_node,
+					intSI_type_node, double_type_node,
+					NULL_TREE);
+      def_builtin ("__builtin_mtfsf", ftype, RS6000_BUILTIN_MTFSF);
+
+      ftype = build_function_type_list (void_type_node, NULL_TREE);
+      def_builtin ("__builtin_cpu_init", ftype, RS6000_BUILTIN_CPU_INIT);
+      def_builtin ("__builtin_ppc_speculation_barrier", ftype,
+		   MISC_BUILTIN_SPEC_BARRIER);
+
+      ftype = build_function_type_list (bool_int_type_node,
+					const_ptr_type_node,
+					NULL_TREE);
+      def_builtin ("__builtin_cpu_is", ftype, RS6000_BUILTIN_CPU_IS);
+      def_builtin ("__builtin_cpu_supports", ftype,
+		   RS6000_BUILTIN_CPU_SUPPORTS);
+
+      if (TARGET_XCOFF)
+	{
+	  /* AIX libm provides clog as __clog.  */
+	  if ((tdecl = builtin_decl_explicit (BUILT_IN_CLOG)) != NULL_TREE)
+	    set_user_assembler_name (tdecl, "__clog");
+
+	  /* When long double is 64 bit, some long double builtins of libc
+	     functions (like __builtin_frexpl) must call the double version
+	     (frexp) not the long double version (frexpl) that expects a
+	     128-bit argument.  */
+	  if (! TARGET_LONG_DOUBLE_128)
+	    {
+	      if ((tdecl = builtin_decl_explicit (BUILT_IN_FMODL))
+		  != NULL_TREE)
+		set_user_assembler_name (tdecl, "fmod");
+	      if ((tdecl = builtin_decl_explicit (BUILT_IN_FREXPL))
+		  != NULL_TREE)
+		set_user_assembler_name (tdecl, "frexp");
+	      if ((tdecl = builtin_decl_explicit (BUILT_IN_LDEXPL))
+		  != NULL_TREE)
+		set_user_assembler_name (tdecl, "ldexp");
+	      if ((tdecl = builtin_decl_explicit (BUILT_IN_MODFL))
+		  != NULL_TREE)
+		set_user_assembler_name (tdecl, "modf");
+	    }
 	}
     }


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

* [gcc(refs/users/wschmidt/heads/builtins4)] rs6000: Disable unnecessary initialization for new support
@ 2020-11-02 15:22 William Schmidt
  0 siblings, 0 replies; 5+ messages in thread
From: William Schmidt @ 2020-11-02 15:22 UTC (permalink / raw)
  To: gcc-cvs

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

commit 3bc9f27d9e97cbf2c7940a681c0d3583fa943504
Author: Bill Schmidt <wschmidt@linux.ibm.com>
Date:   Mon Nov 2 10:21:55 2020 -0500

    rs6000: Disable unnecessary initialization for new support
    
    2020-11-02  Bill Schmidt  <wschmidt@linux.ibm.com>
    
            * config/rs6000/rs6000-call.c (rs6000-init_builtins): Gate special
            cases with !new_builtins_are_live.

Diff:
---
 gcc/config/rs6000/rs6000-call.c | 226 +++++++++++++++++++++-------------------
 1 file changed, 119 insertions(+), 107 deletions(-)

diff --git a/gcc/config/rs6000/rs6000-call.c b/gcc/config/rs6000/rs6000-call.c
index 0cc05aaa0fe..f8577159c4c 100644
--- a/gcc/config/rs6000/rs6000-call.c
+++ b/gcc/config/rs6000/rs6000-call.c
@@ -13350,114 +13350,126 @@ rs6000_init_builtins (void)
   /* Execute the autogenerated initialization code for builtins.  */
   rs6000_autoinit_builtins ();
 
-  /* Create Altivec, VSX and MMA builtins on machines with at least the
-     general purpose extensions (970 and newer) to allow the use of
-     the target attribute.  */
-  if (TARGET_EXTRA_BUILTINS)
-    {
-      altivec_init_builtins ();
-      mma_init_builtins ();
-    }
-  if (TARGET_HTM)
-    htm_init_builtins ();
-
-  if (TARGET_EXTRA_BUILTINS)
-    rs6000_common_init_builtins ();
-
-  ftype = builtin_function_type (DFmode, DFmode, DFmode, VOIDmode,
-				 RS6000_BUILTIN_RECIP, "__builtin_recipdiv");
-  def_builtin ("__builtin_recipdiv", ftype, RS6000_BUILTIN_RECIP);
-
-  ftype = builtin_function_type (SFmode, SFmode, SFmode, VOIDmode,
-				 RS6000_BUILTIN_RECIPF, "__builtin_recipdivf");
-  def_builtin ("__builtin_recipdivf", ftype, RS6000_BUILTIN_RECIPF);
-
-  ftype = builtin_function_type (DFmode, DFmode, VOIDmode, VOIDmode,
-				 RS6000_BUILTIN_RSQRT, "__builtin_rsqrt");
-  def_builtin ("__builtin_rsqrt", ftype, RS6000_BUILTIN_RSQRT);
-
-  ftype = builtin_function_type (SFmode, SFmode, VOIDmode, VOIDmode,
-				 RS6000_BUILTIN_RSQRTF, "__builtin_rsqrtf");
-  def_builtin ("__builtin_rsqrtf", ftype, RS6000_BUILTIN_RSQRTF);
-
-  mode = (TARGET_64BIT) ? DImode : SImode;
-  ftype = builtin_function_type (mode, mode, mode, VOIDmode,
-				 POWER7_BUILTIN_BPERMD, "__builtin_bpermd");
-  def_builtin ("__builtin_bpermd", ftype, POWER7_BUILTIN_BPERMD);
-
-  ftype = build_function_type_list (unsigned_intDI_type_node,
-				    NULL_TREE);
-  def_builtin ("__builtin_ppc_get_timebase", ftype, RS6000_BUILTIN_GET_TB);
-
-  if (TARGET_64BIT)
-    ftype = build_function_type_list (unsigned_intDI_type_node,
-				      NULL_TREE);
-  else
-    ftype = build_function_type_list (unsigned_intSI_type_node,
-				      NULL_TREE);
-  def_builtin ("__builtin_ppc_mftb", ftype, RS6000_BUILTIN_MFTB);
-
-  ftype = build_function_type_list (double_type_node, NULL_TREE);
-  def_builtin ("__builtin_mffs", ftype, RS6000_BUILTIN_MFFS);
-
-  ftype = build_function_type_list (double_type_node, NULL_TREE);
-  def_builtin ("__builtin_mffsl", ftype, RS6000_BUILTIN_MFFSL);
-
-  ftype = build_function_type_list (void_type_node,
-				    intSI_type_node,
-				    NULL_TREE);
-  def_builtin ("__builtin_mtfsb0", ftype, RS6000_BUILTIN_MTFSB0);
-
-  ftype = build_function_type_list (void_type_node,
-				    intSI_type_node,
-				    NULL_TREE);
-  def_builtin ("__builtin_mtfsb1", ftype, RS6000_BUILTIN_MTFSB1);
-
-  ftype = build_function_type_list (void_type_node,
-				    intDI_type_node,
-				    NULL_TREE);
-  def_builtin ("__builtin_set_fpscr_rn", ftype, RS6000_BUILTIN_SET_FPSCR_RN);
-
-  ftype = build_function_type_list (void_type_node,
-				    intDI_type_node,
-				    NULL_TREE);
-  def_builtin ("__builtin_set_fpscr_drn", ftype, RS6000_BUILTIN_SET_FPSCR_DRN);
-
-  ftype = build_function_type_list (void_type_node,
-				    intSI_type_node, double_type_node,
-				    NULL_TREE);
-  def_builtin ("__builtin_mtfsf", ftype, RS6000_BUILTIN_MTFSF);
-
-  ftype = build_function_type_list (void_type_node, NULL_TREE);
-  def_builtin ("__builtin_cpu_init", ftype, RS6000_BUILTIN_CPU_INIT);
-  def_builtin ("__builtin_ppc_speculation_barrier", ftype,
-	       MISC_BUILTIN_SPEC_BARRIER);
-
-  ftype = build_function_type_list (bool_int_type_node, const_ptr_type_node,
-				    NULL_TREE);
-  def_builtin ("__builtin_cpu_is", ftype, RS6000_BUILTIN_CPU_IS);
-  def_builtin ("__builtin_cpu_supports", ftype, RS6000_BUILTIN_CPU_SUPPORTS);
-
-  if (TARGET_XCOFF)
-    {
-      /* AIX libm provides clog as __clog.  */
-      if ((tdecl = builtin_decl_explicit (BUILT_IN_CLOG)) != NULL_TREE)
-	set_user_assembler_name (tdecl, "__clog");
-
-      /* When long double is 64 bit, some long double builtins of libc
-	 functions (like __builtin_frexpl) must call the double version
-	 (frexp) not the long double version (frexpl) that expects a 128 bit
-	 argument.  */
-      if (! TARGET_LONG_DOUBLE_128)
+  if (!new_builtins_are_live)
+    {
+      /* Create Altivec, VSX and MMA builtins on machines with at least the
+	 general purpose extensions (970 and newer) to allow the use of
+	 the target attribute.  */
+      if (TARGET_EXTRA_BUILTINS)
+	altivec_init_builtins ();
+      if (TARGET_HTM)
+	htm_init_builtins ();
+
+      if (TARGET_EXTRA_BUILTINS)
+	rs6000_common_init_builtins ();
+
+      ftype = builtin_function_type (DFmode, DFmode, DFmode, VOIDmode,
+				     RS6000_BUILTIN_RECIP,
+				     "__builtin_recipdiv");
+      def_builtin ("__builtin_recipdiv", ftype, RS6000_BUILTIN_RECIP);
+
+      ftype = builtin_function_type (SFmode, SFmode, SFmode, VOIDmode,
+				     RS6000_BUILTIN_RECIPF,
+				     "__builtin_recipdivf");
+      def_builtin ("__builtin_recipdivf", ftype, RS6000_BUILTIN_RECIPF);
+
+      ftype = builtin_function_type (DFmode, DFmode, VOIDmode, VOIDmode,
+				     RS6000_BUILTIN_RSQRT, "__builtin_rsqrt");
+      def_builtin ("__builtin_rsqrt", ftype, RS6000_BUILTIN_RSQRT);
+
+      ftype = builtin_function_type (SFmode, SFmode, VOIDmode, VOIDmode,
+				     RS6000_BUILTIN_RSQRTF,
+				     "__builtin_rsqrtf");
+      def_builtin ("__builtin_rsqrtf", ftype, RS6000_BUILTIN_RSQRTF);
+
+      mode = (TARGET_64BIT) ? DImode : SImode;
+      ftype = builtin_function_type (mode, mode, mode, VOIDmode,
+				     POWER7_BUILTIN_BPERMD,
+				     "__builtin_bpermd");
+      def_builtin ("__builtin_bpermd", ftype, POWER7_BUILTIN_BPERMD);
+
+      ftype = build_function_type_list (unsigned_intDI_type_node,
+					NULL_TREE);
+      def_builtin ("__builtin_ppc_get_timebase", ftype, RS6000_BUILTIN_GET_TB);
+
+      if (TARGET_64BIT)
+	ftype = build_function_type_list (unsigned_intDI_type_node,
+					  NULL_TREE);
+      else
+	ftype = build_function_type_list (unsigned_intSI_type_node,
+					  NULL_TREE);
+      def_builtin ("__builtin_ppc_mftb", ftype, RS6000_BUILTIN_MFTB);
+
+      ftype = build_function_type_list (double_type_node, NULL_TREE);
+      def_builtin ("__builtin_mffs", ftype, RS6000_BUILTIN_MFFS);
+
+      ftype = build_function_type_list (double_type_node, NULL_TREE);
+      def_builtin ("__builtin_mffsl", ftype, RS6000_BUILTIN_MFFSL);
+
+      ftype = build_function_type_list (void_type_node,
+					intSI_type_node,
+					NULL_TREE);
+      def_builtin ("__builtin_mtfsb0", ftype, RS6000_BUILTIN_MTFSB0);
+
+      ftype = build_function_type_list (void_type_node,
+					intSI_type_node,
+					NULL_TREE);
+      def_builtin ("__builtin_mtfsb1", ftype, RS6000_BUILTIN_MTFSB1);
+
+      ftype = build_function_type_list (void_type_node,
+					intDI_type_node,
+					NULL_TREE);
+      def_builtin ("__builtin_set_fpscr_rn", ftype,
+		   RS6000_BUILTIN_SET_FPSCR_RN);
+
+      ftype = build_function_type_list (void_type_node,
+					intDI_type_node,
+					NULL_TREE);
+      def_builtin ("__builtin_set_fpscr_drn", ftype,
+		   RS6000_BUILTIN_SET_FPSCR_DRN);
+
+      ftype = build_function_type_list (void_type_node,
+					intSI_type_node, double_type_node,
+					NULL_TREE);
+      def_builtin ("__builtin_mtfsf", ftype, RS6000_BUILTIN_MTFSF);
+
+      ftype = build_function_type_list (void_type_node, NULL_TREE);
+      def_builtin ("__builtin_cpu_init", ftype, RS6000_BUILTIN_CPU_INIT);
+      def_builtin ("__builtin_ppc_speculation_barrier", ftype,
+		   MISC_BUILTIN_SPEC_BARRIER);
+
+      ftype = build_function_type_list (bool_int_type_node,
+					const_ptr_type_node,
+					NULL_TREE);
+      def_builtin ("__builtin_cpu_is", ftype, RS6000_BUILTIN_CPU_IS);
+      def_builtin ("__builtin_cpu_supports", ftype,
+		   RS6000_BUILTIN_CPU_SUPPORTS);
+
+      if (TARGET_XCOFF)
 	{
-	  if ((tdecl = builtin_decl_explicit (BUILT_IN_FMODL)) != NULL_TREE)
-	    set_user_assembler_name (tdecl, "fmod");
-	  if ((tdecl = builtin_decl_explicit (BUILT_IN_FREXPL)) != NULL_TREE)
-	    set_user_assembler_name (tdecl, "frexp");
-	  if ((tdecl = builtin_decl_explicit (BUILT_IN_LDEXPL)) != NULL_TREE)
-	    set_user_assembler_name (tdecl, "ldexp");
-	  if ((tdecl = builtin_decl_explicit (BUILT_IN_MODFL)) != NULL_TREE)
-	    set_user_assembler_name (tdecl, "modf");
+	  /* AIX libm provides clog as __clog.  */
+	  if ((tdecl = builtin_decl_explicit (BUILT_IN_CLOG)) != NULL_TREE)
+	    set_user_assembler_name (tdecl, "__clog");
+
+	  /* When long double is 64 bit, some long double builtins of libc
+	     functions (like __builtin_frexpl) must call the double version
+	     (frexp) not the long double version (frexpl) that expects a
+	     128-bit argument.  */
+	  if (! TARGET_LONG_DOUBLE_128)
+	    {
+	      if ((tdecl = builtin_decl_explicit (BUILT_IN_FMODL))
+		  != NULL_TREE)
+		set_user_assembler_name (tdecl, "fmod");
+	      if ((tdecl = builtin_decl_explicit (BUILT_IN_FREXPL))
+		  != NULL_TREE)
+		set_user_assembler_name (tdecl, "frexp");
+	      if ((tdecl = builtin_decl_explicit (BUILT_IN_LDEXPL))
+		  != NULL_TREE)
+		set_user_assembler_name (tdecl, "ldexp");
+	      if ((tdecl = builtin_decl_explicit (BUILT_IN_MODFL))
+		  != NULL_TREE)
+		set_user_assembler_name (tdecl, "modf");
+	    }
 	}
     }


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

end of thread, other threads:[~2021-02-07 18:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-16 18:07 [gcc(refs/users/wschmidt/heads/builtins4)] rs6000: Disable unnecessary initialization for new support William Schmidt
  -- strict thread matches above, loose matches on Subject: below --
2021-02-07 18:13 William Schmidt
2020-11-24 16:44 William Schmidt
2020-11-02 22:08 William Schmidt
2020-11-02 15:22 William Schmidt

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).