summaryrefslogtreecommitdiff
path: root/gcc/recog.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2000-09-11 23:54:11 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2000-09-11 23:54:11 +0000
commit0edc2b1cc887e4e3e9cdd3d45512e553d0ed4d84 (patch)
treea4a10ad41eb4009a3a451fc4518e9f29cc1010ab /gcc/recog.c
parentc6322c9a3ef07e3a3073e64c3edc4990419b346f (diff)
downloadgcc-0edc2b1cc887e4e3e9cdd3d45512e553d0ed4d84.tar.gz
* i386.md (add?i_3, add?i_5): New.
(add?i_4): Rename from add?i_3; Fix compare pattern. (sub?i_3, xor?i_3, ior?i_3): New. * genrecog.c (write_tree): Output code to clear insn_extract cache. * genattrtab.c (write_attr_case): Gen call to extract_insn_cache instead of extract_insn and extract_constrain_insn_cache instead of extract_insn and constrain_operands. * recog.c (extract_insn_cached, extract_constrain_insn_cached): New functions. (extract_insn): Clear which_alternative. (constrain_operands): Set which_alternative to -1 when failed. * recog.h (extract_constrain_insn_cached, extract_insn_cached): Declare. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@36342 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/recog.c')
-rw-r--r--gcc/recog.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/recog.c b/gcc/recog.c
index 87f8137f302..f1d5dee6c46 100644
--- a/gcc/recog.c
+++ b/gcc/recog.c
@@ -2045,6 +2045,31 @@ adj_offsettable_operand (op, offset)
abort ();
}
+/* Like extract_insn, but save insn extracted and don't extract again, when
+ called again for the same insn expecting that recog_data still contain the
+ valid information. This is used primary by gen_attr infrastructure that
+ often does extract insn again and again. */
+void
+extract_insn_cached (insn)
+ rtx insn;
+{
+ if (recog_data.insn == insn && INSN_CODE (insn) >= 0)
+ return;
+ extract_insn (insn);
+ recog_data.insn = insn;
+}
+/* Do cached extract_insn, constrain_operand and complain about failures.
+ Used by insn_attrtab. */
+void
+extract_constrain_insn_cached (insn)
+ rtx insn;
+{
+ extract_insn_cached (insn);
+ if (which_alternative == -1
+ && !constrain_operands (reload_completed))
+ fatal_insn_not_found (insn);
+}
+
/* Analyze INSN and fill in recog_data. */
void
@@ -2056,9 +2081,11 @@ extract_insn (insn)
int noperands;
rtx body = PATTERN (insn);
+ recog_data.insn = NULL;
recog_data.n_operands = 0;
recog_data.n_alternatives = 0;
recog_data.n_dups = 0;
+ which_alternative = -1;
switch (GET_CODE (body))
{
@@ -2592,6 +2619,7 @@ constrain_operands (strict)
which_alternative++;
}
+ which_alternative = -1;
/* If we are about to reject this, but we are not to test strictly,
try a very loose test. Only return failure if it fails also. */
if (strict == 0)