[gcc(refs/users/wschmidt/heads/builtins2)] Disable unnecessary special-case initialization for new support.

William Schmidt wschmidt@gcc.gnu.org
Sat Mar 21 19:22:11 GMT 2020


https://gcc.gnu.org/g:76e41e1330f7a7edfd243cf2257dd334ef988e9d

commit 76e41e1330f7a7edfd243cf2257dd334ef988e9d
Author: Bill Schmidt <wschmidt@linux.ibm.com>
Date:   Sat Mar 21 14:21:30 2020 -0500

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

Diff:
---
 gcc/config/rs6000/rs6000-call.c | 186 +++++++++++++++++++++-------------------
 1 file changed, 97 insertions(+), 89 deletions(-)

diff --git a/gcc/config/rs6000/rs6000-call.c b/gcc/config/rs6000/rs6000-call.c
index d041a483a81..b724505b7c9 100644
--- a/gcc/config/rs6000/rs6000-call.c
+++ b/gcc/config/rs6000/rs6000-call.c
@@ -12102,95 +12102,103 @@ rs6000_init_builtins (void)
   /* Execute the autogenerated initialization code for builtins.  */
   rs6000_autoinit_builtins ();
 
-  /* Create Altivec and VSX 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);
-
-  /* AIX libm provides clog as __clog.  */
-  if (TARGET_XCOFF &&
-      (tdecl = builtin_decl_explicit (BUILT_IN_CLOG)) != NULL_TREE)
-    set_user_assembler_name (tdecl, "__clog");
+  if (!new_builtins_are_live)
+    {
+      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);
+
+      /* AIX libm provides clog as __clog.  */
+      if (TARGET_XCOFF &&
+	  (tdecl = builtin_decl_explicit (BUILT_IN_CLOG)) != NULL_TREE)
+	set_user_assembler_name (tdecl, "__clog");
+    }
 
 #ifdef SUBTARGET_INIT_BUILTINS
   SUBTARGET_INIT_BUILTINS;


More information about the Gcc-cvs mailing list