Lines Matching defs:fp_hpp
50 void ArchDesc::buildMachRegisterNumbers(FILE *fp_hpp) {
55 defineRegCount(fp_hpp, _register);
67 fprintf(fp_hpp, "\n");
68 fprintf(fp_hpp, "// the number of save_on_entry + always_saved registers.\n");
69 fprintf(fp_hpp, "#define MAX_SAVED_ON_ENTRY_REG_COUNT %d\n", max(saved_on_entry,c_saved_on_entry));
70 fprintf(fp_hpp, "#define SAVED_ON_ENTRY_REG_COUNT %d\n", saved_on_entry);
71 fprintf(fp_hpp, "#define C_SAVED_ON_ENTRY_REG_COUNT %d\n", c_saved_on_entry);
75 fprintf(fp_hpp, "\n");
76 fprintf(fp_hpp, "// Enumerate machine register numbers starting after reserved regs.\n");
77 fprintf(fp_hpp, "// in the order of occurrence in the register block.\n");
78 fprintf(fp_hpp, "enum MachRegisterNumbers {\n");
84 fprintf(fp_hpp," %s_num,", reg_def->_regname);
85 for (int j = 0; j < 20-(int)strlen(reg_def->_regname); j++) fprintf(fp_hpp, " ");
86 fprintf(fp_hpp," // enum %3d, regnum %3d, reg encode %3s\n",
92 fprintf(fp_hpp, " _last_Mach_Reg // %d\n", i);
93 fprintf(fp_hpp, "};\n");
96 fprintf(fp_hpp, "\n// Size of register-mask in ints\n");
97 fprintf(fp_hpp, "#define RM_SIZE %d\n",RegisterForm::RegMask_Size());
98 fprintf(fp_hpp, "// Unroll factor for loops over the data in a RegMask\n");
99 fprintf(fp_hpp, "#define FORALL_BODY ");
102 fprintf(fp_hpp, "BODY(%d) ",i);
103 fprintf(fp_hpp, "\n\n");
105 fprintf(fp_hpp,"class RegMask;\n");
107 // fprintf(fp_hpp,"extern RegMask STACK_OR_STACK_SLOTS_mask;\n\n");
119 void ArchDesc::buildMachRegisterEncodes(FILE *fp_hpp) {
126 fprintf(fp_hpp, "\n");
127 fprintf(fp_hpp, "// Enumerate machine registers starting after reserved regs.\n");
128 fprintf(fp_hpp, "// in the order of occurrence in the alloc_class(es).\n");
129 fprintf(fp_hpp, "enum MachRegisterEncodes {\n");
146 fprintf(fp_hpp," %s_enc", reg_def->_regname);
147 for (size_t i = strlen(reg_def->_regname); i < maxlen; i++) fprintf(fp_hpp, " ");
148 fprintf(fp_hpp," = %3s%s\n", reg_def->register_encode(), reg_def_next == NULL? "" : "," );
151 fprintf(fp_hpp, "};\n");
712 void ArchDesc::declare_pipe_classes(FILE *fp_hpp) {
716 fprintf(fp_hpp, "\n");
717 fprintf(fp_hpp, "// Pipeline_Use_Cycle_Mask Class\n");
718 fprintf(fp_hpp, "class Pipeline_Use_Cycle_Mask {\n");
727 fprintf(fp_hpp, "protected:\n");
728 fprintf(fp_hpp, " %s _mask;\n\n", _pipeline->_maxcycleused <= 32 ? "uint" : "uint64_t" );
729 fprintf(fp_hpp, "public:\n");
730 fprintf(fp_hpp, " Pipeline_Use_Cycle_Mask() : _mask(0) {}\n\n");
732 fprintf(fp_hpp, " Pipeline_Use_Cycle_Mask(uint mask) : _mask(mask) {}\n\n");
734 fprintf(fp_hpp, " Pipeline_Use_Cycle_Mask(uint mask1, uint mask2) : _mask((((uint64_t)mask1) << 32) | mask2) {}\n\n");
735 fprintf(fp_hpp, " Pipeline_Use_Cycle_Mask(uint64_t mask) : _mask(mask) {}\n\n");
737 fprintf(fp_hpp, " Pipeline_Use_Cycle_Mask& operator=(const Pipeline_Use_Cycle_Mask &in) {\n");
738 fprintf(fp_hpp, " _mask = in._mask;\n");
739 fprintf(fp_hpp, " return *this;\n");
740 fprintf(fp_hpp, " }\n\n");
741 fprintf(fp_hpp, " bool overlaps(const Pipeline_Use_Cycle_Mask &in2) const {\n");
742 fprintf(fp_hpp, " return ((_mask & in2._mask) != 0);\n");
743 fprintf(fp_hpp, " }\n\n");
744 fprintf(fp_hpp, " Pipeline_Use_Cycle_Mask& operator<<=(int n) {\n");
745 fprintf(fp_hpp, " _mask <<= n;\n");
746 fprintf(fp_hpp, " return *this;\n");
747 fprintf(fp_hpp, " }\n\n");
748 fprintf(fp_hpp, " void Or(const Pipeline_Use_Cycle_Mask &in2) {\n");
749 fprintf(fp_hpp, " _mask |= in2._mask;\n");
750 fprintf(fp_hpp, " }\n\n");
751 fprintf(fp_hpp, " friend Pipeline_Use_Cycle_Mask operator&(const Pipeline_Use_Cycle_Mask &, const Pipeline_Use_Cycle_Mask &);\n");
752 fprintf(fp_hpp, " friend Pipeline_Use_Cycle_Mask operator|(const Pipeline_Use_Cycle_Mask &, const Pipeline_Use_Cycle_Mask &);\n\n");
755 fprintf(fp_hpp, "protected:\n");
758 fprintf(fp_hpp, " uint ");
760 fprintf(fp_hpp, "_mask%d%s", l, l < masklen ? ", " : ";\n\n");
761 fprintf(fp_hpp, "public:\n");
762 fprintf(fp_hpp, " Pipeline_Use_Cycle_Mask() : ");
764 fprintf(fp_hpp, "_mask%d(0)%s", l, l < masklen ? ", " : " {}\n\n");
765 fprintf(fp_hpp, " Pipeline_Use_Cycle_Mask(");
767 fprintf(fp_hpp, "uint mask%d%s", l, l < masklen ? ", " : ") : ");
769 fprintf(fp_hpp, "_mask%d(mask%d)%s", l, l, l < masklen ? ", " : " {}\n\n");
771 fprintf(fp_hpp, " Pipeline_Use_Cycle_Mask& operator=(const Pipeline_Use_Cycle_Mask &in) {\n");
773 fprintf(fp_hpp, " _mask%d = in._mask%d;\n", l, l);
774 fprintf(fp_hpp, " return *this;\n");
775 fprintf(fp_hpp, " }\n\n");
776 fprintf(fp_hpp, " Pipeline_Use_Cycle_Mask intersect(const Pipeline_Use_Cycle_Mask &in2) {\n");
777 fprintf(fp_hpp, " Pipeline_Use_Cycle_Mask out;\n");
779 fprintf(fp_hpp, " out._mask%d = _mask%d & in2._mask%d;\n", l, l, l);
780 fprintf(fp_hpp, " return out;\n");
781 fprintf(fp_hpp, " }\n\n");
782 fprintf(fp_hpp, " bool overlaps(const Pipeline_Use_Cycle_Mask &in2) const {\n");
783 fprintf(fp_hpp, " return (");
785 fprintf(fp_hpp, "((_mask%d & in2._mask%d) != 0)%s", l, l, l < masklen ? " || " : "");
786 fprintf(fp_hpp, ") ? true : false;\n");
787 fprintf(fp_hpp, " }\n\n");
788 fprintf(fp_hpp, " Pipeline_Use_Cycle_Mask& operator<<=(int n) {\n");
789 fprintf(fp_hpp, " if (n >= 32)\n");
790 fprintf(fp_hpp, " do {\n ");
792 fprintf(fp_hpp, " _mask%d = _mask%d;", l, l-1);
793 fprintf(fp_hpp, " _mask%d = 0;\n", 1);
794 fprintf(fp_hpp, " } while ((n -= 32) >= 32);\n\n");
795 fprintf(fp_hpp, " if (n > 0) {\n");
796 fprintf(fp_hpp, " uint m = 32 - n;\n");
797 fprintf(fp_hpp, " uint mask = (1 << n) - 1;\n");
798 fprintf(fp_hpp, " uint temp%d = mask & (_mask%d >> m); _mask%d <<= n;\n", 2, 1, 1);
800 fprintf(fp_hpp, " uint temp%d = mask & (_mask%d >> m); _mask%d <<= n; _mask%d |= temp%d;\n", l+1, l, l, l, l);
802 fprintf(fp_hpp, " _mask%d <<= n; _mask%d |= temp%d;\n", masklen, masklen, masklen);
803 fprintf(fp_hpp, " }\n");
805 fprintf(fp_hpp, " return *this;\n");
806 fprintf(fp_hpp, " }\n\n");
807 fprintf(fp_hpp, " void Or(const Pipeline_Use_Cycle_Mask &);\n\n");
808 fprintf(fp_hpp, " friend Pipeline_Use_Cycle_Mask operator&(const Pipeline_Use_Cycle_Mask &, const Pipeline_Use_Cycle_Mask &);\n");
809 fprintf(fp_hpp, " friend Pipeline_Use_Cycle_Mask operator|(const Pipeline_Use_Cycle_Mask &, const Pipeline_Use_Cycle_Mask &);\n\n");
812 fprintf(fp_hpp, " friend class Pipeline_Use;\n\n");
813 fprintf(fp_hpp, " friend class Pipeline_Use_Element;\n\n");
814 fprintf(fp_hpp, "};\n\n");
825 fprintf(fp_hpp, "// Pipeline_Use_Element Class\n");
826 fprintf(fp_hpp, "class Pipeline_Use_Element {\n");
827 fprintf(fp_hpp, "protected:\n");
828 fprintf(fp_hpp, " // Mask of used functional units\n");
829 fprintf(fp_hpp, " uint _used;\n\n");
830 fprintf(fp_hpp, " // Lower and upper bound of functional unit number range\n");
831 fprintf(fp_hpp, " uint _lb, _ub;\n\n");
832 fprintf(fp_hpp, " // Indicates multiple functionals units available\n");
833 fprintf(fp_hpp, " bool _multiple;\n\n");
834 fprintf(fp_hpp, " // Mask of specific used cycles\n");
835 fprintf(fp_hpp, " Pipeline_Use_Cycle_Mask _mask;\n\n");
836 fprintf(fp_hpp, "public:\n");
837 fprintf(fp_hpp, " Pipeline_Use_Element() {}\n\n");
838 fprintf(fp_hpp, " Pipeline_Use_Element(uint used, uint lb, uint ub, bool multiple, Pipeline_Use_Cycle_Mask mask)\n");
839 fprintf(fp_hpp, " : _used(used), _lb(lb), _ub(ub), _multiple(multiple), _mask(mask) {}\n\n");
840 fprintf(fp_hpp, " uint used() const { return _used; }\n\n");
841 fprintf(fp_hpp, " uint lowerBound() const { return _lb; }\n\n");
842 fprintf(fp_hpp, " uint upperBound() const { return _ub; }\n\n");
843 fprintf(fp_hpp, " bool multiple() const { return _multiple; }\n\n");
844 fprintf(fp_hpp, " Pipeline_Use_Cycle_Mask mask() const { return _mask; }\n\n");
845 fprintf(fp_hpp, " bool overlaps(const Pipeline_Use_Element &in2) const {\n");
846 fprintf(fp_hpp, " return ((_used & in2._used) != 0 && _mask.overlaps(in2._mask));\n");
847 fprintf(fp_hpp, " }\n\n");
848 fprintf(fp_hpp, " void step(uint cycles) {\n");
849 fprintf(fp_hpp, " _used = 0;\n");
850 fprintf(fp_hpp, " _mask <<= cycles;\n");
851 fprintf(fp_hpp, " }\n\n");
852 fprintf(fp_hpp, " friend class Pipeline_Use;\n");
853 fprintf(fp_hpp, "};\n\n");
855 fprintf(fp_hpp, "// Pipeline_Use Class\n");
856 fprintf(fp_hpp, "class Pipeline_Use {\n");
857 fprintf(fp_hpp, "protected:\n");
858 fprintf(fp_hpp, " // These resources can be used\n");
859 fprintf(fp_hpp, " uint _resources_used;\n\n");
860 fprintf(fp_hpp, " // These resources are used; excludes multiple choice functional units\n");
861 fprintf(fp_hpp, " uint _resources_used_exclusively;\n\n");
862 fprintf(fp_hpp, " // Number of elements\n");
863 fprintf(fp_hpp, " uint _count;\n\n");
864 fprintf(fp_hpp, " // This is the array of Pipeline_Use_Elements\n");
865 fprintf(fp_hpp, " Pipeline_Use_Element * _elements;\n\n");
866 fprintf(fp_hpp, "public:\n");
867 fprintf(fp_hpp, " Pipeline_Use(uint resources_used, uint resources_used_exclusively, uint count, Pipeline_Use_Element *elements)\n");
868 fprintf(fp_hpp, " : _resources_used(resources_used)\n");
869 fprintf(fp_hpp, " , _resources_used_exclusively(resources_used_exclusively)\n");
870 fprintf(fp_hpp, " , _count(count)\n");
871 fprintf(fp_hpp, " , _elements(elements)\n");
872 fprintf(fp_hpp, " {}\n\n");
873 fprintf(fp_hpp, " uint resourcesUsed() const { return _resources_used; }\n\n");
874 fprintf(fp_hpp, " uint resourcesUsedExclusively() const { return _resources_used_exclusively; }\n\n");
875 fprintf(fp_hpp, " uint count() const { return _count; }\n\n");
876 fprintf(fp_hpp, " Pipeline_Use_Element * element(uint i) const { return &_elements[i]; }\n\n");
877 fprintf(fp_hpp, " uint full_latency(uint delay, const Pipeline_Use &pred) const;\n\n");
878 fprintf(fp_hpp, " void add_usage(const Pipeline_Use &pred);\n\n");
879 fprintf(fp_hpp, " void reset() {\n");
880 fprintf(fp_hpp, " _resources_used = _resources_used_exclusively = 0;\n");
881 fprintf(fp_hpp, " };\n\n");
882 fprintf(fp_hpp, " void step(uint cycles) {\n");
883 fprintf(fp_hpp, " reset();\n");
884 fprintf(fp_hpp, " for (uint i = 0; i < %d; i++)\n",
886 fprintf(fp_hpp, " (&_elements[i])->step(cycles);\n");
887 fprintf(fp_hpp, " };\n\n");
888 fprintf(fp_hpp, " static const Pipeline_Use elaborated_use;\n");
889 fprintf(fp_hpp, " static const Pipeline_Use_Element elaborated_elements[%d];\n\n",
891 fprintf(fp_hpp, " friend class Pipeline;\n");
892 fprintf(fp_hpp, "};\n\n");
894 fprintf(fp_hpp, "// Pipeline Class\n");
895 fprintf(fp_hpp, "class Pipeline {\n");
896 fprintf(fp_hpp, "public:\n");
898 fprintf(fp_hpp, " static bool enabled() { return %s; }\n\n",
909 fprintf(fp_hpp, " enum {\n");
910 fprintf(fp_hpp, " _variable_size_instructions = %d,\n",
912 fprintf(fp_hpp, " _fixed_size_instructions = %d,\n",
914 fprintf(fp_hpp, " _branch_has_delay_slot = %d,\n",
916 fprintf(fp_hpp, " _max_instrs_per_bundle = %d,\n",
918 fprintf(fp_hpp, " _max_bundles_per_cycle = %d,\n",
920 fprintf(fp_hpp, " _max_instrs_per_cycle = %d\n",
922 fprintf(fp_hpp, " };\n\n");
924 fprintf(fp_hpp, " static bool instr_has_unit_size() { return %s; }\n\n",
928 fprintf(fp_hpp, "// Individual Instructions may be bundled together by the hardware\n\n");
930 fprintf(fp_hpp, "// Instructions exist only in bundles\n\n");
932 fprintf(fp_hpp, "// Bundling is not supported\n\n");
934 fprintf(fp_hpp, " // Size of an instruction\n");
936 fprintf(fp_hpp, " // Size of an individual instruction does not exist - unsupported\n");
937 fprintf(fp_hpp, " static uint instr_unit_size() {");
939 fprintf(fp_hpp, " assert( false, \"Instructions are only in bundles\" );");
940 fprintf(fp_hpp, " return %d; };\n\n", _pipeline->_instrUnitSize);
943 fprintf(fp_hpp, " // Size of a bundle\n");
945 fprintf(fp_hpp, " // Bundles do not exist - unsupported\n");
946 fprintf(fp_hpp, " static uint bundle_unit_size() {");
948 fprintf(fp_hpp, " assert( false, \"Bundles are not supported\" );");
949 fprintf(fp_hpp, " return %d; };\n\n", _pipeline->_bundleUnitSize);
951 fprintf(fp_hpp, " static bool requires_bundling() { return %s; }\n\n",
954 fprintf(fp_hpp, "private:\n");
955 fprintf(fp_hpp, " Pipeline(); // Not a legal constructor\n");
956 fprintf(fp_hpp, "\n");
957 fprintf(fp_hpp, " const unsigned char _read_stage_count;\n");
958 fprintf(fp_hpp, " const unsigned char _write_stage;\n");
959 fprintf(fp_hpp, " const unsigned char _fixed_latency;\n");
960 fprintf(fp_hpp, " const unsigned char _instruction_count;\n");
961 fprintf(fp_hpp, " const bool _has_fixed_latency;\n");
962 fprintf(fp_hpp, " const bool _has_branch_delay;\n");
963 fprintf(fp_hpp, " const bool _has_multiple_bundles;\n");
964 fprintf(fp_hpp, " const bool _force_serialization;\n");
965 fprintf(fp_hpp, " const bool _may_have_no_code;\n");
966 fprintf(fp_hpp, " const enum machPipelineStages * const _read_stages;\n");
967 fprintf(fp_hpp, " const enum machPipelineStages * const _resource_stage;\n");
968 fprintf(fp_hpp, " const uint * const _resource_cycles;\n");
969 fprintf(fp_hpp, " const Pipeline_Use _resource_use;\n");
970 fprintf(fp_hpp, "\n");
971 fprintf(fp_hpp, "public:\n");
972 fprintf(fp_hpp, " Pipeline(uint write_stage,\n");
973 fprintf(fp_hpp, " uint count,\n");
974 fprintf(fp_hpp, " bool has_fixed_latency,\n");
975 fprintf(fp_hpp, " uint fixed_latency,\n");
976 fprintf(fp_hpp, " uint instruction_count,\n");
977 fprintf(fp_hpp, " bool has_branch_delay,\n");
978 fprintf(fp_hpp, " bool has_multiple_bundles,\n");
979 fprintf(fp_hpp, " bool force_serialization,\n");
980 fprintf(fp_hpp, " bool may_have_no_code,\n");
981 fprintf(fp_hpp, " enum machPipelineStages * const dst,\n");
982 fprintf(fp_hpp, " enum machPipelineStages * const stage,\n");
983 fprintf(fp_hpp, " uint * const cycles,\n");
984 fprintf(fp_hpp, " Pipeline_Use resource_use)\n");
985 fprintf(fp_hpp, " : _write_stage(write_stage)\n");
986 fprintf(fp_hpp, " , _read_stage_count(count)\n");
987 fprintf(fp_hpp, " , _has_fixed_latency(has_fixed_latency)\n");
988 fprintf(fp_hpp, " , _fixed_latency(fixed_latency)\n");
989 fprintf(fp_hpp, " , _read_stages(dst)\n");
990 fprintf(fp_hpp, " , _resource_stage(stage)\n");
991 fprintf(fp_hpp, " , _resource_cycles(cycles)\n");
992 fprintf(fp_hpp, " , _resource_use(resource_use)\n");
993 fprintf(fp_hpp, " , _instruction_count(instruction_count)\n");
994 fprintf(fp_hpp, " , _has_branch_delay(has_branch_delay)\n");
995 fprintf(fp_hpp, " , _has_multiple_bundles(has_multiple_bundles)\n");
996 fprintf(fp_hpp, " , _force_serialization(force_serialization)\n");
997 fprintf(fp_hpp, " , _may_have_no_code(may_have_no_code)\n");
998 fprintf(fp_hpp, " {};\n");
999 fprintf(fp_hpp, "\n");
1000 fprintf(fp_hpp, " uint writeStage() const {\n");
1001 fprintf(fp_hpp, " return (_write_stage);\n");
1002 fprintf(fp_hpp, " }\n");
1003 fprintf(fp_hpp, "\n");
1004 fprintf(fp_hpp, " enum machPipelineStages readStage(int ndx) const {\n");
1005 fprintf(fp_hpp, " return (ndx < _read_stage_count ? _read_stages[ndx] : stage_undefined);");
1006 fprintf(fp_hpp, " }\n\n");
1007 fprintf(fp_hpp, " uint resourcesUsed() const {\n");
1008 fprintf(fp_hpp, " return _resource_use.resourcesUsed();\n }\n\n");
1009 fprintf(fp_hpp, " uint resourcesUsedExclusively() const {\n");
1010 fprintf(fp_hpp, " return _resource_use.resourcesUsedExclusively();\n }\n\n");
1011 fprintf(fp_hpp, " bool hasFixedLatency() const {\n");
1012 fprintf(fp_hpp, " return (_has_fixed_latency);\n }\n\n");
1013 fprintf(fp_hpp, " uint fixedLatency() const {\n");
1014 fprintf(fp_hpp, " return (_fixed_latency);\n }\n\n");
1015 fprintf(fp_hpp, " uint functional_unit_latency(uint start, const Pipeline *pred) const;\n\n");
1016 fprintf(fp_hpp, " uint operand_latency(uint opnd, const Pipeline *pred) const;\n\n");
1017 fprintf(fp_hpp, " const Pipeline_Use& resourceUse() const {\n");
1018 fprintf(fp_hpp, " return (_resource_use); }\n\n");
1019 fprintf(fp_hpp, " const Pipeline_Use_Element * resourceUseElement(uint i) const {\n");
1020 fprintf(fp_hpp, " return (&_resource_use._elements[i]); }\n\n");
1021 fprintf(fp_hpp, " uint resourceUseCount() const {\n");
1022 fprintf(fp_hpp, " return (_resource_use._count); }\n\n");
1023 fprintf(fp_hpp, " uint instructionCount() const {\n");
1024 fprintf(fp_hpp, " return (_instruction_count); }\n\n");
1025 fprintf(fp_hpp, " bool hasBranchDelay() const {\n");
1026 fprintf(fp_hpp, " return (_has_branch_delay); }\n\n");
1027 fprintf(fp_hpp, " bool hasMultipleBundles() const {\n");
1028 fprintf(fp_hpp, " return (_has_multiple_bundles); }\n\n");
1029 fprintf(fp_hpp, " bool forceSerialization() const {\n");
1030 fprintf(fp_hpp, " return (_force_serialization); }\n\n");
1031 fprintf(fp_hpp, " bool mayHaveNoCode() const {\n");
1032 fprintf(fp_hpp, " return (_may_have_no_code); }\n\n");
1033 fprintf(fp_hpp, "//const Pipeline_Use_Cycle_Mask& resourceUseMask(int resource) const {\n");
1034 fprintf(fp_hpp, "// return (_resource_use_masks[resource]); }\n\n");
1035 fprintf(fp_hpp, "\n#ifndef PRODUCT\n");
1036 fprintf(fp_hpp, " static const char * stageName(uint i);\n");
1037 fprintf(fp_hpp, "#endif\n");
1038 fprintf(fp_hpp, "};\n\n");
1040 fprintf(fp_hpp, "// Bundle class\n");
1041 fprintf(fp_hpp, "class Bundle {\n");
1049 fprintf(fp_hpp, "protected:\n");
1050 fprintf(fp_hpp, " enum {\n");
1051 fprintf(fp_hpp, " _unused_delay = 0x%x,\n", 0);
1052 fprintf(fp_hpp, " _use_nop_delay = 0x%x,\n", 1);
1053 fprintf(fp_hpp, " _use_unconditional_delay = 0x%x,\n", 2);
1054 fprintf(fp_hpp, " _use_conditional_delay = 0x%x,\n", 3);
1055 fprintf(fp_hpp, " _used_in_conditional_delay = 0x%x,\n", 4);
1056 fprintf(fp_hpp, " _used_in_unconditional_delay = 0x%x,\n", 5);
1057 fprintf(fp_hpp, " _used_in_all_conditional_delays = 0x%x,\n", 6);
1058 fprintf(fp_hpp, "\n");
1059 fprintf(fp_hpp, " _use_delay = 0x%x,\n", 3);
1060 fprintf(fp_hpp, " _used_in_delay = 0x%x\n", 4);
1061 fprintf(fp_hpp, " };\n\n");
1062 fprintf(fp_hpp, " uint _flags : 3,\n");
1063 fprintf(fp_hpp, " _starts_bundle : 1,\n");
1064 fprintf(fp_hpp, " _instr_count : %d,\n", mshift);
1065 fprintf(fp_hpp, " _resources_used : %d;\n", rshift);
1066 fprintf(fp_hpp, "public:\n");
1067 fprintf(fp_hpp, " Bundle() : _flags(_unused_delay), _starts_bundle(0), _instr_count(0), _resources_used(0) {}\n\n");
1068 fprintf(fp_hpp, " void set_instr_count(uint i) { _instr_count = i; }\n");
1069 fprintf(fp_hpp, " void set_resources_used(uint i) { _resources_used = i; }\n");
1070 fprintf(fp_hpp, " void clear_usage() { _flags = _unused_delay; }\n");
1071 fprintf(fp_hpp, " void set_starts_bundle() { _starts_bundle = true; }\n");
1073 fprintf(fp_hpp, " uint flags() const { return (_flags); }\n");
1074 fprintf(fp_hpp, " uint instr_count() const { return (_instr_count); }\n");
1075 fprintf(fp_hpp, " uint resources_used() const { return (_resources_used); }\n");
1076 fprintf(fp_hpp, " bool starts_bundle() const { return (_starts_bundle != 0); }\n");
1078 fprintf(fp_hpp, " void set_use_nop_delay() { _flags = _use_nop_delay; }\n");
1079 fprintf(fp_hpp, " void set_use_unconditional_delay() { _flags = _use_unconditional_delay; }\n");
1080 fprintf(fp_hpp, " void set_use_conditional_delay() { _flags = _use_conditional_delay; }\n");
1081 fprintf(fp_hpp, " void set_used_in_unconditional_delay() { _flags = _used_in_unconditional_delay; }\n");
1082 fprintf(fp_hpp, " void set_used_in_conditional_delay() { _flags = _used_in_conditional_delay; }\n");
1083 fprintf(fp_hpp, " void set_used_in_all_conditional_delays() { _flags = _used_in_all_conditional_delays; }\n");
1085 fprintf(fp_hpp, " bool use_nop_delay() { return (_flags == _use_nop_delay); }\n");
1086 fprintf(fp_hpp, " bool use_unconditional_delay() { return (_flags == _use_unconditional_delay); }\n");
1087 fprintf(fp_hpp, " bool use_conditional_delay() { return (_flags == _use_conditional_delay); }\n");
1088 fprintf(fp_hpp, " bool used_in_unconditional_delay() { return (_flags == _used_in_unconditional_delay); }\n");
1089 fprintf(fp_hpp, " bool used_in_conditional_delay() { return (_flags == _used_in_conditional_delay); }\n");
1090 fprintf(fp_hpp, " bool used_in_all_conditional_delays() { return (_flags == _used_in_all_conditional_delays); }\n");
1091 fprintf(fp_hpp, " bool use_delay() { return ((_flags & _use_delay) != 0); }\n");
1092 fprintf(fp_hpp, " bool used_in_delay() { return ((_flags & _used_in_delay) != 0); }\n\n");
1094 fprintf(fp_hpp, " enum {\n");
1095 fprintf(fp_hpp, " _nop_count = %d\n",
1097 fprintf(fp_hpp, " };\n\n");
1098 fprintf(fp_hpp, " static void initialize_nops(MachNode *nop_list[%d], Compile* C);\n\n",
1100 fprintf(fp_hpp, "#ifndef PRODUCT\n");
1101 fprintf(fp_hpp, " void dump(outputStream *st = tty) const;\n");
1102 fprintf(fp_hpp, "#endif\n");
1103 fprintf(fp_hpp, "};\n\n");
1108 // fprintf(fp_hpp, "// Pipeline Class Instance for \"%s\"\n", classname);
2064 void ArchDesc::buildMachOperEnum(FILE *fp_hpp) {
2066 OutputMachOperands output_mach_operands(fp_hpp, fp_hpp, _globalNames, *this);
2132 void ArchDesc::buildMachOpcodesEnum(FILE *fp_hpp) {
2134 OutputMachOpcodes output_mach_opcodes(fp_hpp, fp_hpp, _globalNames, *this);
2142 void ArchDesc::build_pipeline_enums(FILE *fp_hpp) {
2155 fprintf(fp_hpp, "\n");
2156 fprintf(fp_hpp, "// Pipeline Stages\n");
2157 fprintf(fp_hpp, "enum machPipelineStages {\n");
2158 fprintf(fp_hpp, " stage_%-*s = 0,\n", stagelen, "undefined");
2163 fprintf(fp_hpp, " stage_%-*s = %d,\n", stagelen, stage, ++stagenum);
2166 fprintf(fp_hpp, " stage_%-*s = %d\n", stagelen, "count", stagenum);
2167 fprintf(fp_hpp, "};\n");
2169 fprintf(fp_hpp, "\n");
2170 fprintf(fp_hpp, "// Pipeline Resources\n");
2171 fprintf(fp_hpp, "enum machPipelineResources {\n");
2189 fprintf(fp_hpp, " resource_%-*s = %d,\n", reslen, resource, rescount++);
2191 fprintf(fp_hpp, "\n");
2194 fprintf(fp_hpp, " res_mask_%-*s = 0x%08x,\n", reslen, resource, resform->mask());
2196 fprintf(fp_hpp, "\n");
2198 fprintf(fp_hpp, " resource_count = %d\n", rescount);
2199 fprintf(fp_hpp, "};\n");