From patchwork Tue Jun 8 18:26:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Schmidt X-Patchwork-Id: 1489559 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: 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=bQLcaS0T; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (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 ozlabs.org (Postfix) with ESMTPS id 4FzzpT0stqz9tkS for ; Wed, 9 Jun 2021 04:50:55 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3D9453980832 for ; Tue, 8 Jun 2021 18:50:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3D9453980832 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1623178253; bh=yPYsWdZ1p/v7XdBPZzahKZGH5KhqGhjzsDkhPByu5Mw=; h=To:Subject:Date:In-Reply-To:References:In-Reply-To:References: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help: List-Subscribe:From:Reply-To:Cc:From; b=bQLcaS0TGAS+9q5+TxvAtw+7o/2y4c0JWij+B8tpxA/6UII/VsdKLO5g7R9hpjEqR BH9TIYlisAVMQ9QVgYT/ywOLh4X7tQuMJdUMPUP8fA2+gKuz5upZ8irrcNIhMKvDC2 qU00c8UY0oaY71hIwgDABEy0g3fqwPmofES8rVOM= 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 4736739730F2 for ; Tue, 8 Jun 2021 18:27:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4736739730F2 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 158IHoYK140706; Tue, 8 Jun 2021 14:27:50 -0400 Received: from ppma05wdc.us.ibm.com (1b.90.2fa9.ip4.static.sl-reverse.com [169.47.144.27]) by mx0a-001b2d01.pphosted.com with ESMTP id 392dq286f0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Jun 2021 14:27:50 -0400 Received: from pps.filterd (ppma05wdc.us.ibm.com [127.0.0.1]) by ppma05wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 158IInDN028837; Tue, 8 Jun 2021 18:27:49 GMT Received: from b01cxnp22034.gho.pok.ibm.com (b01cxnp22034.gho.pok.ibm.com [9.57.198.24]) by ppma05wdc.us.ibm.com with ESMTP id 3900w9hf61-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Jun 2021 18:27:49 +0000 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 158IRmwJ33554770 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 8 Jun 2021 18:27:48 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D0D8EAE066; Tue, 8 Jun 2021 18:27:48 +0000 (GMT) Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 94B55AE060; Tue, 8 Jun 2021 18:27:48 +0000 (GMT) Received: from localhost (unknown [9.40.194.84]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP; Tue, 8 Jun 2021 18:27:48 +0000 (GMT) To: gcc-patches@gcc.gnu.org Subject: [PATCH 22/55] rs6000: Write static initializations for overload tables Date: Tue, 8 Jun 2021 13:26:29 -0500 Message-Id: <6d79b24050982b30fb9aeb01e93fb6b89f4fc9a4.1623163679.git.wschmidt@linux.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: X-TM-AS-GCONF: 00 X-Proofpoint-GUID: bFjdJ9I1w-m0NHPUTdJ25rMn8YXK5lhW X-Proofpoint-ORIG-GUID: bFjdJ9I1w-m0NHPUTdJ25rMn8YXK5lhW X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.761 definitions=2021-06-08_14:2021-06-04, 2021-06-08 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 phishscore=0 adultscore=0 malwarescore=0 lowpriorityscore=0 impostorscore=0 bulkscore=0 clxscore=1015 spamscore=0 mlxscore=0 suspectscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106080117 X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, 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-Patchwork-Original-From: Bill Schmidt via Gcc-patches From: Bill Schmidt Reply-To: Bill Schmidt Cc: segher@kernel.crashing.org Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" 2021-06-07 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 7910a3b934c..c3874e85592 100644 --- a/gcc/config/rs6000/rs6000-gen-builtins.c +++ b/gcc/config/rs6000/rs6000-gen-builtins.c @@ -2518,6 +2518,58 @@ write_bif_static_init (void) fprintf (init_file, " };\n\n"); } +/* Write the decls and initializers for rs6000_overload_info[] and + rs6000_instance_info[]. */ +static void +write_ovld_static_init (void) +{ + 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 (void) @@ -2706,6 +2758,7 @@ write_init_file (void) 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");