public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Bill Schmidt <wschmidt@linux.vnet.ibm.com>
To: gcc-patches@gcc.gnu.org
Cc: segher@kernel.crashing.org, dje@gcc.gnu.org,
	Bill Schmidt <wschmidt@linux.ibm.com>
Subject: [PATCH 5/6] rs6000: Rename functions with "new" in their names
Date: Fri,  3 Dec 2021 12:22:55 -0600	[thread overview]
Message-ID: <28d8a61cff8e73deffe4c4c0a7d75bfe42959783.1638554381.git.wschmidt@linux.ibm.com> (raw)
In-Reply-To: <cover.1638554381.git.wschmidt@linux.ibm.com>
In-Reply-To: <cover.1638554381.git.wschmidt@linux.ibm.com>

From: Bill Schmidt <wschmidt@linux.ibm.com>

Hi!

While we had two sets of built-in functionality at the same time, I put "new"
in the names of quite a few functions.  Time to undo that.

Bootstrapped and tested on powerpc64le-linux-gnu with no regressions.  Is this
okay for trunk?

Thanks!
Bill

2021-12-02  Bill Schmidt  <wschmidt@linux.ibm.com>

gcc/
	* config/rs6000/rs6000-c.c (altivec_resolve_new_overloaded_builtin):
	Remove forward declaration.
	(rs6000_new_builtin_type_compatible): Rename to
	rs6000_builtin_type_compatible.
	(rs6000_builtin_type_compatible): Remove.
	(altivec_resolve_overloaded_builtin): Remove.
	(altivec_build_new_resolved_builtin): Rename to
	altivec_build_resolved_builtin.
	(altivec_resolve_new_overloaded_builtin): Rename to
	altivec_resolve_overloaded_builtin.  Remove static keyword.  Adjust
	called function names.
	* config/rs6000/rs6000-call.c (rs6000_expand_new_builtin): Remove
	forward declaration.
	(rs6000_gimple_fold_new_builtin): Likewise.
	(rs6000_invalid_new_builtin): Rename to rs6000_invalid_builtin.
	(rs6000_gimple_fold_builtin): Remove.
	(rs6000_new_builtin_valid_without_lhs): Rename to
	rs6000_builtin_valid_without_lhs.
	(rs6000_new_builtin_is_supported): Rename to
	rs6000_builtin_is_supported.
	(rs6000_gimple_fold_new_mma_builtin): Rename to
	rs6000_gimple_fold_mma_builtin.
	(rs6000_gimple_fold_new_builtin): Rename to
	rs6000_gimple_fold_builtin.  Remove static keyword.  Adjust called
	function names.
	(rs6000_expand_builtin): Remove.
	(new_cpu_expand_builtin): Rename to cpu_expand_builtin.
	(new_mma_expand_builtin): Rename to mma_expand_builtin.
	(new_htm_spr_num): Rename to htm_spr_num.
	(new_htm_expand_builtin): Rename to htm_expand_builtin.  Change name
	of called function.
	(rs6000_expand_new_builtin): Rename to rs6000_expand_builtin.  Remove
	static keyword.  Adjust called function names.
	(rs6000_new_builtin_decl): Rename to rs6000_builtin_decl.  Remove
	static keyword.
	(rs6000_builtin_decl): Remove.
	* config/rs6000/rs6000-gen-builtins.c (write_decls): In gnerated code,
	rename rs6000_new_builtin_is_supported to rs6000_builtin_is_supported.
	* config/rs6000/rs6000-internal.h (rs6000_invalid_new_builtin): Rename
	to rs6000_invalid_builtin.
	* config/rs6000/rs6000.c (rs6000_new_builtin_vectorized_function):
	Rename to rs6000_builtin_vectorized_function.
	(rs6000_new_builtin_md_vectorized_function): Rename to
	rs6000_builtin_md_vectorized_function.
	(rs6000_builtin_vectorized_function): Remove.
	(rs6000_builtin_md_vectorized_function): Remove.
---
 gcc/config/rs6000/rs6000-c.c            | 120 +++++++++---------------
 gcc/config/rs6000/rs6000-call.c         |  99 ++++++-------------
 gcc/config/rs6000/rs6000-gen-builtins.c |   3 +-
 gcc/config/rs6000/rs6000-internal.h     |   2 +-
 gcc/config/rs6000/rs6000.c              |  31 ++----
 5 files changed, 80 insertions(+), 175 deletions(-)

diff --git a/gcc/config/rs6000/rs6000-c.c b/gcc/config/rs6000/rs6000-c.c
index d44edf585aa..f790c72d621 100644
--- a/gcc/config/rs6000/rs6000-c.c
+++ b/gcc/config/rs6000/rs6000-c.c
@@ -37,9 +37,6 @@
 
 #include "rs6000-internal.h"
 
-static tree altivec_resolve_new_overloaded_builtin (location_t, tree, void *);
-
-
 /* Handle the machine specific pragma longcall.  Its syntax is
 
    # pragma longcall ( TOGGLE )
@@ -817,7 +814,7 @@ is_float128_p (tree t)
 
 /* Return true iff ARGTYPE can be compatibly passed as PARMTYPE.  */
 static bool
-rs6000_new_builtin_type_compatible (tree parmtype, tree argtype)
+rs6000_builtin_type_compatible (tree parmtype, tree argtype)
 {
   if (parmtype == error_mark_node)
     return false;
@@ -840,23 +837,6 @@ rs6000_new_builtin_type_compatible (tree parmtype, tree argtype)
   return lang_hooks.types_compatible_p (parmtype, argtype);
 }
 
-static inline bool
-rs6000_builtin_type_compatible (tree t, int id)
-{
-  tree builtin_type;
-  builtin_type = rs6000_builtin_type (id);
-  if (t == error_mark_node)
-    return false;
-  if (INTEGRAL_TYPE_P (t) && INTEGRAL_TYPE_P (builtin_type))
-    return true;
-  else if (TARGET_IEEEQUAD && TARGET_LONG_DOUBLE_128
-	   && is_float128_p (t) && is_float128_p (builtin_type))
-    return true;
-  else
-    return lang_hooks.types_compatible_p (t, builtin_type);
-}
-
-
 /* In addition to calling fold_convert for EXPR of type TYPE, also
    call c_fully_fold to remove any C_MAYBE_CONST_EXPRs that could be
    hiding there (PR47197).  */
@@ -873,16 +853,6 @@ fully_fold_convert (tree type, tree expr)
   return result;
 }
 
-/* Implementation of the resolve_overloaded_builtin target hook, to
-   support Altivec's overloaded builtins.  */
-
-tree
-altivec_resolve_overloaded_builtin (location_t loc, tree fndecl,
-				    void *passed_arglist)
-{
-  return altivec_resolve_new_overloaded_builtin (loc, fndecl, passed_arglist);
-}
-
 /* Build a tree for a function call to an Altivec non-overloaded builtin.
    The overloaded builtin that matched the types and args is described
    by DESC.  The N arguments are given in ARGS, respectively.
@@ -891,10 +861,9 @@ altivec_resolve_overloaded_builtin (location_t loc, tree fndecl,
    a small exception for vec_{all,any}_{ge,le} predicates. */
 
 static tree
-altivec_build_new_resolved_builtin (tree *args, int n, tree fntype,
-				    tree ret_type,
-				    rs6000_gen_builtins bif_id,
-				    rs6000_gen_builtins ovld_id)
+altivec_build_resolved_builtin (tree *args, int n, tree fntype, tree ret_type,
+				rs6000_gen_builtins bif_id,
+				rs6000_gen_builtins ovld_id)
 {
   tree argtypes = TYPE_ARG_TYPES (fntype);
   tree arg_type[MAX_OVLD_ARGS];
@@ -963,9 +932,9 @@ altivec_build_new_resolved_builtin (tree *args, int n, tree fntype,
    support Altivec's overloaded builtins.  FIXME: This code needs
    to be brutally factored.  */
 
-static tree
-altivec_resolve_new_overloaded_builtin (location_t loc, tree fndecl,
-					void *passed_arglist)
+tree
+altivec_resolve_overloaded_builtin (location_t loc, tree fndecl,
+				    void *passed_arglist)
 {
   vec<tree, va_gc> *arglist = static_cast<vec<tree, va_gc> *> (passed_arglist);
   unsigned int nargs = vec_safe_length (arglist);
@@ -1096,7 +1065,7 @@ altivec_resolve_new_overloaded_builtin (location_t loc, tree fndecl,
 		vec<tree, va_gc> *params = make_tree_vector ();
 		vec_safe_push (params, arg0);
 		vec_safe_push (params, arg1);
-		tree call = altivec_resolve_new_overloaded_builtin
+		tree call = altivec_resolve_overloaded_builtin
 		  (loc, rs6000_builtin_decls_x[RS6000_OVLD_VEC_CMPEQ],
 		   params);
 		/* Use save_expr to ensure that operands used more than once
@@ -1106,7 +1075,7 @@ altivec_resolve_new_overloaded_builtin (location_t loc, tree fndecl,
 		params = make_tree_vector ();
 		vec_safe_push (params, call);
 		vec_safe_push (params, call);
-		return altivec_resolve_new_overloaded_builtin
+		return altivec_resolve_overloaded_builtin
 		  (loc, rs6000_builtin_decls_x[RS6000_OVLD_VEC_NOR], params);
 	      }
 	      /* Other types are errors.  */
@@ -1165,9 +1134,8 @@ altivec_resolve_new_overloaded_builtin (location_t loc, tree fndecl,
 		add_sub_builtin = rs6000_builtin_decls_x[RS6000_OVLD_VEC_SUB];
 
 	      tree call
-		= altivec_resolve_new_overloaded_builtin (loc,
-							  add_sub_builtin,
-							  params);
+		= altivec_resolve_overloaded_builtin (loc, add_sub_builtin,
+						      params);
 	      tree const1 = build_int_cstu (TREE_TYPE (arg0_type), 1);
 	      tree ones_vector = build_vector_from_val (arg0_type, const1);
 	      tree and_expr = fold_build2_loc (loc, BIT_AND_EXPR, arg0_type,
@@ -1175,9 +1143,8 @@ altivec_resolve_new_overloaded_builtin (location_t loc, tree fndecl,
 	      params = make_tree_vector ();
 	      vec_safe_push (params, call);
 	      vec_safe_push (params, and_expr);
-	      return altivec_resolve_new_overloaded_builtin (loc,
-							     add_sub_builtin,
-							     params);
+	      return altivec_resolve_overloaded_builtin (loc, add_sub_builtin,
+							 params);
 	    }
 	  /* For {un}signed __int128s use the vaddeuqm/vsubeuqm instruction
 	     directly.  */
@@ -1244,9 +1211,8 @@ altivec_resolve_new_overloaded_builtin (location_t loc, tree fndecl,
 	    else
 	      as_c_builtin = rs6000_builtin_decls_x[RS6000_OVLD_VEC_SUBC];
 
-	    tree call1 = altivec_resolve_new_overloaded_builtin (loc,
-								 as_c_builtin,
-								 params);
+	    tree call1 = altivec_resolve_overloaded_builtin (loc, as_c_builtin,
+							     params);
 	    params = make_tree_vector ();
 	    vec_safe_push (params, arg0);
 	    vec_safe_push (params, arg1);
@@ -1256,9 +1222,8 @@ altivec_resolve_new_overloaded_builtin (location_t loc, tree fndecl,
 	    else
 	      as_builtin = rs6000_builtin_decls_x[RS6000_OVLD_VEC_SUB];
 
-	    tree call2 = altivec_resolve_new_overloaded_builtin (loc,
-								 as_builtin,
-								 params);
+	    tree call2 = altivec_resolve_overloaded_builtin (loc, as_builtin,
+							     params);
 	    tree const1 = build_int_cstu (TREE_TYPE (arg0_type), 1);
 	    tree ones_vector = build_vector_from_val (arg0_type, const1);
 	    tree and_expr = fold_build2_loc (loc, BIT_AND_EXPR, arg0_type,
@@ -1266,14 +1231,14 @@ altivec_resolve_new_overloaded_builtin (location_t loc, tree fndecl,
 	    params = make_tree_vector ();
 	    vec_safe_push (params, call2);
 	    vec_safe_push (params, and_expr);
-	    call2 = altivec_resolve_new_overloaded_builtin (loc, as_c_builtin,
-							    params);
+	    call2 = altivec_resolve_overloaded_builtin (loc, as_c_builtin,
+							params);
 	    params = make_tree_vector ();
 	    vec_safe_push (params, call1);
 	    vec_safe_push (params, call2);
 	    tree or_builtin = rs6000_builtin_decls_x[RS6000_OVLD_VEC_OR];
-	    return altivec_resolve_new_overloaded_builtin (loc, or_builtin,
-							   params);
+	    return altivec_resolve_overloaded_builtin (loc, or_builtin,
+						       params);
 	    }
 	  /* For {un}signed __int128s use the vaddecuq/vsubbecuq
 	     instructions.  This occurs through normal processing.  */
@@ -1779,17 +1744,17 @@ altivec_resolve_new_overloaded_builtin (location_t loc, tree fndecl,
 	tree parmtype0 = TREE_VALUE (TYPE_ARG_TYPES (fntype));
 	tree parmtype1 = TREE_VALUE (TREE_CHAIN (TYPE_ARG_TYPES (fntype)));
 
-	if (rs6000_new_builtin_type_compatible (types[0], parmtype0)
-	    && rs6000_new_builtin_type_compatible (types[1], parmtype1))
+	if (rs6000_builtin_type_compatible (types[0], parmtype0)
+	    && rs6000_builtin_type_compatible (types[1], parmtype1))
 	  {
 	    if (rs6000_builtin_decl (instance->bifid, false) != error_mark_node
-		&& rs6000_new_builtin_is_supported (instance->bifid))
+		&& rs6000_builtin_is_supported (instance->bifid))
 	      {
 		tree ret_type = TREE_TYPE (instance->fntype);
-		return altivec_build_new_resolved_builtin (args, n, fntype,
-							   ret_type,
-							   instance->bifid,
-							   fcode);
+		return altivec_build_resolved_builtin (args, n, fntype,
+						       ret_type,
+						       instance->bifid,
+						       fcode);
 	      }
 	    else
 	      unsupported_builtin = true;
@@ -1837,17 +1802,17 @@ altivec_resolve_new_overloaded_builtin (location_t loc, tree fndecl,
 	tree parmtype0 = TREE_VALUE (TYPE_ARG_TYPES (fntype));
 	tree parmtype1 = TREE_VALUE (TREE_CHAIN (TYPE_ARG_TYPES (fntype)));
 
-	if (rs6000_new_builtin_type_compatible (types[0], parmtype0)
-	    && rs6000_new_builtin_type_compatible (types[1], parmtype1))
+	if (rs6000_builtin_type_compatible (types[0], parmtype0)
+	    && rs6000_builtin_type_compatible (types[1], parmtype1))
 	  {
 	    if (rs6000_builtin_decl (instance->bifid, false) != error_mark_node
-		&& rs6000_new_builtin_is_supported (instance->bifid))
+		&& rs6000_builtin_is_supported (instance->bifid))
 	      {
 		tree ret_type = TREE_TYPE (instance->fntype);
-		return altivec_build_new_resolved_builtin (args, n, fntype,
-							   ret_type,
-							   instance->bifid,
-							   fcode);
+		return altivec_build_resolved_builtin (args, n, fntype,
+						       ret_type,
+						       instance->bifid,
+						       fcode);
 	      }
 	    else
 	      unsupported_builtin = true;
@@ -1869,8 +1834,7 @@ altivec_resolve_new_overloaded_builtin (location_t loc, tree fndecl,
 		 arg_i++)
 	      {
 		tree parmtype = TREE_VALUE (nextparm);
-		if (!rs6000_new_builtin_type_compatible (types[arg_i],
-							 parmtype))
+		if (!rs6000_builtin_type_compatible (types[arg_i], parmtype))
 		  {
 		    mismatch = true;
 		    break;
@@ -1881,16 +1845,16 @@ altivec_resolve_new_overloaded_builtin (location_t loc, tree fndecl,
 	    if (mismatch)
 	      continue;
 
-	    supported = rs6000_new_builtin_is_supported (instance->bifid);
+	    supported = rs6000_builtin_is_supported (instance->bifid);
 	    if (rs6000_builtin_decl (instance->bifid, false) != error_mark_node
 		&& supported)
 	      {
 		tree fntype = rs6000_builtin_info_x[instance->bifid].fntype;
 		tree ret_type = TREE_TYPE (instance->fntype);
-		return altivec_build_new_resolved_builtin (args, n, fntype,
-							   ret_type,
-							   instance->bifid,
-							   fcode);
+		return altivec_build_resolved_builtin (args, n, fntype,
+						       ret_type,
+						       instance->bifid,
+						       fcode);
 	      }
 	    else
 	      {
@@ -1908,7 +1872,7 @@ altivec_resolve_new_overloaded_builtin (location_t loc, tree fndecl,
 	    /* Indicate that the instantiation of the overloaded builtin
 	       name is not available with the target flags in effect.  */
 	    rs6000_gen_builtins fcode = (rs6000_gen_builtins) instance->bifid;
-	    rs6000_invalid_new_builtin (fcode);
+	    rs6000_invalid_builtin (fcode);
 	    /* Provide clarity of the relationship between the overload
 	       and the instantiation.  */
 	    const char *internal_name
diff --git a/gcc/config/rs6000/rs6000-call.c b/gcc/config/rs6000/rs6000-call.c
index 619f936668e..bc035d69731 100644
--- a/gcc/config/rs6000/rs6000-call.c
+++ b/gcc/config/rs6000/rs6000-call.c
@@ -167,9 +167,6 @@ static const struct
   { "arch_3_1",		PPC_FEATURE2_ARCH_3_1,		1 },
   { "mma",		PPC_FEATURE2_MMA,		1 },
 };
-
-static rtx rs6000_expand_new_builtin (tree, rtx, rtx, machine_mode, int);
-static bool rs6000_gimple_fold_new_builtin (gimple_stmt_iterator *gsi);
 \f
 /* Nonzero if we can use a floating-point register to pass this arg.  */
 #define USE_FP_FOR_ARG_P(CUM,MODE)		\
@@ -3258,7 +3255,7 @@ altivec_expand_vec_ext_builtin (tree exp, rtx target)
    appropriate target options being set.  */
 
 void
-rs6000_invalid_new_builtin (enum rs6000_gen_builtins fncode)
+rs6000_invalid_builtin (enum rs6000_gen_builtins fncode)
 {
   size_t j = (size_t) fncode;
   const char *name = rs6000_builtin_info_x[j].bifname;
@@ -3479,20 +3476,11 @@ fold_mergeeo_helper (gimple_stmt_iterator *gsi, gimple *stmt, int use_odd)
   gsi_replace (gsi, g, true);
 }
 
-/* Fold a machine-dependent built-in in GIMPLE.  (For folding into
-   a constant, use rs6000_fold_builtin.)  */
-
-bool
-rs6000_gimple_fold_builtin (gimple_stmt_iterator *gsi)
-{
-  return rs6000_gimple_fold_new_builtin (gsi);
-}
-
 /*  Helper function to sort out which built-ins may be valid without having
     a LHS.  */
 static bool
-rs6000_new_builtin_valid_without_lhs (enum rs6000_gen_builtins fn_code,
-				      tree fndecl)
+rs6000_builtin_valid_without_lhs (enum rs6000_gen_builtins fn_code,
+				  tree fndecl)
 {
   if (TREE_TYPE (TREE_TYPE (fndecl)) == void_type_node)
     return true;
@@ -3520,7 +3508,7 @@ rs6000_new_builtin_valid_without_lhs (enum rs6000_gen_builtins fn_code,
 /* Check whether a builtin function is supported in this target
    configuration.  */
 bool
-rs6000_new_builtin_is_supported (enum rs6000_gen_builtins fncode)
+rs6000_builtin_is_supported (enum rs6000_gen_builtins fncode)
 {
   switch (rs6000_builtin_info_x[(size_t) fncode].enable)
     {
@@ -3576,8 +3564,8 @@ rs6000_new_builtin_is_supported (enum rs6000_gen_builtins fncode)
    __vector_quad arguments into pass-by-value arguments, leading to more
    efficient code generation.  */
 static bool
-rs6000_gimple_fold_new_mma_builtin (gimple_stmt_iterator *gsi,
-				    rs6000_gen_builtins fn_code)
+rs6000_gimple_fold_mma_builtin (gimple_stmt_iterator *gsi,
+				rs6000_gen_builtins fn_code)
 {
   gimple *stmt = gsi_stmt (*gsi);
   size_t fncode = (size_t) fn_code;
@@ -3776,8 +3764,8 @@ rs6000_gimple_fold_new_mma_builtin (gimple_stmt_iterator *gsi,
 
 /* Fold a machine-dependent built-in in GIMPLE.  (For folding into
    a constant, use rs6000_fold_builtin.)  */
-static bool
-rs6000_gimple_fold_new_builtin (gimple_stmt_iterator *gsi)
+bool
+rs6000_gimple_fold_builtin (gimple_stmt_iterator *gsi)
 {
   gimple *stmt = gsi_stmt (*gsi);
   tree fndecl = gimple_call_fndecl (stmt);
@@ -3796,23 +3784,23 @@ rs6000_gimple_fold_new_builtin (gimple_stmt_iterator *gsi)
 			  : "nothing";
 
   if (TARGET_DEBUG_BUILTIN)
-      fprintf (stderr, "rs6000_gimple_fold_new_builtin %d %s %s\n",
+      fprintf (stderr, "rs6000_gimple_fold_builtin %d %s %s\n",
 	       fn_code, fn_name1, fn_name2);
 
   if (!rs6000_fold_gimple)
     return false;
 
   /* Prevent gimple folding for code that does not have a LHS, unless it is
-     allowed per the rs6000_new_builtin_valid_without_lhs helper function.  */
+     allowed per the rs6000_builtin_valid_without_lhs helper function.  */
   if (!gimple_call_lhs (stmt)
-      && !rs6000_new_builtin_valid_without_lhs (fn_code, fndecl))
+      && !rs6000_builtin_valid_without_lhs (fn_code, fndecl))
     return false;
 
   /* Don't fold invalid builtins, let rs6000_expand_builtin diagnose it.  */
-  if (!rs6000_new_builtin_is_supported (fn_code))
+  if (!rs6000_builtin_is_supported (fn_code))
     return false;
 
-  if (rs6000_gimple_fold_new_mma_builtin (gsi, fn_code))
+  if (rs6000_gimple_fold_mma_builtin (gsi, fn_code))
     return true;
 
   switch (fn_code)
@@ -4755,20 +4743,6 @@ rs6000_gimple_fold_new_builtin (gimple_stmt_iterator *gsi)
   return false;
 }
 
-/* Expand an expression EXP that calls a built-in function,
-   with result going to TARGET if that's convenient
-   (and in mode MODE if that's convenient).
-   SUBTARGET may be used as the target for computing one of EXP's operands.
-   IGNORE is nonzero if the value is to be ignored.  */
-
-rtx
-rs6000_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
-		       machine_mode mode ATTRIBUTE_UNUSED,
-		       int ignore ATTRIBUTE_UNUSED)
-{
-  return rs6000_expand_new_builtin (exp, target, subtarget, mode, ignore);
-}
-
 /* Expand ALTIVEC_BUILTIN_MASK_FOR_LOAD.  */
 rtx
 rs6000_expand_ldst_mask (rtx target, tree arg0)
@@ -4803,8 +4777,8 @@ rs6000_expand_ldst_mask (rtx target, tree arg0)
 
 /* Expand the CPU builtin in FCODE and store the result in TARGET.  */
 static rtx
-new_cpu_expand_builtin (enum rs6000_gen_builtins fcode,
-			tree exp ATTRIBUTE_UNUSED, rtx target)
+cpu_expand_builtin (enum rs6000_gen_builtins fcode,
+		    tree exp ATTRIBUTE_UNUSED, rtx target)
 {
   /* __builtin_cpu_init () is a nop, so expand to nothing.  */
   if (fcode == RS6000_BIF_CPU_INIT)
@@ -5206,8 +5180,8 @@ stv_expand_builtin (insn_code icode, rtx *op,
 
 /* Expand the MMA built-in in EXP, and return it.  */
 static rtx
-new_mma_expand_builtin (tree exp, rtx target, insn_code icode,
-			rs6000_gen_builtins fcode)
+mma_expand_builtin (tree exp, rtx target, insn_code icode,
+		    rs6000_gen_builtins fcode)
 {
   tree fndecl = TREE_OPERAND (CALL_EXPR_FN (exp), 0);
   bool void_func = TREE_TYPE (TREE_TYPE (fndecl)) == void_type_node;
@@ -5319,7 +5293,7 @@ new_mma_expand_builtin (tree exp, rtx target, insn_code icode,
 
 /* Return the appropriate SPR number associated with the given builtin.  */
 static inline HOST_WIDE_INT
-new_htm_spr_num (enum rs6000_gen_builtins code)
+htm_spr_num (enum rs6000_gen_builtins code)
 {
   if (code == RS6000_BIF_GET_TFHAR
       || code == RS6000_BIF_SET_TFHAR)
@@ -5338,8 +5312,8 @@ new_htm_spr_num (enum rs6000_gen_builtins code)
 /* Expand the HTM builtin in EXP and store the result in TARGET.
    Return the expanded rtx.  */
 static rtx
-new_htm_expand_builtin (bifdata *bifaddr, rs6000_gen_builtins fcode,
-			tree exp, rtx target)
+htm_expand_builtin (bifdata *bifaddr, rs6000_gen_builtins fcode,
+		    tree exp, rtx target)
 {
   if (!TARGET_POWERPC64
       && (fcode == RS6000_BIF_TABORTDC
@@ -5425,7 +5399,7 @@ new_htm_expand_builtin (bifdata *bifaddr, rs6000_gen_builtins fcode,
   if (uses_spr)
     {
       machine_mode mode = TARGET_POWERPC64 ? DImode : SImode;
-      op[nopnds++] = gen_rtx_CONST_INT (mode, new_htm_spr_num (fcode));
+      op[nopnds++] = gen_rtx_CONST_INT (mode, htm_spr_num (fcode));
     }
   /* If this builtin accesses a CR field, then pass in a scratch
      CR field as the last operand.  */
@@ -5497,11 +5471,9 @@ new_htm_expand_builtin (bifdata *bifaddr, rs6000_gen_builtins fcode,
    SUBTARGET may be used as the target for computing one of EXP's operands.
    IGNORE is nonzero if the value is to be ignored.
    Use the new builtin infrastructure.  */
-static rtx
-rs6000_expand_new_builtin (tree exp, rtx target,
-			   rtx /* subtarget */,
-			   machine_mode /* mode */,
-			   int ignore)
+rtx
+rs6000_expand_builtin (tree exp, rtx target, rtx /* subtarget */,
+		       machine_mode /* mode */, int ignore)
 {
   tree fndecl = TREE_OPERAND (CALL_EXPR_FN (exp), 0);
   enum rs6000_gen_builtins fcode
@@ -5610,7 +5582,7 @@ rs6000_expand_new_builtin (tree exp, rtx target,
 	|| (e == ENB_P10_64 && TARGET_POWER10 && TARGET_POWERPC64)
 	|| (e == ENB_MMA && TARGET_MMA)))
     {
-      rs6000_invalid_new_builtin (fcode);
+      rs6000_invalid_builtin (fcode);
       return expand_call (exp, target, ignore);
     }
 
@@ -5629,7 +5601,7 @@ rs6000_expand_new_builtin (tree exp, rtx target,
     }
 
   if (bif_is_cpu (*bifaddr))
-    return new_cpu_expand_builtin (fcode, exp, target);
+    return cpu_expand_builtin (fcode, exp, target);
 
   if (bif_is_init (*bifaddr))
     return altivec_expand_vec_init_builtin (TREE_TYPE (exp), exp, target);
@@ -5644,7 +5616,7 @@ rs6000_expand_new_builtin (tree exp, rtx target,
     return altivec_expand_predicate_builtin (icode, exp, target);
 
   if (bif_is_htm (*bifaddr))
-    return new_htm_expand_builtin (bifaddr, fcode, exp, target);
+    return htm_expand_builtin (bifaddr, fcode, exp, target);
 
   if (bif_is_32bit (*bifaddr) && TARGET_32BIT)
     {
@@ -5830,7 +5802,7 @@ rs6000_expand_new_builtin (tree exp, rtx target,
     return lxvrze_expand_builtin (target, icode, op, mode[0], mode[1]);
 
   if (bif_is_mma (*bifaddr))
-    return new_mma_expand_builtin (exp, target, icode, fcode);
+    return mma_expand_builtin (exp, target, icode, fcode);
 
   if (fcode == RS6000_BIF_PACK_IF
       && TARGET_LONG_DOUBLE_128
@@ -6355,8 +6327,8 @@ rs6000_init_builtins (void)
   return;
 }
 
-static tree
-rs6000_new_builtin_decl (unsigned code, bool /* initialize_p */)
+tree
+rs6000_builtin_decl (unsigned code, bool /* initialize_p */)
 {
   rs6000_gen_builtins fcode = (rs6000_gen_builtins) code;
 
@@ -6366,17 +6338,6 @@ rs6000_new_builtin_decl (unsigned code, bool /* initialize_p */)
   return rs6000_builtin_decls_x[code];
 }
 
-/* Returns the rs6000 builtin decl for CODE.  Note that we don't check
-   the builtin mask here since there could be some #pragma/attribute
-   target functions and the rs6000_builtin_mask could be wrong when
-   this checking happens, though it will be updated properly later.  */
-
-tree
-rs6000_builtin_decl (unsigned code, bool initialize_p ATTRIBUTE_UNUSED)
-{
-  return rs6000_new_builtin_decl (code, initialize_p);
-}
-
 /* Return the internal arg pointer used for function incoming
    arguments.  When -fsplit-stack, the arg pointer is r12 so we need
    to copy it to a pseudo in order for it to be preserved over calls
diff --git a/gcc/config/rs6000/rs6000-gen-builtins.c b/gcc/config/rs6000/rs6000-gen-builtins.c
index 9c61b7d9fe6..114289a0034 100644
--- a/gcc/config/rs6000/rs6000-gen-builtins.c
+++ b/gcc/config/rs6000/rs6000-gen-builtins.c
@@ -2375,8 +2375,7 @@ write_decls (void)
 
   fprintf (header_file, "extern void rs6000_init_generated_builtins ();\n\n");
   fprintf (header_file,
-	   "extern bool rs6000_new_builtin_is_supported "
-	   "(rs6000_gen_builtins);\n");
+	   "extern bool rs6000_builtin_is_supported (rs6000_gen_builtins);\n");
   fprintf (header_file,
 	   "extern tree rs6000_builtin_decl (unsigned, "
 	   "bool ATTRIBUTE_UNUSED);\n\n");
diff --git a/gcc/config/rs6000/rs6000-internal.h b/gcc/config/rs6000/rs6000-internal.h
index a880fd37618..49904b3f33d 100644
--- a/gcc/config/rs6000/rs6000-internal.h
+++ b/gcc/config/rs6000/rs6000-internal.h
@@ -142,7 +142,7 @@ extern void rs6000_output_mi_thunk (FILE *file,
 extern bool rs6000_output_addr_const_extra (FILE *file, rtx x);
 extern bool rs6000_gimple_fold_builtin (gimple_stmt_iterator *gsi);
 extern tree rs6000_build_builtin_va_list (void);
-extern void rs6000_invalid_new_builtin (rs6000_gen_builtins fncode);
+extern void rs6000_invalid_builtin (rs6000_gen_builtins fncode);
 extern void rs6000_va_start (tree valist, rtx nextarg);
 extern tree rs6000_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p,
 				    gimple_seq *post_p);
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index f5116289a7f..bc17c53760d 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -5568,14 +5568,14 @@ rs6000_loop_unroll_adjust (unsigned nunroll, struct loop *loop)
    Implement targetm.vectorize.builtin_vectorized_function.  */
 
 static tree
-rs6000_new_builtin_vectorized_function (unsigned int fn, tree type_out,
-					tree type_in)
+rs6000_builtin_vectorized_function (unsigned int fn, tree type_out,
+				    tree type_in)
 {
   machine_mode in_mode, out_mode;
   int in_n, out_n;
 
   if (TARGET_DEBUG_BUILTIN)
-    fprintf (stderr, "rs6000_new_builtin_vectorized_function (%s, %s, %s)\n",
+    fprintf (stderr, "rs6000_builtin_vectorized_function (%s, %s, %s)\n",
 	     combined_fn_name (combined_fn (fn)),
 	     GET_MODE_NAME (TYPE_MODE (type_out)),
 	     GET_MODE_NAME (TYPE_MODE (type_in)));
@@ -5700,15 +5700,15 @@ rs6000_new_builtin_vectorized_function (unsigned int fn, tree type_out,
 /* Implement targetm.vectorize.builtin_md_vectorized_function.  */
 
 static tree
-rs6000_new_builtin_md_vectorized_function (tree fndecl, tree type_out,
-					   tree type_in)
+rs6000_builtin_md_vectorized_function (tree fndecl, tree type_out,
+				       tree type_in)
 {
   machine_mode in_mode, out_mode;
   int in_n, out_n;
 
   if (TARGET_DEBUG_BUILTIN)
     fprintf (stderr,
-	     "rs6000_new_builtin_md_vectorized_function (%s, %s, %s)\n",
+	     "rs6000_builtin_md_vectorized_function (%s, %s, %s)\n",
 	     IDENTIFIER_POINTER (DECL_NAME (fndecl)),
 	     GET_MODE_NAME (TYPE_MODE (type_out)),
 	     GET_MODE_NAME (TYPE_MODE (type_in)));
@@ -5918,25 +5918,6 @@ rs6000_builtin_vectorized_libmass (combined_fn fn, tree type_out,
   return new_fndecl;
 }
 
-/* Returns a function decl for a vectorized version of the builtin function
-   with builtin function code FN and the result vector type TYPE, or NULL_TREE
-   if it is not available.  */
-
-static tree
-rs6000_builtin_vectorized_function (unsigned int fn, tree type_out,
-				    tree type_in)
-{
-  return rs6000_new_builtin_vectorized_function (fn, type_out, type_in);
-}
-
-/* Implement TARGET_VECTORIZE_BUILTIN_MD_VECTORIZED_FUNCTION.  */
-
-static tree
-rs6000_builtin_md_vectorized_function (tree fndecl, tree type_out,
-				       tree type_in)
-{
-  return rs6000_new_builtin_md_vectorized_function (fndecl, type_out, type_in);
-}
 \f
 /* Default CPU string for rs6000*_file_start functions.  */
 static const char *rs6000_default_cpu;
-- 
2.27.0


  parent reply	other threads:[~2021-12-03 18:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-03 18:22 [PATCH 0/6] rs6000: Remove "old" built-in function infrastructure Bill Schmidt
2021-12-03 18:22 ` [PATCH 2/6] rs6000: Remove altivec_overloaded_builtins array and initialization Bill Schmidt
2021-12-03 18:22 ` [PATCH 3/6] rs6000: Rename rs6000-builtin-new.def to rs6000-builtins.def Bill Schmidt
2021-12-03 18:22 ` [PATCH 4/6] rs6000: Remove rs6000-builtin.def and associated data and functions Bill Schmidt
2021-12-03 18:22 ` Bill Schmidt [this message]
2021-12-03 18:22 ` [PATCH 6/6] rs6000: Rename arrays to remove temporary _x suffix Bill Schmidt
2021-12-06 16:39 ` [PATCH 0/6] rs6000: Remove "old" built-in function infrastructure Bill Schmidt
2021-12-06 20:49 [PATCH v2 0/6] " Bill Schmidt
2021-12-06 20:49 ` [PATCH 5/6] rs6000: Rename functions with "new" in their names Bill Schmidt
2021-12-14 18:08   ` David Edelsohn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=28d8a61cff8e73deffe4c4c0a7d75bfe42959783.1638554381.git.wschmidt@linux.ibm.com \
    --to=wschmidt@linux.vnet.ibm.com \
    --cc=dje@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=segher@kernel.crashing.org \
    --cc=wschmidt@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).