aboutsummaryrefslogtreecommitdiff
path: root/gcc/genattrtab.c
diff options
context:
space:
mode:
authorTimothy Moore <moore@gnu.org>1992-09-13 15:11:55 +0000
committerTimothy Moore <moore@gnu.org>1992-09-13 15:11:55 +0000
commita9ab5e000d251d62b9b48062750a651e64af3360 (patch)
tree19d2bc8cf12e18c242222c2d89c047cf0b5aa847 /gcc/genattrtab.c
parenta120b7889de5c2127f5dca2559ff0d9999611957 (diff)
downloadgcc-a9ab5e000d251d62b9b48062750a651e64af3360.zip
gcc-a9ab5e000d251d62b9b48062750a651e64af3360.tar.gz
gcc-a9ab5e000d251d62b9b48062750a651e64af3360.tar.bz2
*** empty log message ***
From-SVN: r2112
Diffstat (limited to 'gcc/genattrtab.c')
-rw-r--r--gcc/genattrtab.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/gcc/genattrtab.c b/gcc/genattrtab.c
index 68a6f86..69259dd 100644
--- a/gcc/genattrtab.c
+++ b/gcc/genattrtab.c
@@ -5407,6 +5407,38 @@ fancy_abort ()
{
fatal ("Internal gcc abort.");
}
+
+/* Determine if an insn has a constant number of delay slots. */
+void
+write_const_num_delay_slots ()
+{
+ struct attr_desc *attr = find_attr ("*num_delay_slots", 0);
+ struct attr_value *av;
+ struct insn_ent *ie;
+ int i;
+
+ if (attr)
+ {
+ printf ("int\nconst_num_delay_slots (insn)\n");
+ printf (" rtx *insn;\n");
+ printf ("{\n");
+ printf (" switch (recog_memoized (insn))\n");
+ printf (" {\n");
+
+ for (av = attr->first_value; av; av = av->next)
+ if (GET_CODE (av->value) == COND && av->num_insns)
+ {
+ for (ie = av->first_insn; ie; ie = ie->next)
+ if (ie->insn_code != -1)
+ printf (" case %d:\n", ie->insn_code);
+ printf (" return 0;\n");
+ }
+ printf (" default:\n");
+ printf (" return 1;\n");
+ printf (" }\n}\n");
+ }
+}
+
int
main (argc, argv)
@@ -5574,6 +5606,9 @@ from the machine description file `md'. */\n\n");
if (num_units)
write_function_unit_info ();
+ /* Write out constant delay slot info */
+ write_const_num_delay_slots ();
+
fflush (stdout);
exit (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE);
/* NOTREACHED */