From 7ac28727fb6149d6e9301e501a94080cb80be27a Mon Sep 17 00:00:00 2001 From: Andreas Krebbel Date: Tue, 27 May 2008 11:46:45 +0000 Subject: reload.c: (find_reloads): Skip alternatives according to the "enabled" attribute. 2008-05-27 Andreas Krebbel * 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 --- gcc/recog.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'gcc/recog.h') diff --git a/gcc/recog.h b/gcc/recog.h index a7e22e6e349..6a2a2caf1da 100644 --- a/gcc/recog.h +++ b/gcc/recog.h @@ -143,6 +143,19 @@ recog_memoized (rtx insn) } #endif +/* Skip chars until the next ',' or the end of the string. This is + useful to skip alternatives in a constraint string. */ +static inline const char * +skip_alternative (const char *p) +{ + const char *r = p; + while (*r != '\0' && *r != ',') + r++; + if (*r == ',') + r++; + return r; +} + /* Nonzero means volatile operands are recognized. */ extern int volatile_ok; @@ -202,6 +215,12 @@ struct recog_data /* The number of alternatives in the constraints for the insn. */ char n_alternatives; + /* Specifies whether an insn alternative is enabled using the + `enabled' attribute in the insn pattern definition. For back + ends not using the `enabled' attribute the array fields are + always set to `true' in expand_insn. */ + bool alternative_enabled_p [MAX_RECOG_ALTERNATIVES]; + /* In case we are caching, hold insn data was generated for. */ rtx insn; }; -- cgit v1.2.1