TName DProcess::Name(void) const //FIXME: NOT IMPLEMENTED { return TName(); }
static instruction *FoldAbsolute( instruction *ins ) { /********************************************************* See below. */ instruction *new_ins; opcnt num_operands; name *result; tn fold; type_def *tipe; type_def *left_tipe; type_def *rite_tipe; type_def *fold_tipe; pointer left; pointer rite; name *tmp; name *new_const; float_handle value; tipe = ClassType( ins->type_class ); left_tipe = ClassType( _OpClass( ins ) ); num_operands = OpcodeNumOperands( ins ); left = NULL; rite = NULL; if( num_operands != 0 ) { left = TName( ins->operands[0], left_tipe ); if( num_operands > 1 ) { if( ins->operands[1]->n.type_class == XX ) { rite_tipe = tipe; } else { rite_tipe = ClassType( ins->operands[1]->n.type_class ); } rite = TName( ins->operands[1], rite_tipe ); } } fold = NULL; switch( ins->head.opcode ) { case OP_ADD: fold = FoldPlus( left, rite, tipe ); break; case OP_SUB: fold = FoldMinus( left, rite, tipe ); break; case OP_MUL: fold = FoldTimes( left, rite, tipe ); break; case OP_DIV: fold = FoldDiv( left, rite, tipe ); break; case OP_MOD: fold = FoldMod( left, rite, tipe ); break; case OP_AND: fold = FoldAnd( left, rite, tipe ); break; case OP_OR: fold = FoldOr( left, rite, tipe ); break; case OP_XOR: fold = FoldXor( left, rite, tipe ); break; case OP_RSHIFT: fold = FoldRShift( left, rite, tipe ); break; case OP_LSHIFT: fold = FoldLShift( left, rite, tipe ); break; case OP_NEGATE: fold = FoldUMinus( left, tipe ); break; case OP_COMPLEMENT: fold = Fold1sComp( left, tipe ); break; case OP_CONVERT: // look out for CNV PT U2 t1 type instructions; if sizeof( PT ) is greater // than sizeof( U2 ), we don't want to fold or we'll screw up based pointers if( IsTrickyPointerConv( ins ) ) return( NULL ); // fall through! case OP_ROUND: fold = FoldCnvRnd( (cg_op)ins->head.opcode, left, tipe ); break; case OP_CMP_EQUAL: case OP_CMP_NOT_EQUAL: case OP_CMP_GREATER: case OP_CMP_LESS_EQUAL: case OP_CMP_LESS: case OP_CMP_GREATER_EQUAL: if( ActiveCompare( ins ) ) { fold = FoldCompare( (cg_op)ins->head.opcode, left, rite, tipe ); if( fold != NULL ) { return( StraightLine( ins, fold, true ) ); } } break; case OP_BIT_TEST_TRUE: if( ActiveCompare( ins ) ) { fold = FoldAnd( left, rite, tipe ); if( fold != NULL ) { return( StraightLine( ins, fold, true ) ); } } break; case OP_BIT_TEST_FALSE: if( ActiveCompare( ins ) ) { fold = FoldAnd( left, rite, tipe ); if( fold != NULL ) { return( StraightLine( ins, fold, false ) ); } } break; default: fold = NULL; break; } if( fold != NULL ) { fold_tipe = fold->tipe; result = TGetName( fold ); if( result != NULL && !NeedConvert( fold_tipe, tipe ) ) { ins->table = NULL; // look out for scary DIV U4 EDX:EAX, c1 -> t1 type instructions if( result->n.class != N_CONSTANT && result->n.size != TypeClassSize[ins->type_class] ) return( NULL ); // look out for scary MUL U4 EDX:EAX, c1 -> t1 type instructions if( result->n.class != N_CONSTANT && ins->result->n.size != TypeClassSize[ins->type_class] ) return( NULL ); new_ins = MakeMove( result, ins->result, ins->type_class ); SetCSEBits( ins, new_ins ); DupSeg( ins, new_ins ); ReplIns( ins, new_ins ); return( new_ins ); }