public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/wschmidt/heads/builtins4)] rs6000: Parsing built-in input file, part 3 of 3
@ 2020-11-24 16:42 William Schmidt
0 siblings, 0 replies; 4+ messages in thread
From: William Schmidt @ 2020-11-24 16:42 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:4e640c84d7c95e76d92fb68926b7e2b5fc964922
commit 4e640c84d7c95e76d92fb68926b7e2b5fc964922
Author: Bill Schmidt <wschmidt@linux.ibm.com>
Date: Sun Nov 1 19:18:17 2020 -0500
rs6000: Parsing built-in input file, part 3 of 3
2020-11-01 Bill Schmidt <wschmidt@linux.ibm.com>
* config/rs6000/rs6000-gen-builtins.c (parse_bif_attrs):
Implement.
Diff:
---
gcc/config/rs6000/rs6000-gen-builtins.c | 94 +++++++++++++++++++++++++++++++++
1 file changed, 94 insertions(+)
diff --git a/gcc/config/rs6000/rs6000-gen-builtins.c b/gcc/config/rs6000/rs6000-gen-builtins.c
index 765105cdc5b..0d8851452dd 100644
--- a/gcc/config/rs6000/rs6000-gen-builtins.c
+++ b/gcc/config/rs6000/rs6000-gen-builtins.c
@@ -1193,6 +1193,100 @@ 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, "quad"))
+ attrptr->isquad = 1;
+ else if (!strcmp (attrname, "pair"))
+ attrptr->ispair = 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 if (!strcmp (attrname, "lxvr"))
+ attrptr->islxvr = 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, \
+cpu = %d, ldstmask = %d, lxvr = %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->iscpu, attrptr->isldstmask,
+ attrptr->islxvr);
+#endif
+
return PC_OK;
}
^ permalink raw reply [flat|nested] 4+ messages in thread
* [gcc(refs/users/wschmidt/heads/builtins4)] rs6000: Parsing built-in input file, part 3 of 3
@ 2021-02-07 18:11 William Schmidt
0 siblings, 0 replies; 4+ messages in thread
From: William Schmidt @ 2021-02-07 18:11 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:836c0316b247881685c30a1fa688adc52ef71610
commit 836c0316b247881685c30a1fa688adc52ef71610
Author: Bill Schmidt <wschmidt@linux.ibm.com>
Date: Sun Nov 1 19:18:17 2020 -0500
rs6000: Parsing built-in input file, part 3 of 3
2020-11-01 Bill Schmidt <wschmidt@linux.ibm.com>
* config/rs6000/rs6000-gen-builtins.c (parse_bif_attrs):
Implement.
Diff:
---
gcc/config/rs6000/rs6000-gen-builtins.c | 94 +++++++++++++++++++++++++++++++++
1 file changed, 94 insertions(+)
diff --git a/gcc/config/rs6000/rs6000-gen-builtins.c b/gcc/config/rs6000/rs6000-gen-builtins.c
index 765105cdc5b..0d8851452dd 100644
--- a/gcc/config/rs6000/rs6000-gen-builtins.c
+++ b/gcc/config/rs6000/rs6000-gen-builtins.c
@@ -1193,6 +1193,100 @@ 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, "quad"))
+ attrptr->isquad = 1;
+ else if (!strcmp (attrname, "pair"))
+ attrptr->ispair = 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 if (!strcmp (attrname, "lxvr"))
+ attrptr->islxvr = 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, \
+cpu = %d, ldstmask = %d, lxvr = %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->iscpu, attrptr->isldstmask,
+ attrptr->islxvr);
+#endif
+
return PC_OK;
}
^ permalink raw reply [flat|nested] 4+ messages in thread
* [gcc(refs/users/wschmidt/heads/builtins4)] rs6000: Parsing built-in input file, part 3 of 3
@ 2020-12-16 18:05 William Schmidt
0 siblings, 0 replies; 4+ messages in thread
From: William Schmidt @ 2020-12-16 18:05 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:4126565da40be36e0146562556d3639f40ac7f04
commit 4126565da40be36e0146562556d3639f40ac7f04
Author: Bill Schmidt <wschmidt@linux.ibm.com>
Date: Sun Nov 1 19:18:17 2020 -0500
rs6000: Parsing built-in input file, part 3 of 3
2020-11-01 Bill Schmidt <wschmidt@linux.ibm.com>
* config/rs6000/rs6000-gen-builtins.c (parse_bif_attrs):
Implement.
Diff:
---
gcc/config/rs6000/rs6000-gen-builtins.c | 94 +++++++++++++++++++++++++++++++++
1 file changed, 94 insertions(+)
diff --git a/gcc/config/rs6000/rs6000-gen-builtins.c b/gcc/config/rs6000/rs6000-gen-builtins.c
index 765105cdc5b..0d8851452dd 100644
--- a/gcc/config/rs6000/rs6000-gen-builtins.c
+++ b/gcc/config/rs6000/rs6000-gen-builtins.c
@@ -1193,6 +1193,100 @@ 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, "quad"))
+ attrptr->isquad = 1;
+ else if (!strcmp (attrname, "pair"))
+ attrptr->ispair = 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 if (!strcmp (attrname, "lxvr"))
+ attrptr->islxvr = 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, \
+cpu = %d, ldstmask = %d, lxvr = %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->iscpu, attrptr->isldstmask,
+ attrptr->islxvr);
+#endif
+
return PC_OK;
}
^ permalink raw reply [flat|nested] 4+ messages in thread
* [gcc(refs/users/wschmidt/heads/builtins4)] rs6000: Parsing built-in input file, part 3 of 3
@ 2020-11-02 0:18 William Schmidt
0 siblings, 0 replies; 4+ messages in thread
From: William Schmidt @ 2020-11-02 0:18 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:903c993672f2c66efcf08f7655bbbfe793849dca
commit 903c993672f2c66efcf08f7655bbbfe793849dca
Author: Bill Schmidt <wschmidt@linux.ibm.com>
Date: Sun Nov 1 19:18:17 2020 -0500
rs6000: Parsing built-in input file, part 3 of 3
2020-11-01 Bill Schmidt <wschmidt@linux.ibm.com>
* config/rs6000/rs6000-gen-builtins.c (parse_bif_attrs):
Implement.
Diff:
---
gcc/config/rs6000/rs6000-gen-builtins.c | 94 +++++++++++++++++++++++++++++++++
1 file changed, 94 insertions(+)
diff --git a/gcc/config/rs6000/rs6000-gen-builtins.c b/gcc/config/rs6000/rs6000-gen-builtins.c
index 765105cdc5b..0d8851452dd 100644
--- a/gcc/config/rs6000/rs6000-gen-builtins.c
+++ b/gcc/config/rs6000/rs6000-gen-builtins.c
@@ -1193,6 +1193,100 @@ 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, "quad"))
+ attrptr->isquad = 1;
+ else if (!strcmp (attrname, "pair"))
+ attrptr->ispair = 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 if (!strcmp (attrname, "lxvr"))
+ attrptr->islxvr = 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, \
+cpu = %d, ldstmask = %d, lxvr = %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->iscpu, attrptr->isldstmask,
+ attrptr->islxvr);
+#endif
+
return PC_OK;
}
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-02-07 18:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-24 16:42 [gcc(refs/users/wschmidt/heads/builtins4)] rs6000: Parsing built-in input file, part 3 of 3 William Schmidt
-- strict thread matches above, loose matches on Subject: below --
2021-02-07 18:11 William Schmidt
2020-12-16 18:05 William Schmidt
2020-11-02 0:18 William Schmidt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).