Commit d90ffc8d by Jan Hubicka Committed by Jan Hubicka

i386.md (add?i_3, add?i_5): New.


	* 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.

From-SVN: r36342
parent 14203c9c
Tue Sep 12 01:51:38 MET DST 2000 Jan Hubicka <jh@suse.cz>
* 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.
2000-09-11 Matthew Hiller <hiller@redhat.com>
* config/h8300/h8300.md (movstrictqi): Changed constraint modifier
......
......@@ -5212,18 +5212,15 @@ write_attr_case (attr, av, write_case_lines, prefix, suffix, indent,
must_extract = must_constrain = address_used = 0;
walk_attr_value (av->value);
if (must_extract)
if (must_constrain)
{
write_indent (indent + 2);
printf ("extract_insn (insn);\n");
printf ("extract_constrain_insn_cached (insn);\n");
}
if (must_constrain)
else if (must_extract)
{
write_indent (indent + 2);
printf ("if (! constrain_operands (reload_completed))\n");
write_indent (indent + 2);
printf (" fatal_insn_not_found (insn);\n");
printf ("extract_insn_cached (insn);\n");
}
write_attr_set (attr, indent + 2, av->value, prefix, suffix,
......
......@@ -2189,6 +2189,9 @@ peephole2%s (x0, insn, _pmatch_len)\n\
printf (" %s tem ATTRIBUTE_UNUSED;\n", IS_SPLIT (type) ? "rtx" : "int");
if (!subfunction)
printf (" recog_data.insn = NULL_RTX;\n");
if (head->first)
write_tree (head, "", type, 1);
else
......
......@@ -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)
......
......@@ -116,6 +116,8 @@ extern int recog PARAMS ((rtx, rtx, int *));
extern void add_clobbers PARAMS ((rtx, int));
extern void insn_extract PARAMS ((rtx));
extern void extract_insn PARAMS ((rtx));
extern void extract_constrain_insn_cached PARAMS ((rtx));
extern void extract_insn_cached PARAMS ((rtx));
extern void preprocess_constraints PARAMS ((void));
extern rtx peep2_next_insn PARAMS ((int));
extern int peep2_regno_dead_p PARAMS ((int, int));
......@@ -186,6 +188,9 @@ struct recog_data
/* The number of alternatives in the constraints for the insn. */
char n_alternatives;
/* In case we are caching, hold insn data was generated for. */
rtx insn;
};
extern struct recog_data recog_data;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment