From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 18B0E39A4004 for ; Tue, 27 Apr 2021 15:34:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 18B0E39A4004 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 13RFWdn5044054; Tue, 27 Apr 2021 11:34:26 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 386jjb6s98-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Apr 2021 11:34:26 -0400 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 13RFX0nA045213; Tue, 27 Apr 2021 11:34:25 -0400 Received: from ppma01wdc.us.ibm.com (fd.55.37a9.ip4.static.sl-reverse.com [169.55.85.253]) by mx0a-001b2d01.pphosted.com with ESMTP id 386jjb6s8m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Apr 2021 11:34:25 -0400 Received: from pps.filterd (ppma01wdc.us.ibm.com [127.0.0.1]) by ppma01wdc.us.ibm.com (8.16.0.43/8.16.0.43) with SMTP id 13RFN8F2018542; Tue, 27 Apr 2021 15:34:24 GMT Received: from b03cxnp08026.gho.boulder.ibm.com (b03cxnp08026.gho.boulder.ibm.com [9.17.130.18]) by ppma01wdc.us.ibm.com with ESMTP id 384ay9edua-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Apr 2021 15:34:24 +0000 Received: from b03ledav003.gho.boulder.ibm.com (b03ledav003.gho.boulder.ibm.com [9.17.130.234]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 13RFYNFp25755932 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Apr 2021 15:34:23 GMT Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 36FD46A051; Tue, 27 Apr 2021 15:34:23 +0000 (GMT) Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2188F6A04F; Tue, 27 Apr 2021 15:34:23 +0000 (GMT) Received: from ltcden2-lp1.aus.stglabs.ibm.com (unknown [9.53.174.68]) by b03ledav003.gho.boulder.ibm.com (Postfix) with ESMTPS; Tue, 27 Apr 2021 15:34:23 +0000 (GMT) Received: by ltcden2-lp1.aus.stglabs.ibm.com (Postfix, from userid 1006) id 9C25B41397AD; Tue, 27 Apr 2021 10:34:22 -0500 (CDT) From: Bill Schmidt To: gcc-patches@gcc.gnu.org Cc: segher@kernel.crashing.org, dje.gcc@gmail.com, jakub@redhat.com, jlaw@tachyum.com, Bill Schmidt Subject: [PATCH 23/57] rs6000: Write static initializations for overload tables Date: Tue, 27 Apr 2021 10:32:58 -0500 Message-Id: <3d275becf95fb0ad9cedad8ac8ea11aa7d89c27a.1619537141.git.wschmidt@linux.ibm.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: f1ABNsTuaTodBFs_R3lSN-W-yOnTVhCX X-Proofpoint-ORIG-GUID: WJSDIaN7sdwUjdQCErWLek8dOb6e6AXC X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.761 definitions=2021-04-27_08:2021-04-27, 2021-04-27 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 mlxscore=0 spamscore=0 bulkscore=0 suspectscore=0 phishscore=0 clxscore=1015 mlxlogscore=999 adultscore=0 lowpriorityscore=0 impostorscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104270108 X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP, UNWANTED_LANGUAGE_BODY autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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-List-Received-Date: Tue, 27 Apr 2021 15:34:28 -0000 2021-03-03 Bill Schmidt gcc/ * config/rs6000/rs6000-gen-builtins.c (write_ovld_static_init): New function. (write_init_file): Call write_ovld_static_init. --- gcc/config/rs6000/rs6000-gen-builtins.c | 53 +++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/gcc/config/rs6000/rs6000-gen-builtins.c b/gcc/config/rs6000/rs6000-gen-builtins.c index aeedb77faf5..39080e838f3 100644 --- a/gcc/config/rs6000/rs6000-gen-builtins.c +++ b/gcc/config/rs6000/rs6000-gen-builtins.c @@ -2543,6 +2543,58 @@ write_bif_static_init () fprintf (init_file, " };\n\n"); } +/* Write the decls and initializers for rs6000_overload_info[] and + rs6000_instance_info[]. */ +static void +write_ovld_static_init () +{ + fprintf (init_file, + "ovldrecord rs6000_overload_info[RS6000_OVLD_MAX " + "- RS6000_OVLD_NONE] =\n"); + fprintf (init_file, " {\n"); + fprintf (init_file, " { /* RS6000_OVLD_NONE: */\n"); + fprintf (init_file, " \"\", NULL\n"); + fprintf (init_file, " },\n"); + for (int i = 0; i <= curr_ovld_stanza; i++) + { + fprintf (init_file, " { /* RS6000_OVLD_%s: */\n", + ovld_stanzas[i].stanza_id); + fprintf (init_file, " /* ovld_name */\t\"%s\",\n", + ovld_stanzas[i].intern_name); + /* First-instance must currently be instantiated at run time. */ + fprintf (init_file, " /* first_instance */\tNULL\n"); + fprintf (init_file, " },\n"); + } + fprintf (init_file, " };\n\n"); + + fprintf (init_file, "ovlddata rs6000_instance_info[RS6000_INST_MAX] =\n"); + fprintf (init_file, " {\n"); + fprintf (init_file, " { /* RS6000_INST_NONE: */\n"); + fprintf (init_file, " \"\", RS6000_BIF_NONE, NULL_TREE, NULL\n"); + fprintf (init_file, " },\n"); + for (int i = 0; i <= curr_ovld; i++) + { + fprintf (init_file, " { /* RS6000_INST_%s: */\n", + ovlds[i].ovld_id_name); + fprintf (init_file, " /* bifname */\t\"%s\",\n", + ovlds[i].proto.bifname); + fprintf (init_file, " /* bifid */\tRS6000_BIF_%s,\n", + ovlds[i].bif_id_name); + /* Type must be instantiated at run time. */ + fprintf (init_file, " /* fntype */\t0,\n"); + fprintf (init_file, " /* next */\t"); + if (i < curr_ovld + && !strcmp (ovlds[i+1].proto.bifname, ovlds[i].proto.bifname)) + fprintf (init_file, + "&rs6000_instance_info[RS6000_INST_%s]\n", + ovlds[i+1].ovld_id_name); + else + fprintf (init_file, "NULL\n"); + fprintf (init_file, " },\n"); + } + fprintf (init_file, " };\n\n"); +} + /* Write code to initialize the built-in function table. */ static void write_init_bif_table () @@ -2711,6 +2763,7 @@ write_init_file () fprintf (init_file, "tree rs6000_builtin_decls_x[RS6000_OVLD_MAX];\n\n"); write_bif_static_init (); + write_ovld_static_init (); rbt_inorder_callback (&fntype_rbt, fntype_rbt.rbt_root, write_fntype); fprintf (init_file, "\n"); -- 2.27.0