From patchwork Mon Dec 6 20:49:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Schmidt X-Patchwork-Id: 48561 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0C37C3858423 for ; Mon, 6 Dec 2021 20:57:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0C37C3858423 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1638824224; bh=1dQZtBxKrc9Dsga3Gx3P0R7xVt7Zzww3+QIVXbjpulQ=; 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=CQbIRJM2xHpdlFsoPPsdB/O2iePxaqHlKAbSFDwCYTSJsO4nm4cOxoumr7Ef1U2UY aQobGbLZ6wYqtmQgawAkMlkesTe8Ai1d+i2LUYUJhjv0sEzPBRsmbXvjTsfguzKFs0 n79a+f3fkkQlcjwOQM3UL5jdG/TBnAUG9oKs5too= 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 60967385843A for ; Mon, 6 Dec 2021 20:49:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 60967385843A Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1B6KLoEt007774; Mon, 6 Dec 2021 20:49:58 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3cssg48fpf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 Dec 2021 20:49:58 +0000 Received: from m0098396.ppops.net (m0098396.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 1B6KiU2p000685; Mon, 6 Dec 2021 20:49:57 GMT Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0a-001b2d01.pphosted.com with ESMTP id 3cssg48fp6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 Dec 2021 20:49:57 +0000 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 1B6KR6UI002243; Mon, 6 Dec 2021 20:49:57 GMT Received: from b03cxnp08027.gho.boulder.ibm.com (b03cxnp08027.gho.boulder.ibm.com [9.17.130.19]) by ppma02dal.us.ibm.com with ESMTP id 3cqyya71wu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 Dec 2021 20:49:56 +0000 Received: from b03ledav001.gho.boulder.ibm.com (b03ledav001.gho.boulder.ibm.com [9.17.130.232]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1B6Kntjm26673562 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 6 Dec 2021 20:49:55 GMT Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B5AEC6E056; Mon, 6 Dec 2021 20:49:55 +0000 (GMT) Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5E0E06E04E; Mon, 6 Dec 2021 20:49:55 +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:55 +0000 (GMT) To: gcc-patches@gcc.gnu.org Subject: [PATCH 6/6] rs6000: Rename arrays to remove temporary _x suffix Date: Mon, 6 Dec 2021 14:49:08 -0600 Message-Id: <07153ce6ec5fc7bc745ecae21bdbb2d1ef161bca.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-ORIG-GUID: s_roaclZXwt4AcuXqv73BQ3Jvtn_V8R- X-Proofpoint-GUID: lJiCuVhFQRyELS36vz-i3HIdKlRoDQkJ 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 impostorscore=0 mlxlogscore=999 phishscore=0 clxscore=1015 lowpriorityscore=0 adultscore=0 malwarescore=0 priorityscore=1501 suspectscore=0 spamscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112060126 X-Spam-Status: No, score=-12.3 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+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Hi! While we had two sets of built-in infrastructure at once, I added _x as a suffix to two arrays to disambiguate the old and new versions. Time to fix that also. Bootstrapped and tested on powerpc64le-linux-gnu with no regressions. Is this okay for trunk? Thanks! Bill 2021-12-06 Bill Schmidt gcc/ * config/rs6000/rs6000-c.c (altivec_build_resolved_builtin): Rename rs6000_builtin_decls_x to rs6000_builtin_decls. (altivec_resolve_overloaded_builtin): Likewise. Also rename rs6000_builtin_info_x to rs6000_builtin_info. * config/rs6000/rs6000-call.c (rs6000_invalid_builtin): Rename rs6000_builtin_info_x to rs6000_builtin_info. (rs6000_builtin_is_supported): Likewise. (rs6000_gimple_fold_mma_builtin): Likewise. Also rename rs6000_builtin_decls_x to rs6000_builtin_decls. (rs6000_gimple_fold_builtin): Rename rs6000_builtin_info_x to rs6000_builtin_info. (cpu_expand_builtin): Likewise. (rs6000_expand_builtin): Likewise. (rs6000_init_builtins): Likewise. Also rename rs6000_builtin_decls_x to rs6000_builtin_decls. (rs6000_builtin_decl): Rename rs6000_builtin_decls_x to rs6000_builtin_decls. * config/rs6000/rs6000-gen-builtins.c (write_decls): In generated code, rename rs6000_builtin_decls_x to rs6000_builtin_decls, and rename rs6000_builtin_info_x to rs6000_builtin_info. (write_bif_static_init): In generated code, rename rs6000_builtin_info_x to rs6000_builtin_info. (write_init_bif_table): In generated code, rename rs6000_builtin_decls_x to rs6000_builtin_decls, and rename rs6000_builtin_info_x to rs6000_builtin_info. (write_init_ovld_table): In generated code, rename rs6000_builtin_decls_x to rs6000_builtin_decls. (write_init_file): Likewise. * config/rs6000/rs6000.c (rs6000_builtin_vectorized_function): Likewise. (rs6000_builtin_md_vectorized_function): Likewise. (rs6000_builtin_reciprocal): Likewise. (add_condition_to_bb): Likewise. (rs6000_atomic_assign_expand_fenv): Likewise. --- gcc/config/rs6000/rs6000-c.c | 64 ++++++++++++------------- gcc/config/rs6000/rs6000-call.c | 46 +++++++++--------- gcc/config/rs6000/rs6000-gen-builtins.c | 27 +++++------ gcc/config/rs6000/rs6000.c | 58 +++++++++++----------- 4 files changed, 96 insertions(+), 99 deletions(-) diff --git a/gcc/config/rs6000/rs6000-c.c b/gcc/config/rs6000/rs6000-c.c index f790c72d621..e0ebdeed548 100644 --- a/gcc/config/rs6000/rs6000-c.c +++ b/gcc/config/rs6000/rs6000-c.c @@ -867,7 +867,7 @@ altivec_build_resolved_builtin (tree *args, int n, tree fntype, tree ret_type, { tree argtypes = TYPE_ARG_TYPES (fntype); tree arg_type[MAX_OVLD_ARGS]; - tree fndecl = rs6000_builtin_decls_x[bif_id]; + tree fndecl = rs6000_builtin_decls[bif_id]; for (int i = 0; i < n; i++) { @@ -1001,13 +1001,13 @@ altivec_resolve_overloaded_builtin (location_t loc, tree fndecl, case E_SFmode: { /* For floats use the xvmulsp instruction directly. */ - tree call = rs6000_builtin_decls_x[RS6000_BIF_XVMULSP]; + tree call = rs6000_builtin_decls[RS6000_BIF_XVMULSP]; return build_call_expr (call, 2, arg0, arg1); } case E_DFmode: { /* For doubles use the xvmuldp instruction directly. */ - tree call = rs6000_builtin_decls_x[RS6000_BIF_XVMULDP]; + tree call = rs6000_builtin_decls[RS6000_BIF_XVMULDP]; return build_call_expr (call, 2, arg0, arg1); } /* Other types are errors. */ @@ -1066,7 +1066,7 @@ altivec_resolve_overloaded_builtin (location_t loc, tree fndecl, vec_safe_push (params, arg0); vec_safe_push (params, arg1); tree call = altivec_resolve_overloaded_builtin - (loc, rs6000_builtin_decls_x[RS6000_OVLD_VEC_CMPEQ], + (loc, rs6000_builtin_decls[RS6000_OVLD_VEC_CMPEQ], params); /* Use save_expr to ensure that operands used more than once that may have side effects (like calls) are only evaluated @@ -1076,7 +1076,7 @@ altivec_resolve_overloaded_builtin (location_t loc, tree fndecl, vec_safe_push (params, call); vec_safe_push (params, call); return altivec_resolve_overloaded_builtin - (loc, rs6000_builtin_decls_x[RS6000_OVLD_VEC_NOR], params); + (loc, rs6000_builtin_decls[RS6000_OVLD_VEC_NOR], params); } /* Other types are errors. */ default: @@ -1129,9 +1129,9 @@ altivec_resolve_overloaded_builtin (location_t loc, tree fndecl, vec_safe_push (params, arg1); if (fcode == RS6000_OVLD_VEC_ADDE) - add_sub_builtin = rs6000_builtin_decls_x[RS6000_OVLD_VEC_ADD]; + add_sub_builtin = rs6000_builtin_decls[RS6000_OVLD_VEC_ADD]; else - add_sub_builtin = rs6000_builtin_decls_x[RS6000_OVLD_VEC_SUB]; + add_sub_builtin = rs6000_builtin_decls[RS6000_OVLD_VEC_SUB]; tree call = altivec_resolve_overloaded_builtin (loc, add_sub_builtin, @@ -1207,9 +1207,9 @@ altivec_resolve_overloaded_builtin (location_t loc, tree fndecl, vec_safe_push (params, arg1); if (fcode == RS6000_OVLD_VEC_ADDEC) - as_c_builtin = rs6000_builtin_decls_x[RS6000_OVLD_VEC_ADDC]; + as_c_builtin = rs6000_builtin_decls[RS6000_OVLD_VEC_ADDC]; else - as_c_builtin = rs6000_builtin_decls_x[RS6000_OVLD_VEC_SUBC]; + as_c_builtin = rs6000_builtin_decls[RS6000_OVLD_VEC_SUBC]; tree call1 = altivec_resolve_overloaded_builtin (loc, as_c_builtin, params); @@ -1218,9 +1218,9 @@ altivec_resolve_overloaded_builtin (location_t loc, tree fndecl, vec_safe_push (params, arg1); if (fcode == RS6000_OVLD_VEC_ADDEC) - as_builtin = rs6000_builtin_decls_x[RS6000_OVLD_VEC_ADD]; + as_builtin = rs6000_builtin_decls[RS6000_OVLD_VEC_ADD]; else - as_builtin = rs6000_builtin_decls_x[RS6000_OVLD_VEC_SUB]; + as_builtin = rs6000_builtin_decls[RS6000_OVLD_VEC_SUB]; tree call2 = altivec_resolve_overloaded_builtin (loc, as_builtin, params); @@ -1236,7 +1236,7 @@ altivec_resolve_overloaded_builtin (location_t loc, tree fndecl, 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]; + tree or_builtin = rs6000_builtin_decls[RS6000_OVLD_VEC_OR]; return altivec_resolve_overloaded_builtin (loc, or_builtin, params); } @@ -1380,34 +1380,34 @@ altivec_resolve_overloaded_builtin (location_t loc, tree fndecl, break; case E_V1TImode: - call = rs6000_builtin_decls_x[RS6000_BIF_VEC_EXT_V1TI]; + call = rs6000_builtin_decls[RS6000_BIF_VEC_EXT_V1TI]; break; case E_V2DFmode: - call = rs6000_builtin_decls_x[RS6000_BIF_VEC_EXT_V2DF]; + call = rs6000_builtin_decls[RS6000_BIF_VEC_EXT_V2DF]; break; case E_V2DImode: - call = rs6000_builtin_decls_x[RS6000_BIF_VEC_EXT_V2DI]; + call = rs6000_builtin_decls[RS6000_BIF_VEC_EXT_V2DI]; break; case E_V4SFmode: - call = rs6000_builtin_decls_x[RS6000_BIF_VEC_EXT_V4SF]; + call = rs6000_builtin_decls[RS6000_BIF_VEC_EXT_V4SF]; break; case E_V4SImode: if (TARGET_DIRECT_MOVE_64BIT) - call = rs6000_builtin_decls_x[RS6000_BIF_VEC_EXT_V4SI]; + call = rs6000_builtin_decls[RS6000_BIF_VEC_EXT_V4SI]; break; case E_V8HImode: if (TARGET_DIRECT_MOVE_64BIT) - call = rs6000_builtin_decls_x[RS6000_BIF_VEC_EXT_V8HI]; + call = rs6000_builtin_decls[RS6000_BIF_VEC_EXT_V8HI]; break; case E_V16QImode: if (TARGET_DIRECT_MOVE_64BIT) - call = rs6000_builtin_decls_x[RS6000_BIF_VEC_EXT_V16QI]; + call = rs6000_builtin_decls[RS6000_BIF_VEC_EXT_V16QI]; break; } } @@ -1422,27 +1422,27 @@ altivec_resolve_overloaded_builtin (location_t loc, tree fndecl, break; case E_V2DFmode: - call = rs6000_builtin_decls_x[RS6000_BIF_VEC_EXT_V2DF]; + call = rs6000_builtin_decls[RS6000_BIF_VEC_EXT_V2DF]; break; case E_V2DImode: - call = rs6000_builtin_decls_x[RS6000_BIF_VEC_EXT_V2DI]; + call = rs6000_builtin_decls[RS6000_BIF_VEC_EXT_V2DI]; break; case E_V4SFmode: - call = rs6000_builtin_decls_x[RS6000_BIF_VEC_EXT_V4SF]; + call = rs6000_builtin_decls[RS6000_BIF_VEC_EXT_V4SF]; break; case E_V4SImode: - call = rs6000_builtin_decls_x[RS6000_BIF_VEC_EXT_V4SI]; + call = rs6000_builtin_decls[RS6000_BIF_VEC_EXT_V4SI]; break; case E_V8HImode: - call = rs6000_builtin_decls_x[RS6000_BIF_VEC_EXT_V8HI]; + call = rs6000_builtin_decls[RS6000_BIF_VEC_EXT_V8HI]; break; case E_V16QImode: - call = rs6000_builtin_decls_x[RS6000_BIF_VEC_EXT_V16QI]; + call = rs6000_builtin_decls[RS6000_BIF_VEC_EXT_V16QI]; break; } } @@ -1542,9 +1542,9 @@ altivec_resolve_overloaded_builtin (location_t loc, tree fndecl, arg2 = wide_int_to_tree (TREE_TYPE (arg2), selector); if (mode == V2DFmode) - call = rs6000_builtin_decls_x[RS6000_BIF_VEC_SET_V2DF]; + call = rs6000_builtin_decls[RS6000_BIF_VEC_SET_V2DF]; else if (mode == V2DImode) - call = rs6000_builtin_decls_x[RS6000_BIF_VEC_SET_V2DI]; + call = rs6000_builtin_decls[RS6000_BIF_VEC_SET_V2DI]; /* Note, __builtin_vec_insert_ has vector and scalar types reversed. */ @@ -1554,7 +1554,7 @@ altivec_resolve_overloaded_builtin (location_t loc, tree fndecl, else if (mode == V1TImode && VECTOR_UNIT_VSX_P (mode) && TREE_CODE (arg2) == INTEGER_CST) { - tree call = rs6000_builtin_decls_x[RS6000_BIF_VEC_SET_V1TI]; + tree call = rs6000_builtin_decls[RS6000_BIF_VEC_SET_V1TI]; wide_int selector = wi::zero(32); arg2 = wide_int_to_tree (TREE_TYPE (arg2), selector); @@ -1740,7 +1740,7 @@ altivec_resolve_overloaded_builtin (location_t loc, tree fndecl, instance = instance->next; gcc_assert (instance != NULL); - tree fntype = rs6000_builtin_info_x[instance->bifid].fntype; + tree fntype = rs6000_builtin_info[instance->bifid].fntype; tree parmtype0 = TREE_VALUE (TYPE_ARG_TYPES (fntype)); tree parmtype1 = TREE_VALUE (TREE_CHAIN (TYPE_ARG_TYPES (fntype))); @@ -1798,7 +1798,7 @@ altivec_resolve_overloaded_builtin (location_t loc, tree fndecl, instance = instance->next; gcc_assert (instance != NULL); - tree fntype = rs6000_builtin_info_x[instance->bifid].fntype; + tree fntype = rs6000_builtin_info[instance->bifid].fntype; tree parmtype0 = TREE_VALUE (TYPE_ARG_TYPES (fntype)); tree parmtype1 = TREE_VALUE (TREE_CHAIN (TYPE_ARG_TYPES (fntype))); @@ -1849,7 +1849,7 @@ altivec_resolve_overloaded_builtin (location_t loc, tree fndecl, if (rs6000_builtin_decl (instance->bifid, false) != error_mark_node && supported) { - tree fntype = rs6000_builtin_info_x[instance->bifid].fntype; + tree fntype = rs6000_builtin_info[instance->bifid].fntype; tree ret_type = TREE_TYPE (instance->fntype); return altivec_build_resolved_builtin (args, n, fntype, ret_type, @@ -1876,7 +1876,7 @@ altivec_resolve_overloaded_builtin (location_t loc, tree fndecl, /* Provide clarity of the relationship between the overload and the instantiation. */ const char *internal_name - = rs6000_builtin_info_x[instance->bifid].bifname; + = rs6000_builtin_info[instance->bifid].bifname; rich_location richloc (line_table, input_location); inform (&richloc, "overloaded builtin %qs is implemented by builtin %qs", diff --git a/gcc/config/rs6000/rs6000-call.c b/gcc/config/rs6000/rs6000-call.c index 5ce0d2cef88..38f0ccc97db 100644 --- a/gcc/config/rs6000/rs6000-call.c +++ b/gcc/config/rs6000/rs6000-call.c @@ -3258,9 +3258,9 @@ void rs6000_invalid_builtin (enum rs6000_gen_builtins fncode) { size_t j = (size_t) fncode; - const char *name = rs6000_builtin_info_x[j].bifname; + const char *name = rs6000_builtin_info[j].bifname; - switch (rs6000_builtin_info_x[j].enable) + switch (rs6000_builtin_info[j].enable) { case ENB_P5: error ("%qs requires the %qs option", name, "-mcpu=power5"); @@ -3510,7 +3510,7 @@ rs6000_builtin_valid_without_lhs (enum rs6000_gen_builtins fn_code, bool rs6000_builtin_is_supported (enum rs6000_gen_builtins fncode) { - switch (rs6000_builtin_info_x[(size_t) fncode].enable) + switch (rs6000_builtin_info[(size_t) fncode].enable) { case ENB_ALWAYS: return true; @@ -3570,18 +3570,18 @@ rs6000_gimple_fold_mma_builtin (gimple_stmt_iterator *gsi, gimple *stmt = gsi_stmt (*gsi); size_t fncode = (size_t) fn_code; - if (!bif_is_mma (rs6000_builtin_info_x[fncode])) + if (!bif_is_mma (rs6000_builtin_info[fncode])) return false; /* Each call that can be gimple-expanded has an associated built-in function that it will expand into. If this one doesn't, we have already expanded it! Exceptions: lxvp and stxvp. */ - if (rs6000_builtin_info_x[fncode].assoc_bif == RS6000_BIF_NONE + if (rs6000_builtin_info[fncode].assoc_bif == RS6000_BIF_NONE && fncode != RS6000_BIF_LXVP && fncode != RS6000_BIF_STXVP) return false; - bifdata *bd = &rs6000_builtin_info_x[fncode]; + bifdata *bd = &rs6000_builtin_info[fncode]; unsigned nopnds = bd->nargs; gimple_seq new_seq = NULL; gimple *new_call; @@ -3626,7 +3626,7 @@ rs6000_gimple_fold_mma_builtin (gimple_stmt_iterator *gsi, to emit a xxmfacc instruction now, since we cannot do it later. */ if (fncode == RS6000_BIF_DISASSEMBLE_ACC) { - new_decl = rs6000_builtin_decls_x[RS6000_BIF_XXMFACC_INTERNAL]; + new_decl = rs6000_builtin_decls[RS6000_BIF_XXMFACC_INTERNAL]; new_call = gimple_build_call (new_decl, 1, src); src = create_tmp_reg_or_ssa_name (vector_quad_type_node); gimple_call_set_lhs (new_call, src); @@ -3635,7 +3635,7 @@ rs6000_gimple_fold_mma_builtin (gimple_stmt_iterator *gsi, /* Copy the accumulator/pair vector by vector. */ new_decl - = rs6000_builtin_decls_x[rs6000_builtin_info_x[fncode].assoc_bif]; + = rs6000_builtin_decls[rs6000_builtin_info[fncode].assoc_bif]; tree dst_type = build_pointer_type_for_mode (unsigned_V16QI_type_node, ptr_mode, true); tree dst_base = build1 (VIEW_CONVERT_EXPR, dst_type, dst_ptr); @@ -3693,7 +3693,7 @@ rs6000_gimple_fold_mma_builtin (gimple_stmt_iterator *gsi, /* Convert this built-in into an internal version that uses pass-by-value arguments. The internal built-in is found in the assoc_bif field. */ - new_decl = rs6000_builtin_decls_x[rs6000_builtin_info_x[fncode].assoc_bif]; + new_decl = rs6000_builtin_decls[rs6000_builtin_info[fncode].assoc_bif]; tree lhs, op[MAX_MMA_OPERANDS]; tree acc = gimple_call_arg (stmt, 0); push_gimplify_context (true); @@ -3777,8 +3777,8 @@ rs6000_gimple_fold_builtin (gimple_stmt_iterator *gsi) gimple *g; size_t uns_fncode = (size_t) fn_code; - enum insn_code icode = rs6000_builtin_info_x[uns_fncode].icode; - const char *fn_name1 = rs6000_builtin_info_x[uns_fncode].bifname; + enum insn_code icode = rs6000_builtin_info[uns_fncode].icode; + const char *fn_name1 = rs6000_builtin_info[uns_fncode].bifname; const char *fn_name2 = (icode != CODE_FOR_nothing) ? get_insn_name ((int) icode) : "nothing"; @@ -4801,7 +4801,7 @@ cpu_expand_builtin (enum rs6000_gen_builtins fcode, if (TREE_CODE (arg) != STRING_CST) { error ("builtin %qs only accepts a string argument", - rs6000_builtin_info_x[(size_t) fcode].bifname); + rs6000_builtin_info[(size_t) fcode].bifname); return const0_rtx; } @@ -4820,7 +4820,7 @@ cpu_expand_builtin (enum rs6000_gen_builtins fcode, { /* Invalid CPU argument. */ error ("cpu %qs is an invalid argument to builtin %qs", - cpu, rs6000_builtin_info_x[(size_t) fcode].bifname); + cpu, rs6000_builtin_info[(size_t) fcode].bifname); return const0_rtx; } @@ -4849,7 +4849,7 @@ cpu_expand_builtin (enum rs6000_gen_builtins fcode, /* Invalid HWCAP argument. */ error ("%s %qs is an invalid argument to builtin %qs", "hwcap", hwcap, - rs6000_builtin_info_x[(size_t) fcode].bifname); + rs6000_builtin_info[(size_t) fcode].bifname); return const0_rtx; } @@ -4877,7 +4877,7 @@ cpu_expand_builtin (enum rs6000_gen_builtins fcode, #else warning (0, "builtin %qs needs GLIBC (2.23 and newer) that exports hardware " - "capability bits", rs6000_builtin_info_x[(size_t) fcode].bifname); + "capability bits", rs6000_builtin_info[(size_t) fcode].bifname); /* For old LIBCs, always return FALSE. */ emit_move_insn (target, GEN_INT (0)); @@ -5479,7 +5479,7 @@ rs6000_expand_builtin (tree exp, rtx target, rtx /* subtarget */, enum rs6000_gen_builtins fcode = (enum rs6000_gen_builtins) DECL_MD_FUNCTION_CODE (fndecl); size_t uns_fcode = (size_t)fcode; - enum insn_code icode = rs6000_builtin_info_x[uns_fcode].icode; + enum insn_code icode = rs6000_builtin_info[uns_fcode].icode; /* TODO: The following commentary and code is inherited from the original builtin processing code. The commentary is a bit confusing, with the @@ -5557,7 +5557,7 @@ rs6000_expand_builtin (tree exp, rtx target, rtx /* subtarget */, /* In case of "#pragma target" changes, we initialize all builtins but check for actual availability now, during expand time. For invalid builtins, generate a normal call. */ - bifdata *bifaddr = &rs6000_builtin_info_x[uns_fcode]; + bifdata *bifaddr = &rs6000_builtin_info[uns_fcode]; bif_enable e = bifaddr->enable; if (!(e == ENB_ALWAYS @@ -6260,7 +6260,7 @@ rs6000_init_builtins (void) fprintf (stderr, "\nAutogenerated built-in functions:\n\n"); for (int i = 1; i < (int) RS6000_BIF_MAX; i++) { - bif_enable e = rs6000_builtin_info_x[i].enable; + bif_enable e = rs6000_builtin_info[i].enable; if (e == ENB_P5 && !TARGET_POPCNTB) continue; if (e == ENB_P6 && !TARGET_CMPB) @@ -6299,10 +6299,10 @@ rs6000_init_builtins (void) continue; if (e == ENB_MMA && !TARGET_MMA) continue; - tree fntype = rs6000_builtin_info_x[i].fntype; + tree fntype = rs6000_builtin_info[i].fntype; tree t = TREE_TYPE (fntype); fprintf (stderr, "%s %s (", rs6000_type_string (t), - rs6000_builtin_info_x[i].bifname); + rs6000_builtin_info[i].bifname); t = TYPE_ARG_TYPES (fntype); while (t && TREE_VALUE (t) != void_type_node) { @@ -6313,7 +6313,7 @@ rs6000_init_builtins (void) fprintf (stderr, ", "); } fprintf (stderr, "); %s [%4d]\n", - rs6000_builtin_info_x[i].attr_string, (int) i); + rs6000_builtin_info[i].attr_string, (int) i); } fprintf (stderr, "\nEnd autogenerated built-in functions.\n\n\n"); } @@ -6342,7 +6342,7 @@ rs6000_init_builtins (void) } altivec_builtin_mask_for_load - = rs6000_builtin_decls_x[RS6000_BIF_MASK_FOR_LOAD]; + = rs6000_builtin_decls[RS6000_BIF_MASK_FOR_LOAD]; #ifdef SUBTARGET_INIT_BUILTINS SUBTARGET_INIT_BUILTINS; @@ -6359,7 +6359,7 @@ rs6000_builtin_decl (unsigned code, bool /* initialize_p */) if (fcode >= RS6000_OVLD_MAX) return error_mark_node; - return rs6000_builtin_decls_x[code]; + return rs6000_builtin_decls[code]; } /* Return the internal arg pointer used for function incoming diff --git a/gcc/config/rs6000/rs6000-gen-builtins.c b/gcc/config/rs6000/rs6000-gen-builtins.c index 114289a0034..f1a9d1f0e63 100644 --- a/gcc/config/rs6000/rs6000-gen-builtins.c +++ b/gcc/config/rs6000/rs6000-gen-builtins.c @@ -2208,7 +2208,7 @@ write_decls (void) fprintf (header_file, " RS6000_OVLD_MAX\n};\n\n"); fprintf (header_file, - "extern GTY(()) tree rs6000_builtin_decls_x[RS6000_OVLD_MAX];\n\n"); + "extern GTY(()) tree rs6000_builtin_decls[RS6000_OVLD_MAX];\n\n"); fprintf (header_file, "enum rs6000_ovld_instances\n{\n RS6000_INST_NONE,\n"); @@ -2336,9 +2336,6 @@ write_decls (void) "#define bif_is_endian(x)\t((x).bifattrs & bif_endian_bit)\n"); fprintf (header_file, "\n"); - /* #### Note that the _x is added for now to avoid conflict with - the existing rs6000_builtin_info[] file while testing. It will - be removed as we progress. */ /* #### Cannot mark this as a GC root because only pointer types can be marked as GTY((user)) and be GC roots. All trees in here are kept alive by other globals, so not a big deal. Alternatively, @@ -2346,7 +2343,7 @@ write_decls (void) to avoid requiring a GTY((user)) designation, but that seems unnecessarily gross. */ fprintf (header_file, - "extern bifdata rs6000_builtin_info_x[RS6000_BIF_MAX];\n\n"); + "extern bifdata rs6000_builtin_info[RS6000_BIF_MAX];\n\n"); fprintf (header_file, "struct GTY((user)) ovlddata\n"); fprintf (header_file, "{\n"); @@ -2495,12 +2492,12 @@ write_header_file (void) return 1; } -/* Write the decl and initializer for rs6000_builtin_info_x[]. */ +/* Write the decl and initializer for rs6000_builtin_info[]. */ static void write_bif_static_init (void) { const char *res[3]; - fprintf (init_file, "bifdata rs6000_builtin_info_x[RS6000_BIF_MAX] =\n"); + fprintf (init_file, "bifdata rs6000_builtin_info[RS6000_BIF_MAX] =\n"); fprintf (init_file, " {\n"); fprintf (init_file, " { /* RS6000_BIF_NONE: */\n"); fprintf (init_file, " \"\", ENB_ALWAYS, 0, CODE_FOR_nothing, 0,\n"); @@ -2665,7 +2662,7 @@ write_init_bif_table (void) for (int i = 0; i <= curr_bif; i++) { fprintf (init_file, - " rs6000_builtin_info_x[RS6000_BIF_%s].fntype" + " rs6000_builtin_info[RS6000_BIF_%s].fntype" "\n = %s;\n", bifs[i].idname, bifs[i].fndecl); @@ -2692,7 +2689,7 @@ write_init_bif_table (void) } fprintf (init_file, - " rs6000_builtin_decls_x[(int)RS6000_BIF_%s] = t\n", + " rs6000_builtin_decls[(int)RS6000_BIF_%s] = t\n", bifs[i].idname); fprintf (init_file, " = add_builtin_function (\"%s\",\n", @@ -2733,7 +2730,7 @@ write_init_bif_table (void) fprintf (init_file, " }\n"); fprintf (init_file, " else\n"); fprintf (init_file, " {\n"); - fprintf (init_file, " rs6000_builtin_decls_x" + fprintf (init_file, " rs6000_builtin_decls" "[(int)RS6000_BIF_%s] = NULL_TREE;\n", bifs[i].idname); fprintf (init_file, " }\n"); } @@ -2786,7 +2783,7 @@ write_init_ovld_table (void) } fprintf (init_file, - " rs6000_builtin_decls_x[(int)RS6000_OVLD_%s] = t\n", + " rs6000_builtin_decls[(int)RS6000_OVLD_%s] = t\n", stanza->stanza_id); fprintf (init_file, " = add_builtin_function (\"%s\",\n", @@ -2835,7 +2832,7 @@ write_init_file (void) fprintf (init_file, "#include \"rs6000-builtins.h\"\n"); fprintf (init_file, "\n"); - fprintf (init_file, "tree rs6000_builtin_decls_x[RS6000_OVLD_MAX];\n\n"); + fprintf (init_file, "tree rs6000_builtin_decls[RS6000_OVLD_MAX];\n\n"); write_bif_static_init (); write_ovld_static_init (); @@ -2851,11 +2848,11 @@ write_init_file (void) fprintf (init_file, "\n"); fprintf (init_file, - " rs6000_builtin_decls_x[RS6000_BIF_NONE] = NULL_TREE;\n"); + " rs6000_builtin_decls[RS6000_BIF_NONE] = NULL_TREE;\n"); fprintf (init_file, - " rs6000_builtin_decls_x[RS6000_BIF_MAX] = NULL_TREE;\n"); + " rs6000_builtin_decls[RS6000_BIF_MAX] = NULL_TREE;\n"); fprintf (init_file, - " rs6000_builtin_decls_x[RS6000_OVLD_NONE] = NULL_TREE;\n\n"); + " rs6000_builtin_decls[RS6000_OVLD_NONE] = NULL_TREE;\n\n"); write_init_bif_table (); write_init_ovld_table (); diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 38e22f927c5..60fbb1ea443 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -5596,95 +5596,95 @@ rs6000_builtin_vectorized_function (unsigned int fn, tree type_out, if (VECTOR_UNIT_VSX_P (V2DFmode) && out_mode == DFmode && out_n == 2 && in_mode == DFmode && in_n == 2) - return rs6000_builtin_decls_x[RS6000_BIF_CPSGNDP]; + return rs6000_builtin_decls[RS6000_BIF_CPSGNDP]; if (VECTOR_UNIT_VSX_P (V4SFmode) && out_mode == SFmode && out_n == 4 && in_mode == SFmode && in_n == 4) - return rs6000_builtin_decls_x[RS6000_BIF_CPSGNSP]; + return rs6000_builtin_decls[RS6000_BIF_CPSGNSP]; if (VECTOR_UNIT_ALTIVEC_P (V4SFmode) && out_mode == SFmode && out_n == 4 && in_mode == SFmode && in_n == 4) - return rs6000_builtin_decls_x[RS6000_BIF_COPYSIGN_V4SF]; + return rs6000_builtin_decls[RS6000_BIF_COPYSIGN_V4SF]; break; CASE_CFN_CEIL: if (VECTOR_UNIT_VSX_P (V2DFmode) && out_mode == DFmode && out_n == 2 && in_mode == DFmode && in_n == 2) - return rs6000_builtin_decls_x[RS6000_BIF_XVRDPIP]; + return rs6000_builtin_decls[RS6000_BIF_XVRDPIP]; if (VECTOR_UNIT_VSX_P (V4SFmode) && out_mode == SFmode && out_n == 4 && in_mode == SFmode && in_n == 4) - return rs6000_builtin_decls_x[RS6000_BIF_XVRSPIP]; + return rs6000_builtin_decls[RS6000_BIF_XVRSPIP]; if (VECTOR_UNIT_ALTIVEC_P (V4SFmode) && out_mode == SFmode && out_n == 4 && in_mode == SFmode && in_n == 4) - return rs6000_builtin_decls_x[RS6000_BIF_VRFIP]; + return rs6000_builtin_decls[RS6000_BIF_VRFIP]; break; CASE_CFN_FLOOR: if (VECTOR_UNIT_VSX_P (V2DFmode) && out_mode == DFmode && out_n == 2 && in_mode == DFmode && in_n == 2) - return rs6000_builtin_decls_x[RS6000_BIF_XVRDPIM]; + return rs6000_builtin_decls[RS6000_BIF_XVRDPIM]; if (VECTOR_UNIT_VSX_P (V4SFmode) && out_mode == SFmode && out_n == 4 && in_mode == SFmode && in_n == 4) - return rs6000_builtin_decls_x[RS6000_BIF_XVRSPIM]; + return rs6000_builtin_decls[RS6000_BIF_XVRSPIM]; if (VECTOR_UNIT_ALTIVEC_P (V4SFmode) && out_mode == SFmode && out_n == 4 && in_mode == SFmode && in_n == 4) - return rs6000_builtin_decls_x[RS6000_BIF_VRFIM]; + return rs6000_builtin_decls[RS6000_BIF_VRFIM]; break; CASE_CFN_FMA: if (VECTOR_UNIT_VSX_P (V2DFmode) && out_mode == DFmode && out_n == 2 && in_mode == DFmode && in_n == 2) - return rs6000_builtin_decls_x[RS6000_BIF_XVMADDDP]; + return rs6000_builtin_decls[RS6000_BIF_XVMADDDP]; if (VECTOR_UNIT_VSX_P (V4SFmode) && out_mode == SFmode && out_n == 4 && in_mode == SFmode && in_n == 4) - return rs6000_builtin_decls_x[RS6000_BIF_XVMADDSP]; + return rs6000_builtin_decls[RS6000_BIF_XVMADDSP]; if (VECTOR_UNIT_ALTIVEC_P (V4SFmode) && out_mode == SFmode && out_n == 4 && in_mode == SFmode && in_n == 4) - return rs6000_builtin_decls_x[RS6000_BIF_VMADDFP]; + return rs6000_builtin_decls[RS6000_BIF_VMADDFP]; break; CASE_CFN_TRUNC: if (VECTOR_UNIT_VSX_P (V2DFmode) && out_mode == DFmode && out_n == 2 && in_mode == DFmode && in_n == 2) - return rs6000_builtin_decls_x[RS6000_BIF_XVRDPIZ]; + return rs6000_builtin_decls[RS6000_BIF_XVRDPIZ]; if (VECTOR_UNIT_VSX_P (V4SFmode) && out_mode == SFmode && out_n == 4 && in_mode == SFmode && in_n == 4) - return rs6000_builtin_decls_x[RS6000_BIF_XVRSPIZ]; + return rs6000_builtin_decls[RS6000_BIF_XVRSPIZ]; if (VECTOR_UNIT_ALTIVEC_P (V4SFmode) && out_mode == SFmode && out_n == 4 && in_mode == SFmode && in_n == 4) - return rs6000_builtin_decls_x[RS6000_BIF_VRFIZ]; + return rs6000_builtin_decls[RS6000_BIF_VRFIZ]; break; CASE_CFN_NEARBYINT: if (VECTOR_UNIT_VSX_P (V2DFmode) && flag_unsafe_math_optimizations && out_mode == DFmode && out_n == 2 && in_mode == DFmode && in_n == 2) - return rs6000_builtin_decls_x[RS6000_BIF_XVRDPI]; + return rs6000_builtin_decls[RS6000_BIF_XVRDPI]; if (VECTOR_UNIT_VSX_P (V4SFmode) && flag_unsafe_math_optimizations && out_mode == SFmode && out_n == 4 && in_mode == SFmode && in_n == 4) - return rs6000_builtin_decls_x[RS6000_BIF_XVRSPI]; + return rs6000_builtin_decls[RS6000_BIF_XVRSPI]; break; CASE_CFN_RINT: if (VECTOR_UNIT_VSX_P (V2DFmode) && !flag_trapping_math && out_mode == DFmode && out_n == 2 && in_mode == DFmode && in_n == 2) - return rs6000_builtin_decls_x[RS6000_BIF_XVRDPIC]; + return rs6000_builtin_decls[RS6000_BIF_XVRDPIC]; if (VECTOR_UNIT_VSX_P (V4SFmode) && !flag_trapping_math && out_mode == SFmode && out_n == 4 && in_mode == SFmode && in_n == 4) - return rs6000_builtin_decls_x[RS6000_BIF_XVRSPIC]; + return rs6000_builtin_decls[RS6000_BIF_XVRSPIC]; break; default: break; @@ -5731,25 +5731,25 @@ rs6000_builtin_md_vectorized_function (tree fndecl, tree type_out, if (VECTOR_UNIT_ALTIVEC_OR_VSX_P (V4SFmode) && out_mode == SFmode && out_n == 4 && in_mode == SFmode && in_n == 4) - return rs6000_builtin_decls_x[RS6000_BIF_VRSQRTFP]; + return rs6000_builtin_decls[RS6000_BIF_VRSQRTFP]; break; case RS6000_BIF_RSQRT: if (VECTOR_UNIT_VSX_P (V2DFmode) && out_mode == DFmode && out_n == 2 && in_mode == DFmode && in_n == 2) - return rs6000_builtin_decls_x[RS6000_BIF_RSQRT_2DF]; + return rs6000_builtin_decls[RS6000_BIF_RSQRT_2DF]; break; case RS6000_BIF_RECIPF: if (VECTOR_UNIT_ALTIVEC_OR_VSX_P (V4SFmode) && out_mode == SFmode && out_n == 4 && in_mode == SFmode && in_n == 4) - return rs6000_builtin_decls_x[RS6000_BIF_VRECIPFP]; + return rs6000_builtin_decls[RS6000_BIF_VRECIPFP]; break; case RS6000_BIF_RECIP: if (VECTOR_UNIT_VSX_P (V2DFmode) && out_mode == DFmode && out_n == 2 && in_mode == DFmode && in_n == 2) - return rs6000_builtin_decls_x[RS6000_BIF_RECIP_V2DF]; + return rs6000_builtin_decls[RS6000_BIF_RECIP_V2DF]; break; default: break; @@ -5804,7 +5804,7 @@ rs6000_builtin_md_vectorized_function (tree fndecl, tree type_out, } if (in_mode == exp_mode && in_vmode == exp_vmode) - return rs6000_builtin_decls_x[bif]; + return rs6000_builtin_decls[bif]; } return NULL_TREE; @@ -22496,13 +22496,13 @@ rs6000_builtin_reciprocal (tree fndecl) if (!RS6000_RECIP_AUTO_RSQRTE_P (V2DFmode)) return NULL_TREE; - return rs6000_builtin_decls_x[RS6000_BIF_RSQRT_2DF]; + return rs6000_builtin_decls[RS6000_BIF_RSQRT_2DF]; case RS6000_BIF_XVSQRTSP: if (!RS6000_RECIP_AUTO_RSQRTE_P (V4SFmode)) return NULL_TREE; - return rs6000_builtin_decls_x[RS6000_BIF_RSQRT_4SF]; + return rs6000_builtin_decls[RS6000_BIF_RSQRT_4SF]; default: return NULL_TREE; @@ -25124,7 +25124,7 @@ add_condition_to_bb (tree function_decl, tree version_decl, tree bool_zero = build_int_cst (bool_int_type_node, 0); tree cond_var = create_tmp_var (bool_int_type_node); - tree predicate_decl = rs6000_builtin_decls_x[(int) RS6000_BIF_CPU_SUPPORTS]; + tree predicate_decl = rs6000_builtin_decls[(int) RS6000_BIF_CPU_SUPPORTS]; const char *arg_str = rs6000_clone_map[clone_isa].name; tree predicate_arg = build_string_literal (strlen (arg_str) + 1, arg_str); gimple *call_cond_stmt = gimple_build_call (predicate_decl, 1, predicate_arg); @@ -27764,8 +27764,8 @@ rs6000_atomic_assign_expand_fenv (tree *hold, tree *clear, tree *update) return; } - tree mffs = rs6000_builtin_decls_x[RS6000_BIF_MFFS]; - tree mtfsf = rs6000_builtin_decls_x[RS6000_BIF_MTFSF]; + tree mffs = rs6000_builtin_decls[RS6000_BIF_MFFS]; + tree mtfsf = rs6000_builtin_decls[RS6000_BIF_MTFSF]; tree call_mffs = build_call_expr (mffs, 0); /* Generates the equivalent of feholdexcept (&fenv_var)