diff options
author | Andreas Krebbel <krebbel1@de.ibm.com> | 2008-05-27 11:46:45 +0000 |
---|---|---|
committer | Andreas Krebbel <krebbel@gcc.gnu.org> | 2008-05-27 11:46:45 +0000 |
commit | 7ac28727fb6149d6e9301e501a94080cb80be27a (patch) | |
tree | 8b144af648d4119d5962a025331d5ae887135564 /gcc/recog.c | |
parent | a4edaf835918f2dd4a2c36659b3639438a0d1a38 (diff) | |
download | gcc-7ac28727fb6149d6e9301e501a94080cb80be27a.zip gcc-7ac28727fb6149d6e9301e501a94080cb80be27a.tar.gz gcc-7ac28727fb6149d6e9301e501a94080cb80be27a.tar.bz2 |
reload.c: (find_reloads): Skip alternatives according to the "enabled" attribute.
2008-05-27 Andreas Krebbel <krebbel1@de.ibm.com>
* reload.c: (find_reloads): Skip alternatives according to the
"enabled" attribute. Constify the constraint variable.
* recog.c (get_attr_enabled): Add default implementation.
(extract_insn): Set the alternative_enabled_p array
in the recog_data struct.
(preprocess_constraints, constrain_operands): Skip
alternatives according to the "enabled" attribute
* recog.h (struct recog_data): New field alternative_enabled_p.
(skip_alternative): New inline function.
* regclass.c: (record_operand_costs): Check the "enabled"
attribute.
(record_reg_classes): Skip alternative according to the
"enabled" attribute.
* doc/md.texi: Add documention for the "enabled" attribute.
From-SVN: r136012
Diffstat (limited to 'gcc/recog.c')
-rw-r--r-- | gcc/recog.c | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/gcc/recog.c b/gcc/recog.c index a8994ea..ee5837d 100644 --- a/gcc/recog.c +++ b/gcc/recog.c @@ -60,6 +60,14 @@ along with GCC; see the file COPYING3. If not see #endif #endif +#ifndef HAVE_ATTR_enabled +static inline bool +get_attr_enabled (rtx insn ATTRIBUTE_UNUSED) +{ + return true; +} +#endif + static void validate_replace_rtx_1 (rtx *, rtx, rtx, rtx); static void validate_replace_src_1 (rtx *, void *); static rtx split_insn (rtx); @@ -1920,11 +1928,9 @@ extract_insn (rtx 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)) { @@ -2004,6 +2010,22 @@ extract_insn (rtx insn) : OP_IN); gcc_assert (recog_data.n_alternatives <= MAX_RECOG_ALTERNATIVES); + + if (INSN_CODE (insn) < 0) + for (i = 0; i < recog_data.n_alternatives; i++) + recog_data.alternative_enabled_p[i] = true; + else + { + recog_data.insn = insn; + for (i = 0; i < recog_data.n_alternatives; i++) + { + which_alternative = i; + recog_data.alternative_enabled_p[i] = get_attr_enabled (insn); + } + } + + recog_data.insn = NULL; + which_alternative = -1; } /* After calling extract_insn, you can use this function to extract some @@ -2033,6 +2055,12 @@ preprocess_constraints (void) op_alt[j].matches = -1; op_alt[j].matched = -1; + if (!recog_data.alternative_enabled_p[j]) + { + p = skip_alternative (p); + continue; + } + if (*p == '\0' || *p == ',') { op_alt[j].anything_ok = 1; @@ -2202,6 +2230,17 @@ constrain_operands (int strict) int lose = 0; funny_match_index = 0; + if (!recog_data.alternative_enabled_p[which_alternative]) + { + int i; + + for (i = 0; i < recog_data.n_operands; i++) + constraints[i] = skip_alternative (constraints[i]); + + which_alternative++; + continue; + } + for (opno = 0; opno < recog_data.n_operands; opno++) { rtx op = recog_data.operand[opno]; |