00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #include "bundle_gen.h"
00043 #include "ekapi_util.h"
00044
00045 static const char* const description[]= {"\
00046 #include \"topcode.h\"\n\
00047 /* ====================================================================\n\
00048 * ====================================================================\n\
00049 *" ,
00050 " * Description:\n\
00051 *\n\
00052 * A description of the bundling properties. The interface is\n\
00053 * divided into two pieces: scheduling, and packing. The scheduling\n\
00054 * interface exports the following:\n\
00055 *\n\
00056 * const INT ISA_MAX_SLOTS\n\
00057 * An integer constant that indicates the maximum number of\n\
00058 * slots in a bundle.\n\
00059 *" ,
00060 " * const INT ISA_TAG_SHIFT\n\
00061 * Maximum number of bits required to encode all the execution\n\
00062 * property types.\n\
00063 *\n\
00064 * typedef mUINTxx ISA_EXEC_UNIT_PROPERTY\n\
00065 * A single-bit mask of representing an execution unit.\n\
00066 *\n\
00067 * The names have the form ISA_EXEC_PROPERTY_xxx\n\
00068 * where 'xxx' is replaced with the EXEC_UNIT_PROPERTY name.\n\
00069 *" ,
00070 " * typedef (enum) ISA_EXEC_UNIT\n\
00071 * An enumeration of the execution units.\n\
00072 *\n\
00073 * The names have the form ISA_EXEC_xxx\n\
00074 * where 'xxx' is replaced with the EXEC_UNIT_PROPERTY name.\n\
00075 *\n\
00076 * The values of ISA_EXEC_UNIT and ISA_EXEC_UNIT_PROPERTY are\n\
00077 * related in that the bit-mask value of an ISA_EXEC_UNIT_PROPERTY\n\
00078 * is equal to 2**ISA_EXEC_UNIT.\n\
00079 *" ,
00080 " * const INT ISA_EXEC_MAX\n\
00081 * The highest value ISA_EXEC_UNIT value.\n\
00082 *\n\
00083 * BOOL ISA_EXEC_PROPERTY_is_xxx(TOP t) \n\
00084 * Returns TRUE if EXEC_PROPERTY_is_xxx matches <t>'s property.\n\
00085 *\n\
00086 * ISA_EXEC_UNIT_PROPERTY ISA_EXEC_Unit_Prop(TOP topcode)\n\
00087 * Returns exec_unit_property for the instruction specified\n\
00088 * by <topcode>.\n\
00089 *" ,
00090 " * ISA_BUNDLE_INFO ISA_EXEC_Bundle_Info(INT index)\n\
00091 * Return isa_bundle_info specified by <index>. \n\
00092 *\n\
00093 * ISA_EXEC_UNIT_PROPERTY ISA_EXEC_Slot_Prop(INT bundle, INT slot_index)\n\
00094 * Return exec_unit_property for the slot position <slot_index>\n\
00095 * in <bundle>.\n\
00096 *\n\
00097 * UINT64 ISA_EXEC_Slot_Mask(INT bundle)\n\
00098 * Return slot_mask for <bundle>.\n\
00099 *" ,
00100 " * BOOL ISA_EXEC_Stop(INT bundle, INT slot_index)\n\
00101 * Return stop bit for the slot position <slot_index> in <bundle>.\n\
00102 *\n\
00103 * ISA_EXEC_UNIT ISA_EXEC_Unit(INT bundle, INT slot_index)\n\
00104 * Return the execution unit slot position <slot_index> in <bundle>.\n\
00105 *\n\
00106 * UINT32 ISA_EXEC_Stop_Mask(INT bundle)\n\
00107 * Return stop_mask for <bundle>.\n\
00108 *" ,
00109 " * const char *ISA_EXEC_Name(INT bundle)\n\
00110 * Return the name for <bundle>.\n\
00111 *\n\
00112 * const char *ISA_EXEC_AsmName(INT bundle)\n\
00113 * Return the assembly language name for <bundle>.\n\
00114 *\n\
00115 * BOOL ISA_EXEC_Stop_Before(INT bundle)\n\
00116 * Return stop bit (splite isssue) before <bundle>.\n\
00117 *" ,
00118 " * BOOL ISA_EXEC_Stop_After(INT bundle)\n\
00119 * Return stop bit (splite isssue) after <bundle>.\n\
00120 *\n\
00121 * ====================================================================\n\
00122 *\n\
00123 * The packing interface exports the following:\n\
00124 *" ,
00125 " * typedef ISA_BUNDLE\n\
00126 * A type large enough to hold a bundle. This type will always\n\
00127 * be a struct containing an array of either 32-, or 64-bit\n\
00128 * unsigned integers.\n\
00129 *\n\
00130 * typedef (enum) ISA_BUNDLE_PACK_COMP\n\
00131 * An enumeration of the bundle components to be packed.\n\
00132 *\n\
00133 * const INT ISA_BUNDLE_PACK_COMP_MAX\n\
00134 * The maximum number of components to be packed for a bundle.\n\
00135 *" ,
00136 " * typedef (struct) ISA_BUNDLE_PACK_INFO\n\
00137 * Describes how a the components of a bundle are packed.\n\
00138 * The contents are private.\n\
00139 *\n\
00140 * const ISA_BUNDLE_PACK_INFO *ISA_BUNDLE_Pack_Info(void)\n\
00141 * Returns a pointer to the first packing component.\n\
00142 * Increment the returned pointer to access any additional packing\n\
00143 * components for the bundle. A component of ISA_PACK_COMP_end\n\
00144 * marks the end.\n\
00145 *\n\
00146 * INT ISA_BUNDLE_PACK_INFO_Comp(const ISA_BUNDLE_PACK_INFO *info)\n\
00147 * Identifies the bundle component to be packed.\n\
00148 *" ,
00149 " * INT ISA_BUNDLE_PACK_INFO_Index(const ISA_BUNDLE_PACK_INFO *info)\n\
00150 * The index of the bundle word containing the component.\n\
00151 *\n\
00152 * ISA_BUNDLE_PACK_INFO_Index is meaningless for ISA_BUNDLE_PACK_COMP_end.\n\
00153 *\n\
00154 * INT ISA_BUNDLE_PACK_INFO_CompPos(const ISA_BUNDLE_PACK_INFO *info)\n\
00155 * The offset, in bits, to the start of the component in the\n\
00156 * component value.\n\
00157 *" ,
00158 " * ISA_BUNDLE_PACK_INFO_CompPos is meaningless for ISA_BUNDLE_PACK_COMP_end.\n\
00159 *\n\
00160 * INT ISA_BUNDLE_PACK_INFO_BundlePos(const ISA_BUNDLE_PACK_INFO *info)\n\
00161 * The offset, in bits, to the start of the component in the\n\
00162 * bundle word.\n\
00163 *\n\
00164 * ISA_BUNDLE_PACK_INFO_BundlePos is meaningless for ISA_BUNDLE_PACK_COMP_end.\n\
00165 *" ,
00166 " * UINT64 ISA_BUNDLE_PACK_INFO_Mask(const ISA_BUNDLE_PACK_INFO *info)\n\
00167 * A bit mask that is as wide as the bundle component being\n\
00168 * packed. The mask is shifted to match the field in the\n\
00169 * bundle word.\n\
00170 *\n\
00171 * ISA_BUNDLE_PACK_INFO_Mask is meaningless for ISA_BUNDLE_PACK_COMP_end.\n\
00172 *" ,
00173 " * INT ISA_BUNDLE_Pack_Info_Index(ISA_BUNDLE_PACK_COMP comp)\n\
00174 * Index into bundle packing info array (see ISA_BUNDLE_Pack_Info)\n\
00175 * to the start of the info for the component <comp>. If there\n\
00176 * is no packing info for <comp>, the index is for the 'end'\n\
00177 * component.\n\
00178 *\n\
00179 * ====================================================================\n\
00180 * ====================================================================\n\
00181 */",
00182 NULL };
00183
00184
00185 static const char bundle_info_struct[]="\
00186 typedef struct {\n\
00187 const char *name;\n\
00188 const char *asm_name;\n\
00189 int slot_count;\n\
00190 ISA_EXEC_UNIT_PROPERTY slot[%d];\n\
00191 mBOOL stop[%d];\n\
00192 mUINT8 unit[%d];\n\
00193 mUINT8 pack_code;\n\
00194 mUINT8 stop_mask;\n\
00195 mUINT64 slot_mask;\n\
00196 mBOOL stop_bf;\n\
00197 mBOOL stop_af;\n\
00198 } ISA_BUNDLE_INFO;\n\n";
00199
00200 static const char* const bundle_info_query[]={
00201 "\n\
00202 inline ISA_EXEC_UNIT_PROPERTY ISA_EXEC_Unit_Prop(TOP topcode)\n\
00203 {\n\
00204 return ISA_EXEC_unit_prop[(INT)topcode];\n\
00205 }\n\
00206 " ,
00207 "inline ISA_BUNDLE_INFO ISA_EXEC_Bundle_Info(INT index)\n\
00208 {\n\
00209 extern const ISA_BUNDLE_INFO ISA_BUNDLE_info[];\n\
00210 return ISA_BUNDLE_info[index];\n\
00211 }\n\
00212 " ,
00213 "inline ISA_EXEC_UNIT_PROPERTY ISA_EXEC_Slot_Prop(INT bundle, INT slot_index)\n\
00214 {\n\
00215 extern const ISA_BUNDLE_INFO ISA_BUNDLE_info[];\n\
00216 const ISA_BUNDLE_INFO *info = ISA_BUNDLE_info + bundle;\n\
00217 return info->slot[slot_index];\n\
00218 }\n\
00219 " ,
00220 "inline UINT64 ISA_EXEC_Slot_Mask(INT bundle)\n\
00221 {\n\
00222 extern const ISA_BUNDLE_INFO ISA_BUNDLE_info[];\n\
00223 const ISA_BUNDLE_INFO *info = ISA_BUNDLE_info + bundle;\n\
00224 return info->slot_mask;\n\
00225 }\n\
00226 " ,
00227 "inline BOOL ISA_EXEC_Stop(INT bundle, INT slot_index)\n\
00228 {\n\
00229 extern const ISA_BUNDLE_INFO ISA_BUNDLE_info[];\n\
00230 const ISA_BUNDLE_INFO *info = ISA_BUNDLE_info + bundle;\n\
00231 return info->stop[slot_index];\n\
00232 }\n\
00233 " ,
00234 "inline ISA_EXEC_UNIT ISA_EXEC_Unit(INT bundle, INT slot_index)\n\
00235 {\n\
00236 extern const ISA_BUNDLE_INFO ISA_BUNDLE_info[];\n\
00237 const ISA_BUNDLE_INFO *info = ISA_BUNDLE_info + bundle;\n\
00238 return (ISA_EXEC_UNIT)info->unit[slot_index];\n\
00239 }\n\
00240 " ,
00241 "inline UINT32 ISA_EXEC_Stop_Mask(INT bundle)\n\
00242 {\n\
00243 extern const ISA_BUNDLE_INFO ISA_BUNDLE_info[];\n\
00244 const ISA_BUNDLE_INFO *info = ISA_BUNDLE_info + bundle;\n\
00245 return info->stop_mask;\n\
00246 }\n\
00247 " ,
00248 "inline const char * ISA_EXEC_Name(INT bundle)\n\
00249 {\n\
00250 extern const ISA_BUNDLE_INFO ISA_BUNDLE_info[];\n\
00251 const ISA_BUNDLE_INFO *info = ISA_BUNDLE_info + bundle;\n\
00252 return info->name;\n\
00253 }\n\
00254 " ,
00255 "inline const char * ISA_EXEC_AsmName(INT bundle)\n\
00256 {\n\
00257 extern const ISA_BUNDLE_INFO ISA_BUNDLE_info[];\n\
00258 const ISA_BUNDLE_INFO *info = ISA_BUNDLE_info + bundle;\n\
00259 return info->asm_name;\n\
00260 }\n\
00261 " ,
00262 "// Add two function for special slpit issue\n\
00263 inline BOOL ISA_EXEC_Stop_Before(INT bundle)\n\
00264 {\n\
00265 extern const ISA_BUNDLE_INFO ISA_BUNDLE_info[];\n\
00266 const ISA_BUNDLE_INFO *info = ISA_BUNDLE_info + bundle;\n\
00267 return info->stop_bf;\n\
00268 }\n\
00269 " ,
00270 "inline BOOL ISA_EXEC_Stop_After(INT bundle)\n\
00271 {\n\
00272 extern const ISA_BUNDLE_INFO ISA_BUNDLE_info[];\n\
00273 const ISA_BUNDLE_INFO *info = ISA_BUNDLE_info + bundle;\n\
00274 return info->stop_af;\n\
00275 }\n\
00276 ", NULL };
00277
00278 static const char bundle_pack_name[]="\
00279 typedef enum {\n\
00280 ISA_BUNDLE_PACK_COMP_end = 0, /* End of list marker */\n\
00281 ISA_BUNDLE_PACK_COMP_stop = 1, /* Stop bit */\n\
00282 ISA_BUNDLE_PACK_COMP_template = 2, /* Template */\n\
00283 ISA_BUNDLE_PACK_COMP_slot = 3, /* SLOT+n => slot n */\n\
00284 ISA_BUNDLE_PACK_COMP_MAX = %d /* Last component */\n\
00285 } ISA_BUNDLE_PACK_COMP;\n\
00286 \n";
00287
00288 static const char bundle_pack_info[]=
00289 "typedef struct {\n\
00290 mUINT8 comp;\n\
00291 mUINT8 index;\n\
00292 mUINT8 comp_pos;\n\
00293 mUINT8 bundle_pos;\n\
00294 UINT64 mask;\n\
00295 } ISA_BUNDLE_PACK_INFO;\n\
00296 \n\
00297 inline const ISA_BUNDLE_PACK_INFO *ISA_BUNDLE_Pack_Info(void)\n\
00298 {\n\
00299 extern const ISA_BUNDLE_PACK_INFO ISA_BUNDLE_pack_info[];\n\
00300 return ISA_BUNDLE_pack_info;\n\
00301 }\n\
00302 \n\
00303 inline INT ISA_BUNDLE_PACK_INFO_Comp(const ISA_BUNDLE_PACK_INFO *info)\n\
00304 {\n\
00305 return info->comp;\n\
00306 }\n\
00307 \n\
00308 inline INT ISA_BUNDLE_PACK_INFO_Index(const ISA_BUNDLE_PACK_INFO *info)\n\
00309 {\n\
00310 return info->index;\n\
00311 }\n\
00312 \n\
00313 inline INT ISA_BUNDLE_PACK_INFO_CompPos(const ISA_BUNDLE_PACK_INFO *info)\n\
00314 {\n\
00315 return info->comp_pos;\n\
00316 }\n\
00317 \n\
00318 inline INT ISA_BUNDLE_PACK_INFO_BundlePos(const ISA_BUNDLE_PACK_INFO *info)\n\
00319 {\n\
00320 return info->bundle_pos;\n\
00321 }\n\
00322 \n\
00323 inline UINT64 ISA_BUNDLE_PACK_INFO_Mask(const ISA_BUNDLE_PACK_INFO *info)\n\
00324 {\n\
00325 return info->mask;\n\
00326 }\n\
00327 \n\
00328 inline INT ISA_BUNDLE_Pack_Info_Index(ISA_BUNDLE_PACK_COMP comp)\n\
00329 {\n\
00330 extern const mUINT8 ISA_BUNDLE_pack_info_index[6];\n\
00331 return ISA_BUNDLE_pack_info_index[(INT)comp];\n\
00332 }\n\
00333 \n";
00334
00335 void Bundle_Generator(void *pknobs, GEN_MODE mode)
00336 {
00337 FILE *c_file, *h_file, *export_file;
00338 int index;
00339
00340 Init_Module_Files(mode, "targ_isa_bundle", &c_file, &h_file, &export_file);
00341 Emit_Header(h_file, "targ_isa_bundle", description);
00342 fprintf(c_file, "#include \"targ_isa_bundle.h\"\n\n\n");
00343
00344 fprintf(h_file, "\n#define ISA_MAX_SLOTS (%d)\n", EKAPI_GetMaxSlot(pknobs));
00345 fprintf(h_file, "#define ISA_TAG_SHIFT (12)\n");
00346 fprintf(h_file, "\ntypedef mUINT8 ISA_EXEC_UNIT_PROPERTY;\n\n");
00347
00348 for (index=0; index<EKAPI_ExecUnitCount(pknobs); index++){
00349 fprintf(h_file, "#define ISA_EXEC_PROPERTY_%-15s (%#x)\n",
00350 EKAPI_ExecUnitName(pknobs, index), (unsigned int)(1ULL << index));
00351 }
00352
00353 fprintf(h_file, "\ntypedef enum {\n");
00354 for (index=0; index<EKAPI_ExecUnitCount(pknobs); index++){
00355 fprintf(h_file, " ISA_EXEC_%-15s = %d,\n",
00356 EKAPI_ExecUnitName(pknobs, index), index);
00357 }
00358 fprintf(h_file, " ISA_EXEC_MAX = %d\n} ISA_EXEC_UNIT;\n\n",
00359 index-1);
00360
00361
00362 fprintf(export_file, "ISA_BUNDLE_info\n");
00363 fprintf(h_file, bundle_info_struct, EKAPI_GetMaxSlot(pknobs),
00364 EKAPI_GetMaxSlot(pknobs), EKAPI_GetMaxSlot(pknobs));
00365 fprintf(c_file, "const ISA_BUNDLE_INFO ISA_BUNDLE_info[] = {\n");
00366 for (index=0; index<EKAPI_TemplateCount(pknobs); index++){
00367 int i;
00368 fprintf(c_file, " {\n ");
00369 char * name = EKAPI_TemplateName(pknobs,index);
00370 fprintf(c_file, "\"%s\", ", name);
00371 for (i=0; i<(10-strlen(name)); i++){
00372 fprintf(c_file, " ");
00373 }
00374 if (KAPI_isReserved_bid(pknobs,index)){
00375 fprintf(c_file, "\".%#x\",", index);
00376 }
00377 else{
00378 fprintf(c_file, "\"%s\",", EKAPI_TemplateAsmName(pknobs,index));
00379 }
00380 fprintf(c_file, " %d,\n", EKAPI_GetMaxSlot(pknobs));
00381
00382 int * slots = (int*)malloc(EKAPI_GetMaxSlot(pknobs)*sizeof(int));
00383 FmtAssert(slots, ("Memory Allocation Failure!\n"));
00384 EKAPI_BundleType4bid(pknobs, index, slots);
00385 fprintf(c_file, " {");
00386 int slot_mask = 0;
00387 for (i=0; i<EKAPI_GetMaxSlot(pknobs); i++){
00388 fprintf(c_file, " %2d /* %7s */,", 1 <<slots[i],
00389 EKAPI_ExecUnitName(pknobs, slots[i]));
00390 slot_mask = slot_mask <<12;
00391 slot_mask |= 1 << slots[i];
00392 }
00393 fprintf(c_file, " },\n {");
00394
00395 int stop_mask = 0;
00396 for (i=0; i<EKAPI_GetMaxSlot(pknobs); i++){
00397 stop_mask = stop_mask << 1;
00398 if ((i+1)==KAPI_SbitPlacement_bid(pknobs,index)){
00399 fprintf(c_file, " TRUE,");
00400 stop_mask |= 1;
00401 }
00402 else{
00403 fprintf(c_file, " FALSE,");
00404 }
00405 }
00406 fprintf(c_file, " },\n {");
00407
00408 for (i=0; i<EKAPI_GetMaxSlot(pknobs); i++){
00409 char *unit_name = EKAPI_ExecUnitName(pknobs, slots[i]);
00410 if (strcmp(unit_name, "B2_Unit")==0){
00411 fprintf(c_file, " ISA_EXEC_B_Unit,");
00412 }
00413 else{
00414 fprintf(c_file, " ISA_EXEC_%s,", unit_name );
00415 }
00416 }
00417 fprintf(c_file, " },\n ");
00418
00419 fprintf(c_file, "%2d, 0x%x, 0x%09x,", index, stop_mask, slot_mask);
00420 if (EKAPI_Split_Before_Bundle(pknobs, index))
00421 fprintf(c_file, " TRUE,");
00422 else
00423 fprintf(c_file, " FALSE,");
00424 if (EKAPI_Split_After_Bundle(pknobs, index))
00425 fprintf(c_file, " TRUE");
00426 else
00427 fprintf(c_file, " FALSE");
00428 fprintf(c_file, "\n },\n");
00429 free(slots);;
00430 }
00431 fprintf(c_file, " {\n\
00432 \"template_MAX\", \"\", -1,\n\
00433 { -1 /* ??????? */, -1 /* ??????? */, -1 /* ??????? */,},\n\
00434 { FALSE, FALSE, FALSE,},\n\
00435 -1, 0x0, 0x000000000, FALSE, FALSE\n }\n};\n\n");
00436
00437
00438
00439
00440 fprintf(h_file, "#define ISA_MAX_BUNDLES %d\n\n",
00441 EKAPI_TemplateCount(pknobs));
00442
00443
00444
00445 fprintf(export_file, "ISA_EXEC_unit_prop\n");
00446 fprintf(h_file,
00447 "extern const ISA_EXEC_UNIT_PROPERTY ISA_EXEC_unit_prop[];\n\n");
00448 fprintf(c_file,
00449 "const ISA_EXEC_UNIT_PROPERTY ISA_EXEC_unit_prop[%d] = {\n",
00450 EKAPI_OpCount(pknobs));
00451 for (index=0; index<EKAPI_OpCount(pknobs); index++){
00452 bv32_t mask = EKAPI_EunMask4op(pknobs, index);
00453 fprintf(c_file, "%5d, /* (null): ", mask);
00454 for (int i=0; i<EKAPI_ExecUnitCount(pknobs); i++){
00455 if (mask & (1<<i)){
00456 fprintf(c_file," %s", EKAPI_ExecUnitName(pknobs, i));
00457 }
00458 }
00459 fprintf(c_file, " */\n");
00460 }
00461 fprintf(c_file, "};\n\n");
00462
00463
00464 for (index=0; index<EKAPI_ExecUnitCount(pknobs); index++){
00465 fprintf(h_file, "#define EXEC_PROPERTY_is_%s(t)\t \
00466 (ISA_EXEC_unit_prop[(INT)t] & ISA_EXEC_PROPERTY_%s)\n",
00467 EKAPI_ExecUnitName(pknobs, index),
00468 EKAPI_ExecUnitName(pknobs, index));
00469 }
00470 for (int i=0; bundle_info_query[i] != NULL; i++)
00471 fprintf(h_file, "%s\n", bundle_info_query[i]);
00472
00473
00474 int b_width = EKAPI_GetBundleWidth(pknobs);
00475 int number = b_width / 64;
00476 if (b_width%64){
00477 number++;
00478 }
00479 fprintf(h_file,
00480 "typedef struct {\n mUINT64 word[%d];\n} ISA_BUNDLE;\n\n", number);
00481
00482
00483 fprintf(export_file, "ISA_BUNDLE_pack_info\nISA_BUNDLE_pack_info_index\n");
00484
00485 fprintf(h_file, bundle_pack_name, EKAPI_BundleCompCount(pknobs));
00486 fprintf(h_file, bundle_pack_info);
00487 fprintf(c_file, "const ISA_BUNDLE_PACK_INFO ISA_BUNDLE_pack_info[] = {\n");
00488 int start_bit=0;
00489 int start_pos=0;
00490 int width=0;
00491 int pos = 0;
00492 int *positions = (int*)malloc(EKAPI_BundleCompCount(pknobs)*sizeof(int));
00493 FmtAssert(positions, ("Memory Allocation Failure!\n"));
00494 memset( positions, 0, EKAPI_BundleCompCount(pknobs)*sizeof(int));
00495
00496 for (index=0; index<EKAPI_BundleCompCount(pknobs); index++, pos++){
00497 char *bundle_comp_name = EKAPI_BundleCompName(pknobs, index);
00498 if (positions[index]==0){
00499 positions[index]=pos;
00500 }
00501
00502
00503 char *p = strstr(bundle_comp_name, "slot_");
00504 if (p){
00505 p[4]='+';
00506 }
00507 fprintf(c_file, " { ISA_BUNDLE_PACK_%-13s , %2d, %2d, %2d,",
00508 bundle_comp_name, start_pos, width, start_bit);
00509 width = EKAPI_BundleCompWidth(pknobs,index) - width;
00510 UINT64 mask = 0;
00511 for (int i=0; i<width; i++){
00512 mask = mask << 1ULL;
00513 mask |= 1ULL;
00514 }
00515 mask = mask << start_bit;
00516 fprintf(c_file, " %#016llxLL },",
00517 mask );
00518
00519 char *comment = strdup(bundle_comp_name);
00520 char *cp = comment+5;
00521 if (strncmp(cp, "slot", 4)==0){
00522 cp[4]=cp[5];
00523 cp[5]='\0';
00524 }
00525 cp = StrUpper(cp);
00526 fprintf(c_file, " /* %s */\n", cp);
00527 free(comment);
00528
00529 if (start_bit+width > 64){
00530
00531 width = 64-start_bit;
00532 start_pos++;
00533 start_bit=0;
00534 index--;
00535 }
00536 else{
00537 start_bit += width;
00538 width=0;
00539 }
00540 free(bundle_comp_name);
00541 }
00542 fprintf(c_file, " { ISA_BUNDLE_PACK_COMP_end , -1, -1, -1,\
00543 -1 }, /* END */\n};\n\n");
00544 fprintf(c_file, "const mUINT8 ISA_BUNDLE_pack_info_index[%d] = {\n",
00545 pos);
00546 fprintf(c_file, " %d, /* ISA_BUNDLE_PACK_COMP_end */\n", pos);
00547 for (index=0; index<EKAPI_BundleCompCount(pknobs); index++){
00548 char *comp_name = EKAPI_BundleCompName(pknobs, index);
00549
00550 char *p = strstr(comp_name, "slot_");
00551 if (p){
00552 p[4]='+';
00553 }
00554 fprintf(c_file, " %d, /* ISA_BUNDLE_PACK_%s */\n",
00555 positions[index], comp_name);
00556 }
00557 free(positions);
00558 fprintf(c_file, "};\n");
00559
00560
00561 Emit_Tailer(h_file);
00562 Close_Module_Files(mode, &c_file, &h_file, &export_file);
00563 }
00564
00565
00566
00567