Lines Matching defs:rule

147   MatchRule     *rule;
184 rule = instr->_matrule;
185 if (rule == NULL) {
186 // This is first match rule encountered
187 rule = match_parse(instr->_localNames);
188 if (rule) {
189 instr->_matrule = rule;
193 rule->_result = "Universe";
196 matchrule_clone_and_swap(rule, instr->_ident, match_rules_cnt);
199 // Find the end of the match rule list
200 while (rule->_next != NULL)
201 rule = rule->_next;
202 // Add the new match rule to the list
203 rule->_next = match_parse(instr->_localNames);
204 if (rule->_next) {
205 rule = rule->_next;
207 parse_err(SYNERR, "unique match rule expected for %s\n", rule->_name);
210 assert(match_rules_cnt < 100," too many match rule clones");
213 rule->_result = buf;
215 matchrule_clone_and_swap(rule, instr->_ident, match_rules_cnt);
259 // Check for "Set" form of chain rule
264 parse_err(WARN, "ins_pipe and expand rule both specified for instruction \"%s\"; ins_pipe will be unused\n", instr->_ident);
273 // Create instruction form for each additional match rule
274 rule = instr->_matrule;
275 if (rule != NULL) {
276 rule = rule->_next;
277 while (rule != NULL) {
278 ident = (char*)rule->_result;
279 InstructForm *clone = new InstructForm(ident, instr, rule); // Create new instruction form
284 // Check for "Set" form of chain rule
288 rule = rule->_next;
289 clone->_matrule->_next = NULL; // One match rule per clone
297 void ADLParser::matchrule_clone_and_swap(MatchRule* rule, const char* instr_ident, int& match_rules_cnt) {
300 rule->count_commutative_op(count);
302 // Clone match rule and swap commutative operation's operands.
303 rule->matchrule_swap_commutative_op(instr_ident, count, match_rules_cnt);
308 // Check for "Set" form of chain rule
365 // May have instruction chain rule if root of right-tree is an ideal
374 // Look-up the operation in chain rule table
392 } // end chain rule from right-tree's ideal root
403 MatchRule *rule;
438 // Find the end of the match rule list
439 rule = oper->_matrule;
440 if (rule) {
441 while (rule->_next) rule = rule->_next;
442 // Add the new match rule to the list
443 rule->_next = match_parse(oper->_localNames);
444 if (rule->_next) {
445 rule->_next->_result = oper->_ident;
449 // This is first match rule encountered
731 char *rule = NULL; // String representation of encode rule
734 if ( (rule = find_cpp_block("source block")) == NULL ) {
739 if (_AD._adl_debug > 1) fprintf(stderr,"Source Form: %s\n", rule);
741 source = new SourceForm(rule); // Build new Source object
754 char *rule = NULL; // String representation of encode rule
757 if ( (rule = find_cpp_block("source_hpp block")) == NULL ) {
762 if (_AD._adl_debug > 1) fprintf(stderr,"Header Form: %s\n", rule);
766 PreHeaderForm* pre_header = new PreHeaderForm(rule);
770 HeaderForm* header = new HeaderForm(rule);
2074 Peephole *peep; // Pointer to current peephole rule form
2075 char *desc = NULL; // String representation of rule
2088 parse_err(SYNERR, "missing identifier inside peephole rule.\n");
2091 // check for legal subsections of peephole rule
2483 parse_err(SYNERR, "missing identifier in peepmatch rule.\n");
2488 parse_err(SYNERR, "missing identifier in peepmatch rule.\n");
2499 // Syntax for a peepmatch rule
2506 // Check the structure of the rule
2509 parse_err(SYNERR, "missing '(' at start of peepmatch rule.\n");
2514 // Construct PeepMatch and parse the peepmatch rule.
2545 // Syntax for a peepconstraint rule
2559 // Check the structure of the rule
2562 parse_err(SYNERR, "missing '(' at start of peepconstraint rule.\n");
2610 // And append it to the list for this peephole rule
2613 // Check for another constraint, or end of rule
2637 // Syntax for a peepreplace rule
2647 int icount = 0; // count of instructions in rule for naming
2654 parse_err(SYNERR, "missing '(' at start of peepreplace rule.\n");
2670 // Store string representation of rule into replace
2738 char *rule = NULL; // String representation of predicate
2742 if ( (rule = get_paren_expr("pred expression", true)) == NULL ) {
2747 if (_AD._adl_debug > 1) fprintf(stderr,"Predicate: %s\n", rule);
2754 predicate = new Predicate(rule); // Build new predicate object
2791 // Build an encoding rule which invokes the encoding rule we just
2931 char *ec_name = NULL; // String representation of encode rule
3079 // Build an encoding rule which invokes the encoding rule we just
3533 int numleaves = 0; // Counter for number of leaves in rule
3535 // Parse the match rule tree
3545 parse_err(SYNERR, "invalid construction of match rule\n"
3879 parse_err(SYNERR, "Missing ; in expand rule operand declaration\n");
3936 parse_err(SYNERR, "missing '%%}' in expand rule definition\n");
3959 parse_err(SYNERR, "missing '(' in rewrite rule\n");
4028 // one architecture there is a match rule and on another there isn't (so
4112 parse_err(SYNERR, "undefined operand %s in match rule\n", token);