318 MatchRule &mrule = *instr->_matrule; 319 Predicate *pred = instr->build_predicate(); 320 321 // Grab the machine type of the operand 322 const char *rootOp = instr->_ident; 323 mrule._machType = rootOp; 324 325 // Cost for this match 326 const char *costStr = instr->cost(); 327 const char *defaultCost = 328 ((AttributeForm*)_globalNames[AttributeForm::_ins_cost])->_attrdef; 329 const char *cost = costStr? costStr : defaultCost; 330 331 // Find result type for match 332 const char *result = instr->reduce_result(); 333 334 Attribute *attr = instr->_attribs; 335 while (attr != NULL) { 336 if (strcmp(attr->_ident,"ins_short_branch") == 0 && 337 attr->int_val(*this) != 0) { 338 instr->set_short_branch(true); 339 } else if (strcmp(attr->_ident,"ins_alignment") == 0 && 340 attr->int_val(*this) != 0) { 341 instr->set_alignment(attr->int_val(*this)); 342 } 343 attr = (Attribute *)attr->_next; 344 } 345 346 if (!instr->is_short_branch()) { 347 buildMatchList(instr->_matrule, result, mrule._machType, pred, cost); 348 } 349 } 350 } 351 352 static int setsResult(MatchRule &mrule) { 353 if (strcmp(mrule._name,"Set") == 0) return 1; 354 return 0; 355 } 356 357 const char *ArchDesc::getMatchListIndex(MatchRule &mrule) { | 318 MatchRule &mrule = *instr->_matrule; 319 Predicate *pred = instr->build_predicate(); 320 321 // Grab the machine type of the operand 322 const char *rootOp = instr->_ident; 323 mrule._machType = rootOp; 324 325 // Cost for this match 326 const char *costStr = instr->cost(); 327 const char *defaultCost = 328 ((AttributeForm*)_globalNames[AttributeForm::_ins_cost])->_attrdef; 329 const char *cost = costStr? costStr : defaultCost; 330 331 // Find result type for match 332 const char *result = instr->reduce_result(); 333 334 Attribute *attr = instr->_attribs; 335 while (attr != NULL) { 336 if (strcmp(attr->_ident,"ins_short_branch") == 0 && 337 attr->int_val(*this) != 0) { 338 if (!instr->is_ideal_branch() || instr->label_position() == -1) { 339 syntax_err(instr->_linenum, "%s: Only short branch to a label is supported\n", rootOp); 340 } 341 instr->set_short_branch(true); 342 } else if (strcmp(attr->_ident,"ins_alignment") == 0 && 343 attr->int_val(*this) != 0) { 344 instr->set_alignment(attr->int_val(*this)); 345 } 346 attr = (Attribute *)attr->_next; 347 } 348 349 if (!instr->is_short_branch()) { 350 buildMatchList(instr->_matrule, result, mrule._machType, pred, cost); 351 } 352 } 353 } 354 355 static int setsResult(MatchRule &mrule) { 356 if (strcmp(mrule._name,"Set") == 0) return 1; 357 return 0; 358 } 359 360 const char *ArchDesc::getMatchListIndex(MatchRule &mrule) { |