static bool LblName( label_handle lbl, bool no_prefix ) /*********************************************************/ { if( !ValidLbl( lbl ) ) return( false ); if( no_prefix ) { if( lbl->lbl.sym == NULL ) { return( false ); } } else { DumpChar( 'L' ); DumpPtr( lbl ); if( lbl->lbl.sym == NULL ) { return( true ); } } DumpChar( '(' ); if( AskIfRTLabel( lbl ) ) { DumpXString( AskRTName( SYM2RTIDX( lbl->lbl.sym ) ) ); } else if( AskIfCommonLabel( lbl ) ) { DumpLiteral( "Common import => [" ); DumpUInt( (unsigned)(pointer_int)lbl->lbl.sym ); DumpLiteral( "] " ); } else { DumpXString( FEName( lbl->lbl.sym ) ); } DumpChar( ')' ); return( true ); }
extern void DumpInvariants() { /********************************/ DumpLiteral( "Temps: " ); DumpInv( Names[N_TEMP] ); DumpLiteral( "Memory: " ); DumpInv( Names[N_MEMORY] ); }
extern void DumpOc( ins_entry *ins ) { /****************************************/ DumpPtr( ins ); DumpLiteral( " " ); DumpString( CNames[ _Class( ins ) ] ); DumpLiteral( " " ); if( _Class( ins ) != OC_INFO ) { CheckAttr( ins->oc.oc_header.class ); }
static void DumpRgSet( hw_reg_set *possible ) /**************************************************/ { if( possible != NULL ) { DumpLiteral( " Choices " ); while( !HW_CEqual( *possible, HW_EMPTY ) ) { DumpRegName( *possible ); ++ possible; DumpLiteral( " " ); } } }
extern void DumpInOut( instruction *ins ) { /*********************************************/ DumpLiteral( " " ); DumpGBit( &ins->head.live.out_of_block ); DumpChar( ' ' ); DumpLBit( &ins->head.live.within_block ); if( !HW_CEqual( ins->head.live.regs, HW_EMPTY ) && !HW_COvlap( ins->head.live.regs, HW_UNUSED ) ) { DumpLiteral( " " ); DumpRegName( ins->head.live.regs ); } DumpNL(); }
static void DumpInsRange( conflict_node *conf ) { /***************************************************/ if( conf->ins_range.first != NULL ) { DumpLiteral( " Instruction " ); DumpInt( conf->ins_range.first->id ); if( conf->ins_range.first != conf->ins_range.last && conf->ins_range.last != NULL ) { DumpLiteral( " to Instruction " ); DumpInt( conf->ins_range.last->id ); } } }
static void DumpHeader (DumpState *D) { DumpLiteral(LUA_SIGNATURE, D); DumpByte(LUAC_VERSION, D); DumpByte(LUAC_FORMAT, D); DumpLiteral(LUAC_DATA, D); DumpByte(sizeof(int), D); DumpByte(sizeof(size_t), D); DumpByte(sizeof(Instruction), D); DumpByte(sizeof(lua_Integer), D); DumpByte(sizeof(lua_Number), D); DumpInteger(LUAC_INT, D); DumpNumber(LUAC_NUM, D); }
extern void DumpConflicts() { /*******************************/ conflict_node *conf; DumpLiteral( "Conflict graph" ); DumpNL(); conf = ConfList; while( conf != NULL ) { DumpPtr( conf ); DumpLiteral( " " ); DumpAConf( conf ); conf = conf->next_conflict; } DumpNL(); }
static void CheckAttr( oc_class cl ) { /****************************************/ if( cl & ATTR_FAR ) { DumpLiteral( "far " ); } if( cl & ATTR_SHORT ) { DumpLiteral( "short " ); } if( cl & ATTR_POP ) { DumpLiteral( "popping " ); } if( cl & ATTR_FLOAT ) { DumpLiteral( "floating " ); } }
static void DumpIndent( int i ) { /***********************************/ while( --i >= 0 ) { DumpLiteral( " " ); } }
static void DumpRegs( hw_reg_set *regs ) { /********************************************/ int i; DumpLiteral( "Choices " ); if( regs != NULL ) { i = SET_SIZE; while( --i >= 0 ) { if( !HW_CEqual( *regs, HW_EMPTY ) ) { DumpRegName( *regs ); DumpLiteral( "," ); } ++regs; } } }
extern void DumpPossible( byte idx ) { /****************************************/ if( idx == RL_NUMBER_OF_SETS ) { DumpLiteral( " Choices ANY" ); } else { DumpRgSet( RegSets[idx] ); } }
void DumpOpcodeName( int opcode ) /**********************************/ { if( opcode > OP_BLOCK || opcode < 0 ) { DumpLiteral( "??????" ); } else { DumpString( OpcodeList[opcode] ); DumpChar( ' ' ); } }
static void DumpRgSet( hw_reg_set *possible ) /**************************************************/ { if( possible != NULL ) { DumpLiteral( " Choices " ); for( ; !HW_CEqual( *possible, HW_EMPTY ); ++possible ) { DumpRegName( *possible ); DumpChar( ' ' ); } } }
static bool LblName( label_handle lbl ) { /*****************************************/ if( ValidLbl( lbl ) == false ) return( false ); DumpChar( 'L' ); DumpPtr( lbl ); if( lbl->lbl.sym == NULL ) return( true ); DumpChar( '(' ); if( AskIfRTLabel( lbl ) ) { DumpXString( AskRTName( (rt_class)(pointer_int)lbl->lbl.sym ) ); } else if( AskIfCommonLabel( lbl ) ) { DumpLiteral( "Common import => [" ); DumpInt( (int)(pointer_int)lbl->lbl.sym ); DumpLiteral( "] " ); } else { DumpXString( FEName( lbl->lbl.sym ) ); } DumpChar( ')' ); return( true ); }
static bool LblName( code_lbl *lbl ) { /*****************************************/ if( ValidLbl( lbl ) == FALSE ) return( FALSE ); DumpLiteral( "L" ); DumpPtr( lbl ); if( lbl->lbl.sym == NULL ) return( TRUE ); DumpLiteral( "(" ); if( AskIfRTLabel( lbl ) ) { DumpXString( AskRTName( (rt_class)(pointer_int)lbl->lbl.sym ) ); } else if( AskIfCommonLabel( lbl ) ) { DumpLiteral( "Common import => [" ); DumpInt( (int)(pointer_int)lbl->lbl.sym ); DumpLiteral( "] " ); } else { DumpXString( FEName( lbl->lbl.sym ) ); } DumpLiteral( ")" ); return( TRUE ); }
extern void DumpConflicts() { /*******************************/ conflict_node *conf; DumpLiteral( "Conflict graph" ); DumpNL(); for( conf = ConfList; conf != NULL; conf = conf->next_conflict ) { DumpPtr( conf ); DumpChar( ' ' ); DumpAConf( conf ); } DumpNL(); }
static void DumpHeader(DumpState* D) { DumpLiteral(LUA_SIGNATURE,D); DumpByte(VERSION,D); DumpByte(luaU_endianness(),D); DumpByte(sizeof(int),D); DumpByte(sizeof(size_t),D); DumpByte(sizeof(Instruction),D); DumpByte(SIZE_OP,D); DumpByte(SIZE_A,D); DumpByte(SIZE_B,D); DumpByte(SIZE_C,D); DumpByte(sizeof(lua_Number),D); DumpNumber(TEST_NUMBER,D); }
extern void DumpCurrLoop() { /******************************/ block *blk; block *header; interval_depth depth; DumpLiteral( "The Loop Is:" ); DumpNL(); DumpLiteral( "============" ); DumpNL(); depth = MAX_INTERVAL_DEPTH; header = NULL; for( blk = HeadBlock; blk != NULL; blk = blk->next_block ) { if( blk->class & BLK_IN_LOOP ) { if( blk->depth < depth ) { header = blk; depth = header->depth; } } } for( blk = HeadBlock; blk != NULL; blk = blk->next_block ) { DumpBlkId( blk ); if( blk->class & BLK_IN_LOOP ) { if( blk == header ) { DumpLiteral( " - Header" ); } else { DumpLiteral( " - In for(;;) {" ); } if( blk->class & BLK_LOOP_EXIT ) { DumpLiteral( " Exits" ); } } DumpNL(); } }
static void DoDump( reg_tree *tree, int indent ) { /****************************************************/ DumpIndent( indent ); DumpRegs( tree->regs ); DumpNL(); DumpIndent( indent ); DumpLiteral( "offset " ); DumpInt( tree->offset ); DumpLiteral( " size " ); DumpInt( tree->size ); DumpNL(); if( tree->temp != NULL ) { DumpIndent( indent ); DumpLiteral( "name " ); DumpPtr( tree->temp ); DumpLiteral( " " ); DumpSym( tree->temp ); DumpNL(); } if( tree->alt != NULL ) { DumpIndent( indent ); DumpLiteral( "alt " ); DumpPtr( tree->alt ); DumpLiteral( " " ); DumpSym( tree->alt ); DumpNL(); } if( tree->hi != NULL ) { DumpIndent( indent ); DumpLiteral( "high " ); DumpNL(); DoDump( tree->hi, indent + 4 ); } if( tree->lo != NULL ) { DumpIndent( indent ); DumpLiteral( "low " ); DumpNL(); DoDump( tree->lo, indent + 4 ); } }
static void DumpScList( score_list *curr ) /********************************************/ { DumpLiteral( " " ); switch( curr->info.class ) { case SC_N_CONSTANT: DumpChar( '&' ); DumpLong( curr->info.offset ); break; case SC_N_TEMP: DumpChar( 't' ); DumpInt( curr->info.symbol.t->v.id ); DumpLiteral( " offset " ); DumpLong( curr->info.offset ); break; case SC_N_MEMORY: DumpXString( FEName( curr->info.symbol.p ) ); DumpLiteral( " offset " ); DumpLong( curr->info.offset ); break; case SC_N_INDEXED: if( curr->info.base == NULL ) { ; } else if( curr->info.base->n.class == N_TEMP ) { DumpChar( 't' ); DumpInt( curr->info.base->t.v.id ); DumpChar( '+' ); } else { DumpXString( FEName( curr->info.base->v.symbol ) ); DumpChar( '+' ); } DumpLong( curr->info.offset ); DumpChar( '[' ); DumpRegName( ScoreList[curr->info.index_reg]->reg ); DumpChar( ']' ); break; case SC_N_INITIAL: DumpLiteral( "INITIAL(" ); DumpLong( curr->info.offset ); DumpChar( ')' ); break; case SC_N_VOLATILE: DumpLiteral( "VOLATILE - Oh No!" ); break; case SC_N_ADDRESS: DumpLiteral( "ADDRESS(" ); DumpOperand(curr->info.symbol.p); DumpChar( ')' ); break; }
static void DumpRegs( hw_reg_set *regs ) { /********************************************/ int i; bool first; DumpLiteral( "Choices " ); if( regs != NULL ) { first = true; for( i = REG_COUNT; i > 0; --i ) { if( !HW_CEqual( *regs, HW_EMPTY ) ) { if( first ) { first = false; } else { DumpChar( ',' ); } DumpRegName( *regs ); } ++regs; } } }
void SQFuncState::Dump(SQFunctionProto *func) { SQUnsignedInteger n=0,i; SQInteger si; scprintf(_SC("SQInstruction sizeof %d\n"),sizeof(SQInstruction)); scprintf(_SC("SQObject sizeof %d\n"),sizeof(SQObject)); scprintf(_SC("--------------------------------------------------------------------\n")); scprintf(_SC("*****FUNCTION [%s]\n"),type(func->_name)==OT_STRING?_stringval(func->_name):_SC("unknown")); scprintf(_SC("-----LITERALS\n")); SQObjectPtr refidx,key,val; SQInteger idx; SQObjectPtrVec templiterals; templiterals.resize(_nliterals); while((idx=_table(_literals)->Next(false,refidx,key,val))!=-1) { refidx=idx; templiterals[_integer(val)]=key; } for(i=0;i<templiterals.size();i++){ scprintf(_SC("[%d] "),n); DumpLiteral(templiterals[i]); scprintf(_SC("\n")); n++; } scprintf(_SC("-----PARAMS\n")); if(_varparams) scprintf(_SC("<<VARPARAMS>>\n")); n=0; for(i=0;i<_parameters.size();i++){ scprintf(_SC("[%d] "),n); DumpLiteral(_parameters[i]); scprintf(_SC("\n")); n++; } scprintf(_SC("-----LOCALS\n")); for(si=0;si<func->_nlocalvarinfos;si++){ SQLocalVarInfo lvi=func->_localvarinfos[si]; scprintf(_SC("[%d] %s \t%d %d\n"),lvi._pos,_stringval(lvi._name),lvi._start_op,lvi._end_op); n++; } scprintf(_SC("-----LINE INFO\n")); for(i=0;i<_lineinfos.size();i++){ SQLineInfo li=_lineinfos[i]; scprintf(_SC("op [%d] line [%d] \n"),li._op,li._line); n++; } scprintf(_SC("-----dump\n")); n=0; for(i=0;i<_instructions.size();i++){ SQInstruction &inst=_instructions[i]; if(inst.op==_OP_LOAD || inst.op==_OP_DLOAD || inst.op==_OP_PREPCALLK || inst.op==_OP_GETK ){ SQInteger lidx = inst._arg1; scprintf(_SC("[%03d] %15s %d "),n,g_InstrDesc[inst.op].name,inst._arg0); if(lidx >= 0xFFFFFFFF) scprintf(_SC("null")); else { SQInteger refidx; SQObjectPtr val,key,refo; while(((refidx=_table(_literals)->Next(false,refo,key,val))!= -1) && (_integer(val) != lidx)) { refo = refidx; } DumpLiteral(key); } if(inst.op != _OP_DLOAD) { scprintf(_SC(" %d %d \n"),inst._arg2,inst._arg3); } else { scprintf(_SC(" %d "),inst._arg2); lidx = inst._arg3; if(lidx >= 0xFFFFFFFF) scprintf(_SC("null")); else { SQInteger refidx; SQObjectPtr val,key,refo; while(((refidx=_table(_literals)->Next(false,refo,key,val))!= -1) && (_integer(val) != lidx)) { refo = refidx; } DumpLiteral(key); scprintf(_SC("\n")); } } } else if(inst.op==_OP_LOADFLOAT) { scprintf(_SC("[%03d] %15s %d %f %d %d\n"),n,g_InstrDesc[inst.op].name,inst._arg0,*((SQFloat*)&inst._arg1),inst._arg2,inst._arg3); } /* else if(inst.op==_OP_ARITH){ scprintf(_SC("[%03d] %15s %d %d %d %c\n"),n,g_InstrDesc[inst.op].name,inst._arg0,inst._arg1,inst._arg2,inst._arg3); }*/ else { scprintf(_SC("[%03d] %15s %d %d %d %d\n"),n,g_InstrDesc[inst.op].name,inst._arg0,inst._arg1,inst._arg2,inst._arg3); } n++; } scprintf(_SC("-----\n")); scprintf(_SC("stack size[%d]\n"),func->_stacksize); scprintf(_SC("--------------------------------------------------------------------\n\n")); }
extern void DumpRegName( hw_reg_set regname ) { /*************************************************/ bool first; hw_reg_set name; first = true; name = regname; if( !HW_COvlap( name, HW_UNUSED ) ) { while( !HW_CEqual( name, HW_EMPTY ) ) { if( first ) { first = false; } else { DumpChar( ':' ); } #if _TARGET & _TARG_370 if( Check(&name,HW_G0) ) { DumpLiteral( "G0" ); continue; } if( Check(&name,HW_G1) ) { DumpLiteral( "G1" ); continue; } if( Check(&name,HW_G2) ) { DumpLiteral( "G2" ); continue; } if( Check(&name,HW_G3) ) { DumpLiteral( "G3" ); continue; } if( Check(&name,HW_G4) ) { DumpLiteral( "G4" ); continue; } if( Check(&name,HW_G5) ) { DumpLiteral( "G5" ); continue; } if( Check(&name,HW_G6) ) { DumpLiteral( "G6" ); continue; } if( Check(&name,HW_G7) ) { DumpLiteral( "G7" ); continue; } if( Check(&name,HW_G8) ) { DumpLiteral( "G8" ); continue; } if( Check(&name,HW_G9) ) { DumpLiteral( "G9" ); continue; } if( Check(&name,HW_G10)) { DumpLiteral( "G10" ); continue; } if( Check(&name,HW_G11)) { DumpLiteral( "G11" ); continue; } if( Check(&name,HW_G12)) { DumpLiteral( "G12" ); continue; } if( Check(&name,HW_G13)) { DumpLiteral( "G13" ); continue; } if( Check(&name,HW_G14)) { DumpLiteral( "G14" ); continue; } if( Check(&name,HW_G15)) { DumpLiteral( "G15" ); continue; } if( Check(&name,HW_E0) ) { DumpLiteral( "E0" ); continue; } if( Check(&name,HW_E4) ) { DumpLiteral( "E4" ); continue; } if( Check(&name,HW_D0) ) { DumpLiteral( "D0" ); continue; } if( Check(&name,HW_D2) ) { DumpLiteral( "D2" ); continue; } if( Check(&name,HW_D4) ) { DumpLiteral( "D4" ); continue; } if( Check(&name,HW_D6) ) { DumpLiteral( "D6" ); continue; } if( Check(&name,HW_Y0) ) { DumpLiteral( "Y0" ); continue; } if( Check(&name,HW_Y2) ) { DumpLiteral( "Y2" ); continue; } if( Check(&name,HW_Y4) ) { DumpLiteral( "Y4" ); continue; } if( Check(&name,HW_Y6) ) { DumpLiteral( "Y6" ); continue; } #endif #if _TARGET & (_TARG_PPC | _TARG_AXP | _TARG_MIPS) if( Check(&name,HW_R0) ) { DumpLiteral( "R0" ); continue; } if( Check(&name,HW_R1) ) { DumpLiteral( "R1" ); continue; } if( Check(&name,HW_R2) ) { DumpLiteral( "R2" ); continue; } if( Check(&name,HW_R3) ) { DumpLiteral( "R3" ); continue; } if( Check(&name,HW_R4) ) { DumpLiteral( "R4" ); continue; } if( Check(&name,HW_R5) ) { DumpLiteral( "R5" ); continue; } if( Check(&name,HW_R6) ) { DumpLiteral( "R6" ); continue; } if( Check(&name,HW_R7) ) { DumpLiteral( "R7" ); continue; } if( Check(&name,HW_R8) ) { DumpLiteral( "R8" ); continue; } if( Check(&name,HW_R9) ) { DumpLiteral( "R9" ); continue; } if( Check(&name,HW_R10) ) { DumpLiteral( "R10" ); continue; } if( Check(&name,HW_R11) ) { DumpLiteral( "R11" ); continue; } if( Check(&name,HW_R12) ) { DumpLiteral( "R12" ); continue; } if( Check(&name,HW_R13) ) { DumpLiteral( "R13" ); continue; } if( Check(&name,HW_R14) ) { DumpLiteral( "R14" ); continue; } if( Check(&name,HW_R15) ) { DumpLiteral( "R15" ); continue; } if( Check(&name,HW_R16) ) { DumpLiteral( "R16" ); continue; } if( Check(&name,HW_R17) ) { DumpLiteral( "R17" ); continue; } if( Check(&name,HW_R18) ) { DumpLiteral( "R18" ); continue; } if( Check(&name,HW_R19) ) { DumpLiteral( "R19" ); continue; } if( Check(&name,HW_R20) ) { DumpLiteral( "R20" ); continue; } if( Check(&name,HW_R21) ) { DumpLiteral( "R21" ); continue; } if( Check(&name,HW_R22) ) { DumpLiteral( "R22" ); continue; } if( Check(&name,HW_R23) ) { DumpLiteral( "R23" ); continue; } if( Check(&name,HW_R24) ) { DumpLiteral( "R24" ); continue; } if( Check(&name,HW_R25) ) { DumpLiteral( "R25" ); continue; } if( Check(&name,HW_R26) ) { DumpLiteral( "R26" ); continue; } if( Check(&name,HW_R27) ) { DumpLiteral( "R27" ); continue; } if( Check(&name,HW_R28) ) { DumpLiteral( "R28" ); continue; } if( Check(&name,HW_R29) ) { DumpLiteral( "R29" ); continue; } if( Check(&name,HW_R30) ) { DumpLiteral( "R30" ); continue; } if( Check(&name,HW_R31) ) { DumpLiteral( "R31" ); continue; } if( Check(&name,HW_D0) ) { DumpLiteral( "D0" ); continue; } if( Check(&name,HW_D1) ) { DumpLiteral( "D1" ); continue; } if( Check(&name,HW_D2) ) { DumpLiteral( "D2" ); continue; } if( Check(&name,HW_D3) ) { DumpLiteral( "D3" ); continue; } if( Check(&name,HW_D4) ) { DumpLiteral( "D4" ); continue; } if( Check(&name,HW_D5) ) { DumpLiteral( "D5" ); continue; } if( Check(&name,HW_D6) ) { DumpLiteral( "D6" ); continue; } if( Check(&name,HW_D7) ) { DumpLiteral( "D7" ); continue; } if( Check(&name,HW_D8) ) { DumpLiteral( "D8" ); continue; } if( Check(&name,HW_D9) ) { DumpLiteral( "D9" ); continue; } if( Check(&name,HW_D10) ) { DumpLiteral( "D10" ); continue; } if( Check(&name,HW_D11) ) { DumpLiteral( "D11" ); continue; } if( Check(&name,HW_D12) ) { DumpLiteral( "D12" ); continue; } if( Check(&name,HW_D13) ) { DumpLiteral( "D13" ); continue; } if( Check(&name,HW_D14) ) { DumpLiteral( "D14" ); continue; } if( Check(&name,HW_D15) ) { DumpLiteral( "D15" ); continue; } if( Check(&name,HW_D16) ) { DumpLiteral( "D16" ); continue; } if( Check(&name,HW_D17) ) { DumpLiteral( "D17" ); continue; } if( Check(&name,HW_D18) ) { DumpLiteral( "D18" ); continue; } if( Check(&name,HW_D19) ) { DumpLiteral( "D19" ); continue; } if( Check(&name,HW_D20) ) { DumpLiteral( "D20" ); continue; } if( Check(&name,HW_D21) ) { DumpLiteral( "D21" ); continue; } if( Check(&name,HW_D22) ) { DumpLiteral( "D22" ); continue; } if( Check(&name,HW_D23) ) { DumpLiteral( "D23" ); continue; } if( Check(&name,HW_D24) ) { DumpLiteral( "D24" ); continue; } if( Check(&name,HW_D25) ) { DumpLiteral( "D25" ); continue; } if( Check(&name,HW_D26) ) { DumpLiteral( "D26" ); continue; } if( Check(&name,HW_D27) ) { DumpLiteral( "D27" ); continue; } if( Check(&name,HW_D28) ) { DumpLiteral( "D28" ); continue; } if( Check(&name,HW_D29) ) { DumpLiteral( "D29" ); continue; } if( Check(&name,HW_D30) ) { DumpLiteral( "D30" ); continue; } if( Check(&name,HW_D31) ) { DumpLiteral( "D31" ); continue; } if( Check(&name,HW_W0) ) { DumpLiteral( "W0" ); continue; } if( Check(&name,HW_W1) ) { DumpLiteral( "W1" ); continue; } if( Check(&name,HW_W2) ) { DumpLiteral( "W2" ); continue; } if( Check(&name,HW_W3) ) { DumpLiteral( "W3" ); continue; } if( Check(&name,HW_W4) ) { DumpLiteral( "W4" ); continue; } if( Check(&name,HW_W5) ) { DumpLiteral( "W5" ); continue; } if( Check(&name,HW_W6) ) { DumpLiteral( "W6" ); continue; } if( Check(&name,HW_W7) ) { DumpLiteral( "W7" ); continue; } if( Check(&name,HW_W8) ) { DumpLiteral( "W8" ); continue; } if( Check(&name,HW_W9) ) { DumpLiteral( "W9" ); continue; } if( Check(&name,HW_W10) ) { DumpLiteral( "W10" ); continue; } if( Check(&name,HW_W11) ) { DumpLiteral( "W11" ); continue; } if( Check(&name,HW_W12) ) { DumpLiteral( "W12" ); continue; } if( Check(&name,HW_W13) ) { DumpLiteral( "W13" ); continue; } if( Check(&name,HW_W14) ) { DumpLiteral( "W14" ); continue; } if( Check(&name,HW_W15) ) { DumpLiteral( "W15" ); continue; } if( Check(&name,HW_W16) ) { DumpLiteral( "W16" ); continue; } if( Check(&name,HW_W17) ) { DumpLiteral( "W17" ); continue; } if( Check(&name,HW_W18) ) { DumpLiteral( "W18" ); continue; } if( Check(&name,HW_W19) ) { DumpLiteral( "W19" ); continue; } if( Check(&name,HW_W20) ) { DumpLiteral( "W20" ); continue; } if( Check(&name,HW_W21) ) { DumpLiteral( "W21" ); continue; } if( Check(&name,HW_W22) ) { DumpLiteral( "W22" ); continue; } if( Check(&name,HW_W23) ) { DumpLiteral( "W23" ); continue; } if( Check(&name,HW_W24) ) { DumpLiteral( "W24" ); continue; } if( Check(&name,HW_W25) ) { DumpLiteral( "W25" ); continue; } if( Check(&name,HW_W26) ) { DumpLiteral( "W26" ); continue; } if( Check(&name,HW_W27) ) { DumpLiteral( "W27" ); continue; } if( Check(&name,HW_W28) ) { DumpLiteral( "W28" ); continue; } if( Check(&name,HW_W29) ) { DumpLiteral( "W29" ); continue; } if( Check(&name,HW_W30) ) { DumpLiteral( "W30" ); continue; } if( Check(&name,HW_W31) ) { DumpLiteral( "W31" ); continue; } if( Check(&name,HW_B0) ) { DumpLiteral( "B0" ); continue; } if( Check(&name,HW_B1) ) { DumpLiteral( "B1" ); continue; } if( Check(&name,HW_B2) ) { DumpLiteral( "B2" ); continue; } if( Check(&name,HW_B3) ) { DumpLiteral( "B3" ); continue; } if( Check(&name,HW_B4) ) { DumpLiteral( "B4" ); continue; } if( Check(&name,HW_B5) ) { DumpLiteral( "B5" ); continue; } if( Check(&name,HW_B6) ) { DumpLiteral( "B6" ); continue; } if( Check(&name,HW_B7) ) { DumpLiteral( "B7" ); continue; } if( Check(&name,HW_B8) ) { DumpLiteral( "B8" ); continue; } if( Check(&name,HW_B9) ) { DumpLiteral( "B9" ); continue; } if( Check(&name,HW_B10) ) { DumpLiteral( "B10" ); continue; } if( Check(&name,HW_B11) ) { DumpLiteral( "B11" ); continue; } if( Check(&name,HW_B12) ) { DumpLiteral( "B12" ); continue; } if( Check(&name,HW_B13) ) { DumpLiteral( "B13" ); continue; } if( Check(&name,HW_B14) ) { DumpLiteral( "B14" ); continue; } if( Check(&name,HW_B15) ) { DumpLiteral( "B15" ); continue; } if( Check(&name,HW_B16) ) { DumpLiteral( "B16" ); continue; } if( Check(&name,HW_B17) ) { DumpLiteral( "B17" ); continue; } if( Check(&name,HW_B18) ) { DumpLiteral( "B18" ); continue; } if( Check(&name,HW_B19) ) { DumpLiteral( "B19" ); continue; } if( Check(&name,HW_B20) ) { DumpLiteral( "B20" ); continue; } if( Check(&name,HW_B21) ) { DumpLiteral( "B21" ); continue; } if( Check(&name,HW_B22) ) { DumpLiteral( "B22" ); continue; } if( Check(&name,HW_B23) ) { DumpLiteral( "B23" ); continue; } if( Check(&name,HW_B24) ) { DumpLiteral( "B24" ); continue; } if( Check(&name,HW_B25) ) { DumpLiteral( "B25" ); continue; } if( Check(&name,HW_B26) ) { DumpLiteral( "B26" ); continue; } if( Check(&name,HW_B27) ) { DumpLiteral( "B27" ); continue; } if( Check(&name,HW_B28) ) { DumpLiteral( "B28" ); continue; } if( Check(&name,HW_B29) ) { DumpLiteral( "B29" ); continue; } if( Check(&name,HW_B30) ) { DumpLiteral( "B30" ); continue; } if( Check(&name,HW_B31) ) { DumpLiteral( "B31" ); continue; } if( Check(&name,HW_F0) ) { DumpLiteral( "F0" ); continue; } if( Check(&name,HW_F1) ) { DumpLiteral( "F1" ); continue; } if( Check(&name,HW_F2) ) { DumpLiteral( "F2" ); continue; } if( Check(&name,HW_F3) ) { DumpLiteral( "F3" ); continue; } if( Check(&name,HW_F4) ) { DumpLiteral( "F4" ); continue; } if( Check(&name,HW_F5) ) { DumpLiteral( "F5" ); continue; } if( Check(&name,HW_F6) ) { DumpLiteral( "F6" ); continue; } if( Check(&name,HW_F7) ) { DumpLiteral( "F7" ); continue; } if( Check(&name,HW_F8) ) { DumpLiteral( "F8" ); continue; } if( Check(&name,HW_F9) ) { DumpLiteral( "F9" ); continue; } if( Check(&name,HW_F10) ) { DumpLiteral( "F10" ); continue; } if( Check(&name,HW_F11) ) { DumpLiteral( "F11" ); continue; } if( Check(&name,HW_F12) ) { DumpLiteral( "F12" ); continue; } if( Check(&name,HW_F13) ) { DumpLiteral( "F13" ); continue; } if( Check(&name,HW_F14) ) { DumpLiteral( "F14" ); continue; } if( Check(&name,HW_F15) ) { DumpLiteral( "F15" ); continue; } if( Check(&name,HW_F16) ) { DumpLiteral( "F16" ); continue; } if( Check(&name,HW_F17) ) { DumpLiteral( "F17" ); continue; } if( Check(&name,HW_F18) ) { DumpLiteral( "F18" ); continue; } if( Check(&name,HW_F19) ) { DumpLiteral( "F19" ); continue; } if( Check(&name,HW_F20) ) { DumpLiteral( "F20" ); continue; } if( Check(&name,HW_F21) ) { DumpLiteral( "F21" ); continue; } if( Check(&name,HW_F22) ) { DumpLiteral( "F22" ); continue; } if( Check(&name,HW_F23) ) { DumpLiteral( "F23" ); continue; } if( Check(&name,HW_F24) ) { DumpLiteral( "F24" ); continue; } if( Check(&name,HW_F25) ) { DumpLiteral( "F25" ); continue; } if( Check(&name,HW_F26) ) { DumpLiteral( "F26" ); continue; } if( Check(&name,HW_F27) ) { DumpLiteral( "F27" ); continue; } if( Check(&name,HW_F28) ) { DumpLiteral( "F28" ); continue; } if( Check(&name,HW_F29) ) { DumpLiteral( "F29" ); continue; } if( Check(&name,HW_F30) ) { DumpLiteral( "F30" ); continue; } if( Check(&name,HW_F31) ) { DumpLiteral( "F31" ); continue; } #endif #if 0 #if _TARGET & _TARG_PPC if( Check(&name,HW_CTR) ) { DumpLiteral( "CTR" ); continue; } if( Check(&name,HW_CR) ) { DumpLiteral( "CR" ); continue; } if( Check(&name,HW_MQ) ) { DumpLiteral( "MQ" ); continue; } if( Check(&name,HW_LR) ) { DumpLiteral( "LR" ); continue; } #endif #endif #if _TARGET & ( _TARG_80386 | _TARG_IAPX86 ) if( Check(&name,HW_EAX)) { DumpLiteral("EAX"); continue; } if( Check(&name,HW_AX) ) { DumpLiteral( "AX"); continue; } if( Check(&name,HW_AL) ) { DumpLiteral( "AL"); continue; } if( Check(&name,HW_AH) ) { DumpLiteral( "AH"); continue; } if( Check(&name,HW_EBX)) { DumpLiteral("EBX"); continue; } if( Check(&name,HW_BX) ) { DumpLiteral( "BX"); continue; } if( Check(&name,HW_BL) ) { DumpLiteral( "BL"); continue; } if( Check(&name,HW_BH) ) { DumpLiteral( "BH"); continue; } if( Check(&name,HW_ECX)) { DumpLiteral("ECX"); continue; } if( Check(&name,HW_CX) ) { DumpLiteral( "CX"); continue; } if( Check(&name,HW_CL) ) { DumpLiteral( "CL"); continue; } if( Check(&name,HW_CH) ) { DumpLiteral( "CH"); continue; } if( Check(&name,HW_EDX)) { DumpLiteral("EDX"); continue; } if( Check(&name,HW_DX) ) { DumpLiteral( "DX"); continue; } if( Check(&name,HW_DL) ) { DumpLiteral( "DL"); continue; } if( Check(&name,HW_DH) ) { DumpLiteral( "DH"); continue; } if( Check(&name,HW_EDI)) { DumpLiteral("EDI"); continue; } if( Check(&name,HW_DI) ) { DumpLiteral( "DI"); continue; } if( Check(&name,HW_ESI)) { DumpLiteral("ESI"); continue; } if( Check(&name,HW_SI) ) { DumpLiteral( "SI"); continue; } if( Check(&name,HW_BP)) { DumpLiteral("EBP"); continue; } if( Check(&name,HW_SP)) { DumpLiteral("ESP"); continue; } if( Check(&name,HW_GS) ) { DumpLiteral( "GS"); continue; } if( Check(&name,HW_FS) ) { DumpLiteral( "FS"); continue; } if( Check(&name,HW_ES) ) { DumpLiteral( "ES"); continue; } if( Check(&name,HW_DS) ) { DumpLiteral( "DS"); continue; } if( Check(&name,HW_CS) ) { DumpLiteral( "CS"); continue; } if( Check(&name,HW_SS) ) { DumpLiteral( "SS"); continue; } if( Check(&name,HW_ST0) ) { DumpLiteral( "ST(0)"); continue; } if( Check(&name,HW_ST1) ) { DumpLiteral( "ST(1)"); continue; } if( Check(&name,HW_ST2) ) { DumpLiteral( "ST(2)"); continue; } if( Check(&name,HW_ST3) ) { DumpLiteral( "ST(3)"); continue; } if( Check(&name,HW_ST4) ) { DumpLiteral( "ST(4)"); continue; } if( Check(&name,HW_ST5) ) { DumpLiteral( "ST(5)"); continue; } if( Check(&name,HW_ST6) ) { DumpLiteral( "ST(6)"); continue; } if( Check(&name,HW_ST7) ) { DumpLiteral( "ST(7)"); continue; } #endif break; } } }
extern void DumpAConf( conflict_node *conf ) { /************************************************/ DumpOperand( conf->name ); DumpLiteral( " id " ); DumpGBit( &conf->id.out_of_block ); DumpChar( ' ' ); DumpLBit( &conf->id.within_block ); DumpPossible( conf->possible ); DumpNL(); DumpLiteral( " " ); DumpInsRange( conf ); DumpLiteral( " Start block " ); DumpPtr( conf->start_block ); DumpNL(); DumpLiteral( " Conflicts with " ); DumpGBit( &conf->with.out_of_block ); DumpChar( ' ' ); DumpLBit( &conf->with.within_block ); DumpChar( ' ' ); DumpRegName( conf->with.regs ); DumpNL(); DumpLiteral( " Constrained " ); DumpInt( conf->num_constrained ); DumpLiteral( " vs " ); DumpInt( conf->available ); DumpNL(); if( _Is( conf, CST_SAVINGS_CALCULATED ) ) { DumpLiteral( " Savings " ); DumpLong( conf->savings ); DumpNL(); } if( _Is( conf, CST_CONFLICT_ON_HOLD ) ) { DumpLiteral( " On hold" ); DumpNL(); } if( _Is( conf, CST_CHANGES_OTHERS ) ) { DumpLiteral( " Changes Others" ); DumpNL(); } if( _Is( conf, CST_NEEDS_SEGMENT ) ) { DumpLiteral( " Needs segment" ); DumpNL(); } if( _Is( conf, CST_NEEDS_SEGMENT_SPLIT ) ) { DumpLiteral( " Needs segment split" ); DumpNL(); } if( _Is( conf, CST_SEGMENT_SPLIT ) ) { DumpLiteral( " Is segment split" ); DumpNL(); } if( _Is( conf, CST_NEEDS_INDEX ) ) { DumpLiteral( " Needs index" ); DumpNL(); } if( _Is( conf, CST_NEEDS_INDEX_SPLIT ) ) { DumpLiteral( " Needs index split" ); DumpNL(); } if( _Is( conf, CST_INDEX_SPLIT ) ) { DumpLiteral( " Is index split" ); DumpNL(); } }
extern void DumpOperand( name *operand ) { /********************************************/ char buffer[20]; hw_reg_set reg; name *base; if( operand->n.class == N_INDEXED ) { if( operand->i.base != NULL ) { if( !( operand->i.index_flags & X_FAKE_BASE ) ) { if( operand->i.index_flags & X_LOW_ADDR_BASE ) { DumpLiteral( "l^" ); } DumpOperand( operand->i.base ); if( operand->i.constant > 0 ) { DumpChar( '+' ); } } } if( operand->i.constant != 0 ) { DumpLong( operand->i.constant ); } DumpChar( '[' ); if( operand->i.index_flags & X_BASE ) { reg = operand->i.index->r.reg; #if _TARGET & ( _TARG_IAPX86 | _TARG_80386 ) if( HW_COvlap( reg, HW_SEGS ) ) { hw_reg_set tmp; tmp = reg; HW_COnlyOn( tmp, HW_SEGS ); DumpRegName( tmp ); DumpChar( ':' ); HW_CTurnOff( reg, HW_SEGS ); } #endif if( operand->i.index_flags & X_HIGH_BASE ) { DumpRegName( HighReg( reg ) ); DumpChar( '+' ); DumpRegName( LowReg( reg ) ); } else { DumpRegName( LowReg( reg ) ); DumpChar( '+' ); DumpRegName( HighReg( reg ) ); } } else { DumpOperand( operand->i.index ); } if( operand->i.scale != 0 ) { DumpChar( '*' ); DumpInt( 1 << operand->i.scale ); } if( operand->i.index_flags & ( X_ALIGNED_1 | X_ALIGNED_2 | X_ALIGNED_4 | X_ALIGNED_8 ) ) { DumpChar( '$' ); DumpInt( FlagsToAlignment( operand->i.index_flags ) ); } DumpChar( ']' ); base = operand->i.base; if( base != NULL ) { if( operand->i.index_flags & X_FAKE_BASE ) { DumpChar( '{' ); if( base->n.class == N_MEMORY ) { DumpXString( AskName(base->v.symbol, base->m.memory_type) ); } else if( base->n.class == N_TEMP ) { if( _FrontEndTmp( base ) ) { DumpXString( FEName( base->v.symbol ) ); } else { DumpOperand( base ); } } DumpChar( '}' ); } }
static void DumpBlkFlags( block *blk ) /************************************/ { if( blk->class & RETURN ) { DumpLiteral( "Ret " ); } else {
static void DoInfo( any_oc *oc ) { /**************************************/ switch( oc->oc_header.class & INFO_MASK ) { case INFO_LINE: DumpLiteral( "LINE " ); DumpInt( oc->oc_linenum.line ); if( oc->oc_linenum.label_line ) { DumpLiteral( " (Label)" ); } break; case INFO_LDONE: DumpLiteral( "LDONE " ); LblName( oc->oc_handle.handle, false ); break; case INFO_DEAD_JMP: DumpLiteral( "DEAD " ); DumpLiteral( "jmp " ); DoRef( &(oc->oc_handle) ); break; case INFO_DBG_RTN_BEG: DumpLiteral( "RTN BEGIN " ); DumpPtr( oc->oc_debug.ptr ); break; case INFO_DBG_BLK_BEG: DumpLiteral( "BLOCK BEGIN " ); DumpPtr( oc->oc_debug.ptr ); break; case INFO_DBG_PRO_END: DumpLiteral( "PROLOG END " ); DumpPtr( oc->oc_debug.ptr ); break; case INFO_DBG_EPI_BEG: DumpLiteral( "EPILOG BEGIN " ); DumpPtr( oc->oc_debug.ptr ); break; case INFO_DBG_BLK_END: DumpLiteral( "BLOCK END " ); DumpPtr( oc->oc_debug.ptr ); break; case INFO_DBG_RTN_END: DumpLiteral( "RTN END " ); DumpPtr( oc->oc_debug.ptr ); break; case INFO_SELECT: DumpLiteral( "SELECT TABLE " ); if( oc->oc_select.starts ) { DumpLiteral( "STARTS" ); } else { DumpLiteral( "ENDS" ); } break; default: DumpLiteral( "*** unknown info ***" ); break; } }
extern void DumpIV( induction *var ) { /****************************************/ induction *alias; invariant *invar; DumpPtr( var ); DumpLiteral( " " ); DumpOperand( var->name ); DumpLiteral( " = ( " ); if( _IsV( var, IV_BASIC ) ) { DumpLiteral( "**basic**" ); } else { if( var->ivtimes != NULL ) { DumpOperand( var->ivtimes ); DumpLiteral( " * " ); } if( var->times != 1 ) { DumpLong( var->times ); DumpLiteral( " * " ); } DumpOperand( var->basic->name ); } DumpLiteral( " )" ); if( var->plus != 0 ) { DumpLiteral( " + ( " ); DumpLong( var->plus ); DumpLiteral( " )" ); } if( var->ivtimes != NULL && var->plus2 != 0 ) { DumpLiteral( " + ( " ); DumpOperand( var->ivtimes ); DumpLiteral( " * " ); DumpLong( var->plus2 ); DumpLiteral( " )" ); } for( invar = var->invar; invar != NULL; invar = invar->next ) { DumpLiteral( " + ( " ); if( var->lasttimes >= invar->id ) { DumpOperand( var->ivtimes ); DumpLiteral( " * " ); } if( invar->times != 1 ) { DumpLong( invar->times ); DumpLiteral( " * " ); } DumpOperand( invar->name ); DumpLiteral( " )" ); } DumpNL(); DumpLiteral( " ins=" ); DumpPtr( var->ins ); DumpLiteral( " prev=" ); DumpPtr( var->prev ); DumpLiteral( " basic=" ); DumpOperand( var->basic->name ); if( _IsV( var, IV_ALIAS ) ) { DumpLiteral( " alias=" ); for( alias = var->alias; _IsV( alias, IV_ALIAS ); ) { alias = alias->alias; } DumpPtr( alias ); } DumpNL(); DumpLiteral( " Uses: " ); DumpInt( var->use_count ); DumpChar( ' ' ); if( _IsV( var, IV_BASIC ) ) { DumpLiteral( " Basic" ); } if( _IsV( var, IV_DEAD ) ) { DumpLiteral( " Dead" ); } if( _IsV( var, IV_SURVIVED ) ) { DumpLiteral( " Survived" ); } if( _IsV( var, IV_TOP ) ) { DumpLiteral( " Top" ); } if( _IsV( var, IV_INTRODUCED ) ) { DumpLiteral( " Introduced" ); } if( _IsV( var, IV_ALIAS ) ) { DumpLiteral( " Alias" ); } if( _IsV( var, IV_INDEXED ) ) { DumpLiteral( " Indexed" ); } if( _IsV( var, IV_USED ) ) { DumpLiteral( " Used" ); } DumpNL(); }