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 AB9DB396AC17 for ; Thu, 17 Jun 2021 15:21:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AB9DB396AC17 Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 15HF3ffH148443; Thu, 17 Jun 2021 11:21:17 -0400 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 3988k3gv1d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 17 Jun 2021 11:21:16 -0400 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 15HFCHUR017778; Thu, 17 Jun 2021 15:21:16 GMT Received: from b03cxnp07027.gho.boulder.ibm.com (b03cxnp07027.gho.boulder.ibm.com [9.17.130.14]) by ppma02dal.us.ibm.com with ESMTP id 394mjacb8f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 17 Jun 2021 15:21:15 +0000 Received: from b03ledav001.gho.boulder.ibm.com (b03ledav001.gho.boulder.ibm.com [9.17.130.232]) by b03cxnp07027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 15HFLE9723134510 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 17 Jun 2021 15:21:14 GMT Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9514E6E059; Thu, 17 Jun 2021 15:21:14 +0000 (GMT) Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7CC536E056; Thu, 17 Jun 2021 15:21:14 +0000 (GMT) Received: from localhost (unknown [9.40.194.84]) by b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTP; Thu, 17 Jun 2021 15:21:14 +0000 (GMT) From: Bill Schmidt To: gcc-patches@gcc.gnu.org Cc: segher@kernel.crashing.org Subject: [PATCH 13/55] rs6000: Parsing built-in input file, part 3 of 3 Date: Thu, 17 Jun 2021 10:18:57 -0500 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: X-TM-AS-GCONF: 00 X-Proofpoint-GUID: Hpg9uVFnmBQ9p3BEw8xBi_OicEKXz1Yl X-Proofpoint-ORIG-GUID: Hpg9uVFnmBQ9p3BEw8xBi_OicEKXz1Yl X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-06-17_13:2021-06-15, 2021-06-17 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 lowpriorityscore=0 priorityscore=1501 mlxscore=0 malwarescore=0 mlxlogscore=999 clxscore=1015 spamscore=0 suspectscore=0 impostorscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106170096 X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, 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-List-Received-Date: Thu, 17 Jun 2021 15:21:19 -0000 2021-06-07 Bill Schmidt gcc/ * config/rs6000/rs6000-gen-builtins.c (parse_bif_attrs): Implement. --- gcc/config/rs6000/rs6000-gen-builtins.c | 102 ++++++++++++++++++++++++ 1 file changed, 102 insertions(+) diff --git a/gcc/config/rs6000/rs6000-gen-builtins.c b/gcc/config/rs6000/rs6000-gen-builtins.c index 7985d2d9a71..ff3d3b71f3c 100644 --- a/gcc/config/rs6000/rs6000-gen-builtins.c +++ b/gcc/config/rs6000/rs6000-gen-builtins.c @@ -1148,6 +1148,108 @@ base = %d, restr = %d, val1 = \"%s\", val2 = \"%s\", pos = %d.\n", static parse_codes parse_bif_attrs (attrinfo *attrptr) { + consume_whitespace (); + if (linebuf[pos] != '{') + { + (*diag) ("missing attribute set at column %d.\n", pos + 1); + return PC_PARSEFAIL; + } + safe_inc_pos (); + + memset (attrptr, 0, sizeof *attrptr); + char *attrname = NULL; + + do { + consume_whitespace (); + int oldpos = pos; + attrname = match_identifier (); + if (attrname) + { + if (!strcmp (attrname, "init")) + attrptr->isinit = 1; + else if (!strcmp (attrname, "set")) + attrptr->isset = 1; + else if (!strcmp (attrname, "extract")) + attrptr->isextract = 1; + else if (!strcmp (attrname, "nosoft")) + attrptr->isnosoft = 1; + else if (!strcmp (attrname, "ldvec")) + attrptr->isldvec = 1; + else if (!strcmp (attrname, "stvec")) + attrptr->isstvec = 1; + else if (!strcmp (attrname, "reve")) + attrptr->isreve = 1; + else if (!strcmp (attrname, "pred")) + attrptr->ispred = 1; + else if (!strcmp (attrname, "htm")) + attrptr->ishtm = 1; + else if (!strcmp (attrname, "htmspr")) + attrptr->ishtmspr = 1; + else if (!strcmp (attrname, "htmcr")) + attrptr->ishtmcr = 1; + else if (!strcmp (attrname, "mma")) + attrptr->ismma = 1; + else if (!strcmp (attrname, "quad")) + attrptr->isquad = 1; + else if (!strcmp (attrname, "pair")) + attrptr->ispair = 1; + else if (!strcmp (attrname, "no32bit")) + attrptr->isno32bit = 1; + else if (!strcmp (attrname, "32bit")) + attrptr->is32bit = 1; + else if (!strcmp (attrname, "cpu")) + attrptr->iscpu = 1; + else if (!strcmp (attrname, "ldstmask")) + attrptr->isldstmask = 1; + else if (!strcmp (attrname, "lxvrse")) + attrptr->islxvrse = 1; + else if (!strcmp (attrname, "lxvrze")) + attrptr->islxvrze = 1; + else if (!strcmp (attrname, "endian")) + attrptr->isendian = 1; + else + { + (*diag) ("unknown attribute at column %d.\n", oldpos + 1); + return PC_PARSEFAIL; + } + + consume_whitespace (); + if (linebuf[pos] == ',') + safe_inc_pos (); + else if (linebuf[pos] != '}') + { + (*diag) ("arg not followed by ',' or '}' at column %d.\n", + pos + 1); + return PC_PARSEFAIL; + } + } + else + { + pos = oldpos; + if (linebuf[pos] != '}') + { + (*diag) ("badly terminated attr set at column %d.\n", pos + 1); + return PC_PARSEFAIL; + } + safe_inc_pos (); + } + } while (attrname); + +#ifdef DEBUG + (*diag) ("attribute set: init = %d, set = %d, extract = %d, \ +nosoft = %d, ldvec = %d, stvec = %d, reve = %d, pred = %d, htm = %d, \ +htmspr = %d, htmcr = %d, mma = %d, quad = %d, pair = %d, no32bit = %d, \ +32bit = %d, cpu = %d, ldstmask = %d, lxvrse = %d, lxvrze = %d, \ +endian = %d.\n", + attrptr->isinit, attrptr->isset, attrptr->isextract, + attrptr->isnosoft, attrptr->isldvec, attrptr->isstvec, + attrptr->isreve, attrptr->ispred, attrptr->ishtm, attrptr->ishtmspr, + attrptr->ishtmcr, attrptr->ismma, attrptr->isquad, attrptr->ispair, + attrptr->isno32bit, attrptr->is32bit, attrptr->iscpu, + attrptr->isldstmask, attrptr->islxvrse, attrptr->islxvrze, + attrptr->isendian); +#endif + return PC_OK; } -- 2.27.0