core/x86/instr.c
/* returns the OPSZ_ field appropriate for the register */
returns the OPSZ_ field appropriate for the register
returns the OPSZ_ field appropriate for the register
opnd_size_t
reg_get_size(reg_id_t reg)
{
#ifdef X64
    if (reg >= REG_START_64 && reg <= REG_STOP_64)
        return OPSZ_8;
#endif
    if (reg >= REG_START_32 && reg <= REG_STOP_32)
        return OPSZ_4;
    if (reg >= REG_START_8 && reg <= REG_STOP_8)
        return OPSZ_1;
#ifdef X64
    if (reg >= REG_START_x64_8 && reg <= REG_STOP_x64_8) 
        return OPSZ_1;
#endif
    if (reg >= REG_START_16 && reg <= REG_STOP_16)
        return OPSZ_2;
    if (reg >= REG_START_MMX && reg <= REG_STOP_MMX)
        return OPSZ_8;
    if (reg >= REG_START_XMM && reg <= REG_STOP_XMM)
        return OPSZ_16;
    if (reg >= REG_START_SEGMENT && reg <= REG_STOP_SEGMENT)
        return OPSZ_2;
    if (reg >= REG_START_DR && reg <= REG_STOP_DR)
        return IF_X64_ELSE(OPSZ_8, OPSZ_4);
    if (reg >= REG_START_CR && reg <= REG_STOP_CR)
        return IF_X64_ELSE(OPSZ_8, OPSZ_4);
    if (reg >= REG_START_FLOAT && reg <= REG_STOP_FLOAT)
        return OPSZ_10;
    CLIENT_ASSERT(false, "reg_get_size: invalid register");
    return OPSZ_NA;
}
opnd_size_t reg_get_size ( reg_id_t reg ) { #ifdef X64 if ( reg >= REG_START_64 && reg <= REG_STOP_64 ) return OPSZ_8 ; #endif if ( reg >= REG_START_32 && reg <= REG_STOP_32 ) return OPSZ_4 ; if ( reg >= REG_START_8 && reg <= REG_STOP_8 ) return OPSZ_1 ; #ifdef X64 if ( reg >= REG_START_x64_8 && reg <= REG_STOP_x64_8 ) return OPSZ_1 ; #endif if ( reg >= REG_START_16 && reg <= REG_STOP_16 ) return OPSZ_2 ; if ( reg >= REG_START_MMX && reg <= REG_STOP_MMX ) return OPSZ_8 ; if ( reg >= REG_START_XMM && reg <= REG_STOP_XMM ) return OPSZ_16 ; if ( reg >= REG_START_SEGMENT && reg <= REG_STOP_SEGMENT ) return OPSZ_2 ; if ( reg >= REG_START_DR && reg <= REG_STOP_DR ) return IF_X64_ELSE ( OPSZ_8 , OPSZ_4 ) ; if ( reg >= REG_START_CR && reg <= REG_STOP_CR ) return IF_X64_ELSE ( OPSZ_8 , OPSZ_4 ) ; if ( reg >= REG_START_FLOAT && reg <= REG_STOP_FLOAT ) return OPSZ_10 ; CLIENT_ASSERT ( false , " " ) ; return OPSZ_NA ; }
returns the OPSZ_ field appropriate for the register
returns the OPSZ_ field appropriate for the register
/* alternates to AH-BH */ /* i#176 add reg size handling for floating point registers */