From patchwork Mon Dec 6 20:49:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Schmidt X-Patchwork-Id: 1564227 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=KUKxq6mW; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4J7G1W2SfWz9s3q for ; Tue, 7 Dec 2021 07:56:15 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 08B073858432 for ; Mon, 6 Dec 2021 20:56:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 08B073858432 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1638824173; bh=H+jeNK3k5n5v38iykcrF5T6alIo5MyJTwSQTFxG04ZQ=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=KUKxq6mWVdL5woj1EZ82fFvWu8/93ePsHXDQ0HlSk1Tet+w6UTTC0lxKD+nHvlPE1 QhCeY92WGVdqILSB4MlsS1z1MlkPs55Nj4Tw7mUDLtaQkUuBLCyOHrpv8k0si2oPZb 7YfjpJebSVzLYZT34edNOYSvX4Qc3eFeAUiLo8EQ= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 40CA83858437 for ; Mon, 6 Dec 2021 20:49:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 40CA83858437 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1B6JHiUu000953; Mon, 6 Dec 2021 20:49:50 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3csrj41kac-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 Dec 2021 20:49:49 +0000 Received: from m0098410.ppops.net (m0098410.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 1B6KA82V011085; Mon, 6 Dec 2021 20:49:49 GMT Received: from ppma03wdc.us.ibm.com (ba.79.3fa9.ip4.static.sl-reverse.com [169.63.121.186]) by mx0a-001b2d01.pphosted.com with ESMTP id 3csrj41ka4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 Dec 2021 20:49:49 +0000 Received: from pps.filterd (ppma03wdc.us.ibm.com [127.0.0.1]) by ppma03wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 1B6KSIK0023355; Mon, 6 Dec 2021 20:49:48 GMT Received: from b03cxnp07029.gho.boulder.ibm.com (b03cxnp07029.gho.boulder.ibm.com [9.17.130.16]) by ppma03wdc.us.ibm.com with ESMTP id 3cqyy75xx0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 Dec 2021 20:49:48 +0000 Received: from b03ledav001.gho.boulder.ibm.com (b03ledav001.gho.boulder.ibm.com [9.17.130.232]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1B6Knl4a60359112 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 6 Dec 2021 20:49:47 GMT Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3D0746E056; Mon, 6 Dec 2021 20:49:47 +0000 (GMT) Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EAF956E05F; Mon, 6 Dec 2021 20:49:46 +0000 (GMT) Received: from localhost.localdomain (unknown [9.211.53.129]) by b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTP; Mon, 6 Dec 2021 20:49:46 +0000 (GMT) To: gcc-patches@gcc.gnu.org Subject: [PATCH 5/6] rs6000: Rename functions with "new" in their names Date: Mon, 6 Dec 2021 14:49:07 -0600 Message-Id: <26cd500407b755e6c04b6ab045ad65e5dcebcd69.1638820430.git.wschmidt@linux.ibm.com> X-Mailer: git-send-email 2.21.1 (Apple Git-122.3) In-Reply-To: References: MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: bj6zbEdI_dEJ1NO4Wo3GzcEvxpBiRVOc X-Proofpoint-ORIG-GUID: amXysz9mwaRGlko4EScizFSEv5kK5qRI X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2021-12-06_07,2021-12-06_02,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 impostorscore=0 spamscore=0 adultscore=0 malwarescore=0 suspectscore=0 phishscore=0 mlxlogscore=999 mlxscore=0 lowpriorityscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112060126 X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Bill Schmidt via Gcc-patches From: Bill Schmidt Reply-To: Bill Schmidt Cc: dje.gcc@gmail.com, segher@kernel.crashing.org Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" 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 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 *arglist = static_cast *> (passed_arglist); unsigned int nargs = vec_safe_length (arglist); @@ -1096,7 +1065,7 @@ altivec_resolve_new_overloaded_builtin (location_t loc, tree fndecl, vec *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 a5ee06c991f..5ce0d2cef88 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); /* 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 @@ -6379,8 +6351,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; @@ -6390,17 +6362,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 4479c569476..38e22f927c5 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); -} /* Default CPU string for rs6000*_file_start functions. */ static const char *rs6000_default_cpu;