From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1725) id C5C5C3857818; Mon, 14 Sep 2020 13:57:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C5C5C3857818 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1600091873; bh=i0vzvvx/CKu7CBex6gU1/K7BLH6wwDhEGwGoGZaCgEI=; h=From:To:Subject:Date:From; b=RdZdKIcAP3FQjfn3CNlaiDqKXbFi6uMjCm8o+dE8qHwFyuePP+FALHJ5pFkJrmZEc xOsL8iJyrHVEEy4T7g2wc3zNAQoxnP3IHJnlGnZnsE674Pm9W2hl9w3LT8xYihVVC1 VtXs4AWvyokWn5GrzoZuOTSlWSLgoTBTb0c4msl8= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: William Schmidt To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/wschmidt/heads/builtins3)] rs6000: Parsing built-in input file, part 3 of 3 X-Act-Checkin: gcc X-Git-Author: Bill Schmidt X-Git-Refname: refs/users/wschmidt/heads/builtins3 X-Git-Oldrev: 6ac7391d63bf088795bcb8d3975d0a64f850666c X-Git-Newrev: 175ff01da693c0b852eb1000a9d74338655e914d Message-Id: <20200914135753.C5C5C3857818@sourceware.org> Date: Mon, 14 Sep 2020 13:57:53 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2020 13:57:53 -0000 https://gcc.gnu.org/g:175ff01da693c0b852eb1000a9d74338655e914d commit 175ff01da693c0b852eb1000a9d74338655e914d Author: Bill Schmidt Date: Wed Jun 17 11:00:34 2020 -0500 rs6000: Parsing built-in input file, part 3 of 3 2020-07-26 Bill Schmidt * config/rs6000/rs6000-gen-builtins.c (parse_bif_attrs): Implement. Diff: --- gcc/config/rs6000/rs6000-gen-builtins.c | 86 +++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/gcc/config/rs6000/rs6000-gen-builtins.c b/gcc/config/rs6000/rs6000-gen-builtins.c index 5265b591ec6..c4bc5c724a3 100644 --- a/gcc/config/rs6000/rs6000-gen-builtins.c +++ b/gcc/config/rs6000/rs6000-gen-builtins.c @@ -1142,6 +1142,92 @@ base = %d, restr = %d, val1 = %d, val2 = %d, 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, "no32bit")) + attrptr->isno32bit = 1; + else if (!strcmp (attrname, "cpu")) + attrptr->iscpu = 1; + else if (!strcmp (attrname, "ldstmask")) + attrptr->isldstmask = 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, no32bit = %d, cpu = %d, ldstmask = %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->isno32bit, + attrptr->iscpu, attrptr->isldstmask); +#endif + return PC_OK; }