hw_reg_set MustSaveRegs( void ) /**********************************/ { hw_reg_set save; hw_reg_set tmp; HW_CAsgn( save, HW_FULL ); HW_TurnOff( save, CurrProc->state.modify ); HW_CTurnOff( save, HW_UNUSED ); if( CurrProc->state.attr & ROUTINE_MODIFY_EXACT ) { HW_TurnOff( save, CurrProc->state.return_reg ); } else { tmp = CurrProc->state.parm.used; HW_TurnOn( tmp, CurrProc->state.return_reg ); tmp = FullReg( tmp ); HW_TurnOff( save, tmp ); } tmp = StackReg(); HW_TurnOff( save, tmp ); if( HW_CEqual( CurrProc->state.return_reg, HW_EMPTY ) ) { tmp = ReturnReg( WD, _NPX( CurrProc->state.attr ) ); HW_TurnOff( save, tmp ); } tmp = CurrProc->state.unalterable; HW_TurnOff( tmp, DisplayReg() ); HW_TurnOff( tmp, StackReg() ); HW_TurnOff( save, tmp ); return( save ); }
void RegEdit::OnSocItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous) { Q_UNUSED(previous); if(current == 0) return; if(current->type() == SocTreeSocType) { SocTreeItem *item = dynamic_cast< SocTreeItem * >(current); DisplaySoc(item->GetRef()); } else if(current->type() == SocTreeDevType) { DevTreeItem *item = dynamic_cast< DevTreeItem * >(current); DisplayDev(item->GetRef()); } else if(current->type() == SocTreeRegType) { RegTreeItem *item = dynamic_cast< RegTreeItem * >(current); DisplayReg(item->GetRef()); } else if(current->type() == SocTreeFieldType) { FieldTreeItem *item = dynamic_cast< FieldTreeItem * >(current); DisplayField(item->GetRef()); } }
static name *DisplayField( int level ) /****************************************/ { name *reg; reg = AllocRegName( DisplayReg() ); return( AllocIndex( reg, NULL, (-2) * level, reg->n.name_class ) ); }
extern void SaveDisplay( opcode_defs op ) { /*********************************************/ name *reg; reg = AllocRegName( DisplayReg() ); AddIns( MakeUnary( op, reg, NULL, reg->n.name_class ) ); }
extern bool AskIsFrameIndex( name *op ) { /*********************************************/ name *bp; bp = AllocRegName( DisplayReg() ); return( op == AllocIndex( bp, NULL, -1, bp->n.name_class ) ); }
extern void BigGoto( int level ) /**********************************/ { name *reg; if( level != 0 ) { reg = AllocRegName( DisplayReg() ); AddIns( MakeMove( DisplayField( level ), reg, reg->n.name_class ) ); } }
extern void SetDisplay( name *temp ) { /****************************************/ name *reg; reg = AllocRegName( DisplayReg() ); AddIns( MakeMove( TempOffset( temp, TypePtr->length, reg->n.name_class ), reg, reg->n.name_class ) ); }
extern name *MakeDisplay( name *op, int level ) /*************************************************/ { name *temp; name *reg; reg = AllocRegName( DisplayReg() ); temp = AllocTemp( U2 ); AddIns( MakeMove( DisplayField( level ), temp, reg->n.name_class ) ); op = AllocIndex( temp, NULL, op->t.location, op->n.name_class ); return( op ); }
static void CheckOp( name **offsets, instruction *ins, name **pop ) { /************************************************************************ used by FixFarLocalRefs to change one far local reference to an index, using the appropriate multiple of 4K constant to get at the temporary. The constant values are adjusted after the prolog is generated. */ name *op; name *base; name *temp; unsigned_32 place; int i; instruction *new_ins; op = *pop; if( op->n.class == N_INDEXED ) { temp = op->i.index; if( temp->n.class != N_TEMP ) return; if( !( temp->t.temp_flags & FAR_LOCAL ) ) return; new_ins = MakeMove( temp, AllocTemp( temp->n.name_class ), temp->n.name_class ); *pop = ScaleIndex( new_ins->result, op->i.base, op->i.constant, op->n.class, op->n.size, op->i.scale, op->i.index_flags ); PrefixIns( ins, new_ins ); CheckOp( offsets, new_ins, &new_ins->operands[ 0 ] ); } if( op->n.class != N_TEMP ) return; if( !( op->t.temp_flags & FAR_LOCAL ) ) return; base = DeAlias( op ); place = base->t.location + ( op->v.offset - base->v.offset ); i = place/_4K; if( offsets[ i ] == NULL ) { /*set the symbol field in the AddrConst to non-NULL for score-boarder*/ new_ins = MakeMove( AllocAddrConst( (name *)&CurrProc, i, CONS_OFFSET, WD ), AllocTemp( WD ), WD ); offsets[ i ] = new_ins->result; PrefixIns( HeadBlock->ins.hd.next, new_ins ); } temp = AllocTemp( WD ), new_ins = MakeMove( offsets[ i ], temp, WD ); PrefixIns( ins, new_ins ); new_ins = MakeBinary( OP_ADD, temp, AllocRegName( DisplayReg() ), temp, WD); PrefixIns( ins, new_ins ); *pop = ScaleIndex( temp, op, place%_4K, op->n.name_class, op->n.size, 0, X_FAKE_BASE ); }
extern an PassProcParm( an rtn ) { /**************************************/ name *op; name *reg; op = AllocTemp( XX ); op->n.size = TypePtr->length + SizeDisplayReg(); reg = AllocRegName( DisplayReg() ); AddIns( MakeMove( GenIns( rtn ), TempOffset( op, 0, ClassPointer ), ClassPointer ) ); AddIns( MakeMove( reg, TempOffset( op, TypePtr->length, reg->n.name_class ), reg->n.name_class ) ); return( AddrName( op, TypeProcParm ) ); }
extern void BigLabel( void ) /******************************/ { instruction *ins; name *bp; name *sp; if( CurrProc->lex_level != 0 ) { bp = AllocRegName( DisplayReg() ); sp = AllocRegName( StackReg() ); ins = MakeUnary( OP_LA, AllocIndex( bp, NULL, -1, bp->n.name_class ), sp, sp->n.name_class ); } else { ins = MakeNop(); } ins->zap = (register_name *) AllocRegName( AllCacheRegs() ); ins->flags.nop_flags |= NOP_ZAP_INFO; AddIns( ins ); }