314 315 // Ensure that match field is defined. 316 if ( instr->_matrule == NULL ) continue; 317 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 } | 314 315 // Ensure that match field is defined. 316 if ( instr->_matrule == NULL ) continue; 317 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 if ( instr->is_ideal_branch() && instr->label_position() == -1 || 335 !instr->is_ideal_branch() && instr->label_position() != -1) { 336 syntax_err(instr->_linenum, "%s: Only branches to a label are supported\n", rootOp); 337 } 338 339 Attribute *attr = instr->_attribs; 340 while (attr != NULL) { 341 if (strcmp(attr->_ident,"ins_short_branch") == 0 && 342 attr->int_val(*this) != 0) { 343 if (!instr->is_ideal_branch() || instr->label_position() == -1) { 344 syntax_err(instr->_linenum, "%s: Only short branch to a label is supported\n", rootOp); 345 } 346 instr->set_short_branch(true); 347 } else if (strcmp(attr->_ident,"ins_alignment") == 0 && 348 attr->int_val(*this) != 0) { 349 instr->set_alignment(attr->int_val(*this)); 350 } 351 attr = (Attribute *)attr->_next; 352 } 353 354 if (!instr->is_short_branch()) { 355 buildMatchList(instr->_matrule, result, mrule._machType, pred, cost); 356 } 357 } 358 } |