Lines Matching refs:fp

32 static void defineRegCount(FILE *fp, RegisterForm *registers) {
35 fprintf(fp,"\n");
36 fprintf(fp,"// the number of reserved registers + machine registers.\n");
37 fprintf(fp,"#define REG_COUNT %d\n", regCount);
158 static void declareRegNames(FILE *fp, RegisterForm *registers) {
160 // fprintf(fp,"\n");
161 // fprintf(fp,"// An array of character pointers to machine register names.\n");
162 // fprintf(fp,"extern const char *regName[];\n");
167 void ArchDesc::declareRegSizes(FILE *fp) {
172 static void declareRegEncodes(FILE *fp, RegisterForm *registers) {
175 // fprintf(fp,"\n");
176 // fprintf(fp,"// An array containing the machine register encode values\n");
177 // fprintf(fp,"extern const char regEncode[];\n");
185 static void out_RegMask(FILE *fp) {
186 fprintf(fp," virtual const RegMask &out_RegMask() const;\n");
194 static void in_RegMask(FILE *fp) {
195 fprintf(fp," virtual const RegMask *in_RegMask(int index) const;\n");
198 static void declareConstStorage(FILE *fp, FormDict &globals, OperandForm *oper) {
209 if (i > 0) fprintf(fp,", ");
210 fprintf(fp," int32 _c%d;\n", i);
213 if (i > 0) fprintf(fp,", ");
214 fprintf(fp," const TypePtr *_c%d;\n", i);
217 if (i > 0) fprintf(fp,", ");
218 fprintf(fp," const TypeNarrowOop *_c%d;\n", i);
221 if (i > 0) fprintf(fp,", ");
222 fprintf(fp," jlong _c%d;\n", i);
225 if (i > 0) fprintf(fp,", ");
226 fprintf(fp," jfloat _c%d;\n", i);
229 if (i > 0) fprintf(fp,", ");
230 fprintf(fp," jdouble _c%d;\n", i);
233 fprintf(fp,"private:\n");
234 fprintf(fp," BoolTest::mask _c%d;\n", i);
235 fprintf(fp,"public:\n");
245 fprintf(fp," jint _c%d;\n", i);
249 fprintf(fp," const TypePtr *_c%d;\n", i);
253 fprintf(fp," const TypePtr *_c%d;\n", i);
257 fprintf(fp," jlong _c%d;\n", i);
261 fprintf(fp," jfloat _c%d;\n", i);
265 fprintf(fp," jdouble _c%d;\n", i);
279 static void defineConstructor(FILE *fp, const char *name, uint num_consts,
282 fprintf(fp,"public:\n");
284 fprintf(fp," %sOper(", name);
286 fprintf(fp,") {}\n");
298 fprintf(fp,is_ideal_bool ? "BoolTest::mask c%d" : "int32 c%d", i);
301 case Form::idealN : { fprintf(fp,"const TypeNarrowOop *c%d", i); break; }
302 case Form::idealP : { fprintf(fp,"const TypePtr *c%d", i); break; }
303 case Form::idealL : { fprintf(fp,"jlong c%d", i); break; }
304 case Form::idealF : { fprintf(fp,"jfloat c%d", i); break; }
305 case Form::idealD : { fprintf(fp,"jdouble c%d", i); break; }
315 if (i > 0) fprintf(fp,", ");
316 fprintf(fp,"int32 c%d", i);
320 if (i > 0) fprintf(fp,", ");
321 fprintf(fp,"const TypePtr *c%d", i);
325 if (i > 0) fprintf(fp,", ");
326 fprintf(fp,"const TypePtr *c%d", i);
330 if (i > 0) fprintf(fp,", ");
331 fprintf(fp,"jlong c%d", i);
335 if (i > 0) fprintf(fp,", ");
336 fprintf(fp,"jfloat c%d", i);
340 if (i > 0) fprintf(fp,", ");
341 fprintf(fp,"jdouble c%d", i);
345 if (i > 0) fprintf(fp,", ");
346 fprintf(fp,"BoolTest::mask c%d", i);
352 fprintf(fp,") : ");
355 fprintf(fp,"_c%d(c%d)", i, i);
357 fprintf(fp,", _c%d(c%d)", i, i);
360 fprintf(fp," {}\n");
368 static void defineCCodeDump(OperandForm* oper, FILE *fp, int i) {
371 fprintf(fp, " if( _c%d == BoolTest::eq ) st->print(\"%s\");\n",i,cond->_equal_format);
372 fprintf(fp, " else if( _c%d == BoolTest::ne ) st->print(\"%s\");\n",i,cond->_not_equal_format);
373 fprintf(fp, " else if( _c%d == BoolTest::le ) st->print(\"%s\");\n",i,cond->_less_equal_format);
374 fprintf(fp, " else if( _c%d == BoolTest::ge ) st->print(\"%s\");\n",i,cond->_greater_equal_format);
375 fprintf(fp, " else if( _c%d == BoolTest::lt ) st->print(\"%s\");\n",i,cond->_less_format);
376 fprintf(fp, " else if( _c%d == BoolTest::gt ) st->print(\"%s\");\n",i,cond->_greater_format);
380 static uint dump_spec_constant(FILE *fp, const char *ideal_type, uint i, OperandForm* oper) {
382 fprintf(fp," st->print(\"#%%d\", _c%d);\n", i);
383 fprintf(fp," st->print(\"/0x%%08x\", _c%d);\n", i);
387 fprintf(fp," _c%d->dump_on(st);\n", i);
391 fprintf(fp," _c%d->dump_on(st);\n", i);
395 fprintf(fp," st->print(\"#\" INT64_FORMAT, _c%d);\n", i);
396 fprintf(fp," st->print(\"/\" PTR64_FORMAT, _c%d);\n", i);
400 fprintf(fp," st->print(\"#%%f\", _c%d);\n", i);
401 fprintf(fp," jint _c%di = JavaValue(_c%d).get_jint();\n", i, i);
402 fprintf(fp," st->print(\"/0x%%x/\", _c%di);\n", i);
406 fprintf(fp," st->print(\"#%%f\", _c%d);\n", i);
407 fprintf(fp," jlong _c%dl = JavaValue(_c%d).get_jlong();\n", i, i);
408 fprintf(fp," st->print(\"/\" PTR64_FORMAT, _c%dl);\n", i);
412 defineCCodeDump(oper, fp,i);
420 void gen_oper_format(FILE *fp, FormDict &globals, OperandForm &oper, bool for_c_file = false) {
424 fprintf(fp," virtual void int_format(PhaseRegAlloc *ra, const MachNode *node, outputStream *st) const;\n");
425 fprintf(fp," virtual void ext_format(PhaseRegAlloc *ra, const MachNode *node, int idx, outputStream *st) const;\n");
433 fprintf(fp, "\n#ifndef PRODUCT\n");
434 fprintf(fp,"void %sOper::int_format(PhaseRegAlloc *ra, const MachNode *node, outputStream *st) const {\n", oper._ident);
450 fprintf(fp," st->print(\"%s\");\n", string);
473 if ( op != NULL ) op->int_format(fp, globals, idx);
484 oper.int_format(fp, globals, 0);
490 fprintf(fp, " st->print(\"$$univ\");\n");
496 defineCCodeDump(&oper, fp,0);
498 fprintf(fp,"}\n");
501 fprintf(fp,"void %sOper::ext_format(PhaseRegAlloc *ra, const MachNode *node, int idx, outputStream *st) const {\n", oper._ident);
521 fprintf(fp," st->print(\"%s\");\n", string);
543 if ( op != NULL ) op->ext_format(fp, globals, idx);
557 oper.ext_format(fp, globals, 0);
562 fprintf(fp, " st->print(\"$$univ\");\n");
568 defineCCodeDump(&oper, fp,0);
570 fprintf(fp, "}\n");
571 fprintf(fp, "#endif\n");
576 void gen_inst_format(FILE *fp, FormDict &globals, InstructForm &inst, bool for_c_file = false) {
580 fprintf(fp," virtual void format(PhaseRegAlloc *ra, outputStream *st) const;\n");
585 fprintf(fp, "#ifndef PRODUCT\n");
586 fprintf(fp, "void %sNode::format(PhaseRegAlloc *ra, outputStream *st) const {\n", inst._ident);
593 inst.index_temps(fp, globals);
600 fprintf(fp," ");
604 inst.rep_var_format( fp, rep_var);
625 fprintf(fp,"opnd_array(%d)",idx);
632 fprintf(fp,"->constantD()");
634 fprintf(fp,"->constantF()");
636 fprintf(fp,"->constantL()");
638 fprintf(fp,"->constant()");
641 fprintf(fp,"->ccode()");
646 fputs(inst._format->_strings.iter(), fp);
648 fprintf(fp,"st->print(\"%s\");\n", string);
657 fprintf(fp," _method->print_short_name(st);\n");
660 fprintf(fp," if( _method ) _method->print_short_name(st);\n");
661 fprintf(fp," else st->print(\" wrapper for: %%s\", _name);\n");
662 fprintf(fp," if( !_method ) dump_trap_args(st);\n");
670 fprintf(fp," st->print(\" %%s\", _name);");
675 fprintf(fp, " st->print_cr(\"\");\n" );
676 fprintf(fp, " if (_jvms) _jvms->format(ra, this, st); else st->print_cr(\" No JVM State Info\");\n" );
677 fprintf(fp, " st->print(\" # \");\n" );
678 fprintf(fp, " if( _jvms && _oop_map ) _oop_map->print_on(st);\n");
681 fprintf(fp, " st->print(\"\");\n" );
682 fprintf(fp, " if (_jvms) _jvms->format(ra, this, st); else st->print_cr(\" No JVM State Info\");\n" );
683 fprintf(fp, " st->print(\" # \");\n" );
684 fprintf(fp, " if( _jvms && _oop_map ) _oop_map->print_on(st);\n");
687 fprintf(fp, " st->print(\" P=%%f C=%%f\",_prob,_fcnt);\n" );
691 fprintf(fp, " if (ra->C->alias_type(adr_type())->field() != NULL) {\n");
692 fprintf(fp, " ciField* f = ra->C->alias_type(adr_type())->field();\n");
693 fprintf(fp, " st->print(\" %s Field: \");\n", commentSeperator);
694 fprintf(fp, " if (f->is_volatile())\n");
695 fprintf(fp, " st->print(\"volatile \");\n");
696 fprintf(fp, " f->holder()->name()->print_symbol_on(st);\n");
697 fprintf(fp, " st->print(\".\");\n");
698 fprintf(fp, " f->name()->print_symbol_on(st);\n");
699 fprintf(fp, " if (f->is_constant())\n");
700 fprintf(fp, " st->print(\" (constant)\");\n");
701 fprintf(fp, " } else {\n");
703 fprintf(fp, " if (ra->C->alias_type(adr_type())->is_volatile())\n");
704 fprintf(fp, " st->print(\" volatile!\");\n");
705 fprintf(fp, " }\n");
709 fprintf(fp, "}\n#endif\n");
1115 void ArchDesc::declareClasses(FILE *fp) {
1118 declareRegNames(fp, _register);
1121 declareRegEncodes(fp, _register);
1124 fprintf(fp,"\n");
1125 fprintf(fp,"// Total number of operands defined in architecture definition\n");
1142 fprintf(fp,"#define FIRST_OPERAND_CLASS %d\n", first_operand_class);
1143 fprintf(fp,"#define NUM_OPERANDS %d\n", num_operands);
1144 fprintf(fp,"\n");
1146 fprintf(fp,"// Total number of instructions defined in architecture definition\n");
1147 fprintf(fp,"#define NUM_INSTRUCTIONS %d\n",instructFormCount());
1151 fprintf(fp,"\n");
1152 fprintf(fp,"//----------------------------Declare classes derived from MachOper----------\n");
1165 fprintf(fp,"\n");
1166 fprintf(fp,"class %sOper : public MachOper { \n",oper->_ident);
1167 fprintf(fp,"private:\n");
1172 fprintf(fp," virtual uint num_edges() const { return %d; }\n",
1176 in_RegMask(fp);
1181 declareConstStorage(fp,_globalNames,oper);
1185 fprintf(fp," virtual int ccode() const { \n");
1186 fprintf(fp," switch (_c0) {\n");
1187 fprintf(fp," case BoolTest::eq : return equal();\n");
1188 fprintf(fp," case BoolTest::gt : return greater();\n");
1189 fprintf(fp," case BoolTest::lt : return less();\n");
1190 fprintf(fp," case BoolTest::ne : return not_equal();\n");
1191 fprintf(fp," case BoolTest::le : return less_equal();\n");
1192 fprintf(fp," case BoolTest::ge : return greater_equal();\n");
1193 fprintf(fp," default : ShouldNotReachHere(); return 0;\n");
1194 fprintf(fp," }\n");
1195 fprintf(fp," };\n");
1200 fprintf(fp," virtual void negate() { \n");
1201 fprintf(fp," _c0 = (BoolTest::mask)((int)_c0^0x4); \n");
1202 fprintf(fp," };\n");
1212 defineConstructor(fp, oper->_ident, oper->num_consts(_globalNames),
1217 fprintf(fp," virtual MachOper *clone(Compile* C) const;\n");
1226 fprintf(fp, " virtual void set_con( jint c0 ) { _c0 = c0; }\n");
1229 // fprintf(fp," virtual void encode() const {\n %s }\n",
1234 fprintf(fp," virtual uint opcode() const { return %s; }\n",
1246 fprintf(fp," virtual const Type *type() const {");
1253 fprintf(fp," return _c0;");
1256 fprintf(fp," return %s;", getIdealType(optype));
1259 fprintf(fp," ShouldNotCallThis(); return Type::BOTTOM;");
1261 fprintf(fp," }\n");
1277 fprintf(fp," virtual const Type *type() const { return %s; } // stackSlotX\n", type);
1292 fprintf(fp," virtual int reg(PhaseRegAlloc *ra_, const Node *node) const {\n");
1293 fprintf(fp," return (int)OptoReg::reg2stack(ra_->get_reg_first(node));/* sReg */\n");
1294 fprintf(fp," }\n");
1295 fprintf(fp," virtual int reg(PhaseRegAlloc *ra_, const Node *node, int idx) const {\n");
1296 fprintf(fp," return (int)OptoReg::reg2stack(ra_->get_reg_first(node->in(idx)));/* sReg */\n");
1297 fprintf(fp," }\n");
1303 fprintf(fp,"\n");
1309 define_oper_interface(fp, *oper, _globalNames, "base", base);
1313 define_oper_interface(fp, *oper, _globalNames, "index", index);
1317 define_oper_interface(fp, *oper, _globalNames, "scale", scale);
1321 define_oper_interface(fp, *oper, _globalNames, "disp", disp);
1322 oper->disp_is_oop(fp, _globalNames);
1326 fprintf(fp," virtual int constant_disp() const { return Type::OffsetBot; }");
1328 define_oper_interface(fp, *oper, _globalNames, "constant_disp", disp);
1336 define_oper_interface(fp, *oper, _globalNames, "equal", equal);
1340 define_oper_interface(fp, *oper, _globalNames, "not_equal", not_equal);
1344 define_oper_interface(fp, *oper, _globalNames, "less", less);
1348 define_oper_interface(fp, *oper, _globalNames, "greater_equal", greater_equal);
1352 define_oper_interface(fp, *oper, _globalNames, "less_equal", less_equal);
1356 define_oper_interface(fp, *oper, _globalNames, "greater", greater);
1365 fprintf(fp," virtual intptr_t constant() const {");
1366 fprintf(fp, " return (intptr_t)_c0;");
1367 fprintf(fp," }\n");
1371 fprintf(fp," virtual intptr_t constant() const {");
1372 fprintf(fp, " return _c0->get_con();");
1373 fprintf(fp, " }\n");
1375 fprintf(fp," virtual bool constant_is_oop() const {");
1376 fprintf(fp, " return _c0->isa_oop_ptr();");
1377 fprintf(fp, " }\n");
1381 fprintf(fp," virtual intptr_t constant() const {");
1382 fprintf(fp, " return _c0->get_ptrtype()->get_con();");
1383 fprintf(fp, " }\n");
1385 fprintf(fp," virtual bool constant_is_oop() const {");
1386 fprintf(fp, " return _c0->get_ptrtype()->isa_oop_ptr();");
1387 fprintf(fp, " }\n");
1390 fprintf(fp," virtual intptr_t constant() const {");
1393 fprintf(fp, " return (intptr_t)_c0;");
1394 fprintf(fp, " }\n");
1395 fprintf(fp," virtual jlong constantL() const {");
1396 fprintf(fp, " return _c0;");
1397 fprintf(fp, " }\n");
1400 fprintf(fp," virtual intptr_t constant() const {");
1401 fprintf(fp, " ShouldNotReachHere(); return 0; ");
1402 fprintf(fp, " }\n");
1403 fprintf(fp," virtual jfloat constantF() const {");
1404 fprintf(fp, " return (jfloat)_c0;");
1405 fprintf(fp, " }\n");
1408 fprintf(fp," virtual intptr_t constant() const {");
1409 fprintf(fp, " ShouldNotReachHere(); return 0; ");
1410 fprintf(fp, " }\n");
1411 fprintf(fp," virtual jdouble constantD() const {");
1412 fprintf(fp, " return _c0;");
1413 fprintf(fp, " }\n");
1431 fprintf(fp,"\n");
1433 // declare_hash(fp);
1435 // declare_cmp(fp);
1439 fprintf(fp, "#ifndef PRODUCT\n");
1442 gen_oper_format(fp, _globalNames, *oper);
1455 fprintf(fp, " virtual void dump_spec(outputStream *st) const {\n");
1464 i = dump_spec_constant( fp, type, i, oper );
1474 i = dump_spec_constant( fp, type, i, NULL );
1478 fprintf(fp," }\n");
1481 fprintf(fp," virtual const char *Name() const { return \"%s\";}\n",
1484 fprintf(fp,"#endif\n");
1487 fprintf(fp,"};\n");
1492 fprintf(fp,"\n");
1493 fprintf(fp,"//----------------------------Declare classes for Pipelines-----------------\n");
1494 declare_pipe_classes(fp);
1497 fprintf(fp,"\n");
1498 fprintf(fp,"//----------------------------Declare classes derived from MachNode----------\n");
1506 fprintf(fp,"\n");
1507 fprintf(fp,"class %sNode : public %s { \n",
1509 fprintf(fp,"private:\n");
1510 fprintf(fp," MachOper *_opnd_array[%d];\n", instr->num_opnds() );
1512 fprintf(fp, " GrowableArray<Label*> _index2label;\n");
1514 fprintf(fp,"public:\n");
1515 fprintf(fp," MachOper *opnd_array(uint operand_index) const {\n");
1516 fprintf(fp," assert(operand_index < _num_opnds, \"invalid _opnd_array index\");\n");
1517 fprintf(fp," return _opnd_array[operand_index];\n");
1518 fprintf(fp," }\n");
1519 fprintf(fp," void set_opnd_array(uint operand_index, MachOper *operand) {\n");
1520 fprintf(fp," assert(operand_index < _num_opnds, \"invalid _opnd_array index\");\n");
1521 fprintf(fp," _opnd_array[operand_index] = operand;\n");
1522 fprintf(fp," }\n");
1523 fprintf(fp,"private:\n");
1525 fprintf(fp," virtual void add_case_label(int index_num, Label* blockLabel) {\n");
1526 fprintf(fp," _index2label.at_put_grow(index_num, blockLabel);\n");
1527 fprintf(fp," }\n");
1530 fprintf(fp," const RegMask *_cisc_RegMask;\n");
1533 out_RegMask(fp); // output register mask
1534 fprintf(fp," virtual uint rule() const { return %s_rule; }\n",
1542 fprintf(fp," virtual void label_set( Label* label, uint block_num );\n");
1543 fprintf(fp," virtual void save_label( Label** label, uint* block_num );\n");
1551 fprintf(fp," virtual void method_set( intptr_t method );\n");
1563 fprintf(fp," int %s() const { return %s; }\n",
1576 fprintf(fp," virtual void eval_constant(Compile* C);\n");
1582 fprintf(fp," virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const;\n");
1587 fprintf(fp," virtual uint size(PhaseRegAlloc *ra_) const;\n");
1595 fprintf(fp," virtual int ideal_Opcode() const { return Op_%s; }\n",
1601 fprintf(fp," virtual void negate() { \n");
1618 fprintf(fp," opnd_array(%d)->negate();\n", idx);
1619 fprintf(fp," _prob = 1.0f - _prob;\n");
1620 fprintf(fp," };\n");
1629 fprintf(fp," virtual uint two_adr() const ");
1630 fprintf(fp,"{ return oper_input_base()");
1632 fprintf(fp," + opnd_array(%d)->num_edges()",i-1);
1633 fprintf(fp,"; }\n");
1638 instr->declare_cisc_version(*this, fp);
1642 fprintf(fp," virtual MachNode *peephole(Block *block, int block_index, PhaseRegAlloc *ra_, int &deleted, Compile *C);\n");
1647 fprintf(fp," virtual int reloc() const;\n");
1651 fprintf(fp," virtual int alignment_required() const { return %d; }\n", instr->alignment());
1652 fprintf(fp," virtual int compute_padding(int current_offset) const;\n");
1660 fprintf(fp," virtual uint oper_input_base() const { return %d; }\n",
1665 fprintf(fp,"public:\n");
1669 fprintf(fp," %sNode() : _index2label(MinJumpTableSize*2) { ", instr->_ident);
1671 fprintf(fp," %sNode() { ", instr->_ident);
1673 fprintf(fp,"_cisc_RegMask = NULL; ");
1677 fprintf(fp," _num_opnds = %d; _opnds = _opnd_array; ", instr->num_opnds());
1682 fprintf(fp,"init_flags(Flag_is_Copy");
1694 fprintf(fp," | Flag_is_Con");
1696 fprintf(fp,"init_flags(Flag_is_Con");
1704 fprintf(fp," | Flag_is_cisc_alternate");
1706 fprintf(fp,"init_flags(Flag_is_cisc_alternate");
1714 fprintf(fp," | Flag_may_be_short_branch");
1716 fprintf(fp,"init_flags(Flag_may_be_short_branch");
1724 fprintf(fp," | Flag_avoid_back_to_back");
1726 fprintf(fp,"init_flags(Flag_avoid_back_to_back");
1735 fprintf(fp," | Flag_needs_anti_dependence_check");
1737 fprintf(fp,"init_flags(Flag_needs_anti_dependence_check");
1745 fprintf(fp," | Flag_has_call");
1747 fprintf(fp,"init_flags(Flag_has_call");
1753 fprintf(fp,"); ");
1756 fprintf(fp,"}\n");
1759 fprintf(fp," virtual uint size_of() const {");
1760 fprintf(fp, " return sizeof(%sNode);", instr->_ident);
1761 fprintf(fp, " }\n");
1769 fprintf(fp," virtual MachNode *Expand(State *state, Node_List &proj_list, Node* mem);\n");
1773 fprintf(fp," virtual bool pinned() const { return ");
1775 fprintf(fp,"_in[0]->pinned();");
1777 fprintf(fp,"true;");
1779 fprintf(fp," }\n");
1782 fprintf(fp," virtual const Node *is_block_proj() const { return this; }\n");
1786 fprintf(fp," friend MachNode *State::MachNodeGenerator(int opcode, Compile* C);\n");
1789 fprintf(fp," // Rematerialize %s\n", instr->_ident);
1793 instr->declare_short_branch_methods(fp);
1797 fprintf(fp," static const Pipeline *pipeline_class();\n");
1798 fprintf(fp," virtual const Pipeline *pipeline() const;\n");
1822 fprintf(fp," virtual const class Type *bottom_type() const {\n");
1825 fprintf(fp," return TypeInt::make(opnd_array(1)->constant());\n");
1829 fprintf(fp," return opnd_array(1)->type();\n");
1832 fprintf(fp," return TypeD::make(opnd_array(1)->constantD());\n");
1835 fprintf(fp," return TypeF::make(opnd_array(1)->constantF());\n");
1838 fprintf(fp," return TypeLong::make(opnd_array(1)->constantL());\n");
1844 fprintf(fp," };\n");
1852 fprintf(fp," virtual const class Type *bottom_type() const {");
1853 fprintf(fp, " return TypeInt::INT;");
1854 fprintf(fp, " };\n");
1860 fprintf(fp," const Type *bottom_type() const { return in(1)->bottom_type(); } // Copy?\n");
1867 fprintf(fp," const Type *bottom_type() const { return TypeRawPtr::BOTTOM; } // LoadPC?\n");
1875 fprintf(fp," const Type *bottom_type() const { return TypeRawPtr::BOTTOM; } // Box?\n");
1887 fprintf(fp," const Type *bottom_type() const { const Type *t = in(oper_input_base()+%d)->bottom_type(); return (req() <= oper_input_base()+%d) ? t : t->meet(in(oper_input_base()+%d)->bottom_type()); } // CMoveP\n",
1900 fprintf(fp," const Type *bottom_type() const { const Type *t = in(oper_input_base()+%d)->bottom_type(); return (req() <= oper_input_base()+%d) ? t : t->meet(in(oper_input_base()+%d)->bottom_type()); } // CMoveN\n",
1905 fprintf(fp," const Type *bottom_type() const { return TypeRawPtr::BOTTOM; } // tlsLoadP\n");
1908 fprintf(fp," const Type *bottom_type() const { return TypeTuple::IFBOTH; } // matched IfNode\n");
1911 fprintf(fp," const Type *bottom_type() const { return TypeTuple::MEMBAR; } // matched MemBar\n");
1919 fprintf(fp," virtual uint ideal_reg() const { return Compile::current()->matcher()->base2reg[Type::Int]; }\n");
1930 fprintf(fp," virtual const TypePtr *adr_type() const;\n");
1932 fprintf(fp," virtual const MachOper *memory_operand() const;\n");
1935 fprintf(fp, "#ifndef PRODUCT\n");
1938 gen_inst_format(fp, _globalNames,*instr);
1941 fprintf(fp," virtual const char *Name() const { return \"%s\";}\n",
1944 fprintf(fp, "#endif\n");
1947 fprintf(fp,"};\n");
1952 void ArchDesc::defineStateClass(FILE *fp) {
1956 fprintf(fp,"\n");
1957 fprintf(fp,"// MACROS to inline and constant fold State::valid(index)...\n");
1958 fprintf(fp,"// when given a constant 'index' in dfa_<arch>.cpp\n");
1959 fprintf(fp,"// uint word = index >> 5; // Shift out bit position\n");
1960 fprintf(fp,"// uint bitpos = index & 0x0001F; // Mask off word bits\n");
1961 fprintf(fp,"#define STATE__VALID(index) ");
1962 fprintf(fp," (%s)\n", state__valid);
1963 fprintf(fp,"\n");
1964 fprintf(fp,"#define STATE__NOT_YET_VALID(index) ");
1965 fprintf(fp," ( (%s) == 0 )\n", state__valid);
1966 fprintf(fp,"\n");
1967 fprintf(fp,"#define STATE__VALID_CHILD(state,index) ");
1968 fprintf(fp," ( state && (state->%s) )\n", state__valid);
1969 fprintf(fp,"\n");
1970 fprintf(fp,"#define STATE__SET_VALID(index) ");
1971 fprintf(fp," (%s)\n", state__set_valid);
1972 fprintf(fp,"\n");
1973 fprintf(fp,
1975 fprintf(fp,"// State contains an integral cost vector, indexed by machine operand opcodes,\n");
1976 fprintf(fp,"// a rule vector consisting of machine operand/instruction opcodes, and also\n");
1977 fprintf(fp,"// indexed by machine operand opcodes, pointers to the children in the label\n");
1978 fprintf(fp,"// tree generated by the Label routines in ideal nodes (currently limited to\n");
1979 fprintf(fp,"// two for convenience, but this could change).\n");
1980 fprintf(fp,"class State : public ResourceObj {\n");
1981 fprintf(fp,"public:\n");
1982 fprintf(fp," int _id; // State identifier\n");
1983 fprintf(fp," Node *_leaf; // Ideal (non-machine-node) leaf of match tree\n");
1984 fprintf(fp," State *_kids[2]; // Children of state node in label tree\n");
1985 fprintf(fp," unsigned int _cost[_LAST_MACH_OPER]; // Cost vector, indexed by operand opcodes\n");
1986 fprintf(fp," unsigned int _rule[_LAST_MACH_OPER]; // Rule vector, indexed by operand opcodes\n");
1987 fprintf(fp," unsigned int _valid[(_LAST_MACH_OPER/32)+1]; // Bit Map of valid Cost/Rule entries\n");
1988 fprintf(fp,"\n");
1989 fprintf(fp," State(void); // Constructor\n");
1990 fprintf(fp," DEBUG_ONLY( ~State(void); ) // Destructor\n");
1991 fprintf(fp,"\n");
1992 fprintf(fp," // Methods created by ADLC and invoked by Reduce\n");
1993 fprintf(fp," MachOper *MachOperGenerator( int opcode, Compile* C );\n");
1994 fprintf(fp," MachNode *MachNodeGenerator( int opcode, Compile* C );\n");
1995 fprintf(fp,"\n");
1996 fprintf(fp," // Assign a state to a node, definition of method produced by ADLC\n");
1997 fprintf(fp," bool DFA( int opcode, const Node *ideal );\n");
1998 fprintf(fp,"\n");
1999 fprintf(fp," // Access function for _valid bit vector\n");
2000 fprintf(fp," bool valid(uint index) {\n");
2001 fprintf(fp," return( STATE__VALID(index) != 0 );\n");
2002 fprintf(fp," }\n");
2003 fprintf(fp,"\n");
2004 fprintf(fp," // Set function for _valid bit vector\n");
2005 fprintf(fp," void set_valid(uint index) {\n");
2006 fprintf(fp," STATE__SET_VALID(index);\n");
2007 fprintf(fp," }\n");
2008 fprintf(fp,"\n");
2009 fprintf(fp,"#ifndef PRODUCT\n");
2010 fprintf(fp," void dump(); // Debugging prints\n");
2011 fprintf(fp," void dump(int depth);\n");
2012 fprintf(fp,"#endif\n");
2017 fprintf(fp, " void _sub_Op_%s(const Node *n);\n", NodeClassNames[i]);
2020 fprintf(fp,"};\n");
2021 fprintf(fp,"\n");
2022 fprintf(fp,"\n");