Mercurial > hg > truffle
comparison src/share/vm/adlc/output_c.cpp @ 415:4d9884b01ba6
6754519: don't emit flag fixup for NaN when condition being tested doesn't need it
Reviewed-by: kvn, rasbold
author | never |
---|---|
date | Tue, 28 Oct 2008 09:31:30 -0700 |
parents | d1605aabd0a1 |
children | dbbe28fc66b5 |
comparison
equal
deleted
inserted
replaced
407:ebfd4ae89bf6 | 415:4d9884b01ba6 |
---|---|
1617 fprintf(fp," n%d->add_req(_in[1]);\t// Add memory edge\n", cnt); | 1617 fprintf(fp," n%d->add_req(_in[1]);\t// Add memory edge\n", cnt); |
1618 } | 1618 } |
1619 } | 1619 } |
1620 | 1620 |
1621 // Iterate over the new instruction's operands | 1621 // Iterate over the new instruction's operands |
1622 int prev_pos = -1; | |
1622 for( expand_instr->reset(); (opid = expand_instr->iter()) != NULL; ) { | 1623 for( expand_instr->reset(); (opid = expand_instr->iter()) != NULL; ) { |
1623 // Use 'parameter' at current position in list of new instruction's formals | 1624 // Use 'parameter' at current position in list of new instruction's formals |
1624 // instead of 'opid' when looking up info internal to new_inst | 1625 // instead of 'opid' when looking up info internal to new_inst |
1625 const char *parameter = formal_lst->iter(); | 1626 const char *parameter = formal_lst->iter(); |
1626 // Check for an operand which is created in the expand rule | 1627 // Check for an operand which is created in the expand rule |
1640 else { | 1641 else { |
1641 // Use operand name to get an index into instruction component list | 1642 // Use operand name to get an index into instruction component list |
1642 // ins = (InstructForm *) _globalNames[new_id]; | 1643 // ins = (InstructForm *) _globalNames[new_id]; |
1643 exp_pos = node->operand_position_format(opid); | 1644 exp_pos = node->operand_position_format(opid); |
1644 assert(exp_pos != -1, "Bad expand rule"); | 1645 assert(exp_pos != -1, "Bad expand rule"); |
1646 if (prev_pos > exp_pos && expand_instruction->_matrule != NULL) { | |
1647 // For the add_req calls below to work correctly they need | |
1648 // to added in the same order that a match would add them. | |
1649 // This means that they would need to be in the order of | |
1650 // the components list instead of the formal parameters. | |
1651 // This is a sort of hidden invariant that previously | |
1652 // wasn't checked and could lead to incorrectly | |
1653 // constructed nodes. | |
1654 syntax_err(node->_linenum, "For expand in %s to work, parameter declaration order in %s must follow matchrule\n", | |
1655 node->_ident, new_inst->_ident); | |
1656 } | |
1657 prev_pos = exp_pos; | |
1645 | 1658 |
1646 new_pos = new_inst->operand_position(parameter,Component::USE); | 1659 new_pos = new_inst->operand_position(parameter,Component::USE); |
1647 if (new_pos != -1) { | 1660 if (new_pos != -1) { |
1648 // Copy the operand from the ExpandNode to the new node | 1661 // Copy the operand from the ExpandNode to the new node |
1649 fprintf(fp," n%d->set_opnd_array(%d, opnd_array(%d)->clone(C)); // %s\n", | 1662 fprintf(fp," n%d->set_opnd_array(%d, opnd_array(%d)->clone(C)); // %s\n", |
2304 | 2317 |
2305 void emit_rep_var(const char *rep_var) { | 2318 void emit_rep_var(const char *rep_var) { |
2306 _processing_noninput = false; | 2319 _processing_noninput = false; |
2307 // A replacement variable, originally '$' | 2320 // A replacement variable, originally '$' |
2308 if ( Opcode::as_opcode_type(rep_var) != Opcode::NOT_AN_OPCODE ) { | 2321 if ( Opcode::as_opcode_type(rep_var) != Opcode::NOT_AN_OPCODE ) { |
2309 _inst._opcode->print_opcode(_fp, Opcode::as_opcode_type(rep_var) ); | 2322 if (!_inst._opcode->print_opcode(_fp, Opcode::as_opcode_type(rep_var) )) { |
2323 // Missing opcode | |
2324 _AD.syntax_err( _inst._linenum, | |
2325 "Missing $%s opcode definition in %s, used by encoding %s\n", | |
2326 rep_var, _inst._ident, _encoding._name); | |
2327 } | |
2310 } | 2328 } |
2311 else { | 2329 else { |
2312 // Lookup its position in parameter list | 2330 // Lookup its position in parameter list |
2313 int param_no = _encoding.rep_var_index(rep_var); | 2331 int param_no = _encoding.rep_var_index(rep_var); |
2314 if ( param_no == -1 ) { | 2332 if ( param_no == -1 ) { |
2346 _constant_status = LITERAL_OUTPUT; | 2364 _constant_status = LITERAL_OUTPUT; |
2347 } | 2365 } |
2348 else if( Opcode::as_opcode_type(inst_rep_var) != Opcode::NOT_AN_OPCODE ) { | 2366 else if( Opcode::as_opcode_type(inst_rep_var) != Opcode::NOT_AN_OPCODE ) { |
2349 // else check if "primary", "secondary", "tertiary" | 2367 // else check if "primary", "secondary", "tertiary" |
2350 assert( _constant_status == LITERAL_ACCESSED, "Must be processing a literal constant parameter"); | 2368 assert( _constant_status == LITERAL_ACCESSED, "Must be processing a literal constant parameter"); |
2351 _inst._opcode->print_opcode(_fp, Opcode::as_opcode_type(inst_rep_var) ); | 2369 if (!_inst._opcode->print_opcode(_fp, Opcode::as_opcode_type(inst_rep_var) )) { |
2370 // Missing opcode | |
2371 _AD.syntax_err( _inst._linenum, | |
2372 "Missing $%s opcode definition in %s\n", | |
2373 rep_var, _inst._ident); | |
2374 | |
2375 } | |
2352 _constant_status = LITERAL_OUTPUT; | 2376 _constant_status = LITERAL_OUTPUT; |
2353 } | 2377 } |
2354 else if((_AD.get_registers() != NULL ) && (_AD.get_registers()->getRegDef(inst_rep_var) != NULL)) { | 2378 else if((_AD.get_registers() != NULL ) && (_AD.get_registers()->getRegDef(inst_rep_var) != NULL)) { |
2355 // Instruction provided a literal register name for this parameter | 2379 // Instruction provided a literal register name for this parameter |
2356 // Check that encoding specifies $$$reg to resolve.as register. | 2380 // Check that encoding specifies $$$reg to resolve.as register. |