core/x86/instr.c
/* Shrinks all registers not used as addresses, and all immed int and
 * address sizes, to 16 bits
 */
Shrinks all registers not used as addresses, and all immed int and
address sizes, to 16 bits
Shrinks all registers not used as addresses and all immed int and address sizes to 16 bits
void
instr_shrink_to_16_bits(instr_t *instr)
{
    int i;
    opnd_t opnd;
    const instr_info_t * info;
    byte optype;
    CLIENT_ASSERT(instr_operands_valid(instr), "instr_shrink_to_16_bits: invalid opnds");
    info = get_encoding_info(instr);
    for (i=0; i<instr_num_dsts(instr); i++) {
        opnd = instr_get_dst(instr, i);
        optype = instr_info_opnd_type(info, false, i);
        if (!opnd_is_memory_reference(opnd) &&
            optype != TYPE_VAR_ADDR_XREG &&
            optype != TYPE_INDIR_VAR_XREG &&
            optype != TYPE_INDIR_VAR_REG &&
            optype != TYPE_INDIR_VAR_XIREG) {
            instr_set_dst(instr, i, opnd_shrink_to_16_bits(opnd));
        }
    }
    for (i=0; i<instr_num_srcs(instr); i++) {
        opnd = instr_get_src(instr, i);
        optype = instr_info_opnd_type(info, true, i);
        if (!opnd_is_memory_reference(opnd) &&
            optype != TYPE_VAR_ADDR_XREG &&
            optype != TYPE_INDIR_VAR_XREG &&
            optype != TYPE_INDIR_VAR_REG &&
            optype != TYPE_INDIR_VAR_XIREG) {
            instr_set_src(instr, i, opnd_shrink_to_16_bits(opnd));
        }
    }
}
void instr_shrink_to_16_bits ( instr_t * instr ) { int i ; opnd_t opnd ; const instr_info_t * info ; byte optype ; CLIENT_ASSERT ( instr_operands_valid ( instr ) , " " ) ; info = get_encoding_info ( instr ) ; for ( i = 0 ; i < instr_num_dsts ( instr ) ; i ++ ) { opnd = instr_get_dst ( instr , i ) ; optype = instr_info_opnd_type ( info , false , i ) ; if ( ! opnd_is_memory_reference ( opnd ) && optype != TYPE_VAR_ADDR_XREG && optype != TYPE_INDIR_VAR_XREG && optype != TYPE_INDIR_VAR_REG && optype != TYPE_INDIR_VAR_XIREG ) { instr_set_dst ( instr , i , opnd_shrink_to_16_bits ( opnd ) ) ; } } for ( i = 0 ; i < instr_num_srcs ( instr ) ; i ++ ) { opnd = instr_get_src ( instr , i ) ; optype = instr_info_opnd_type ( info , true , i ) ; if ( ! opnd_is_memory_reference ( opnd ) && optype != TYPE_VAR_ADDR_XREG && optype != TYPE_INDIR_VAR_XREG && optype != TYPE_INDIR_VAR_REG && optype != TYPE_INDIR_VAR_XIREG ) { instr_set_src ( instr , i , opnd_shrink_to_16_bits ( opnd ) ) ; } } }
Shrinks all registers not used as addresses, and all immed int and
 address sizes, to 16 bits
Shrinks all registers not used as addresses and all immed int and address sizes to 16 bits
/* some non-memory references vary in size by addr16, not data16:
         * e.g., the edi/esi inc/dec of string instrs
         */ /*dst*/ /*dst*/