VirtualBox

Changeset 65773 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Feb 13, 2017 3:42:09 PM (8 years ago)
Author:
vboxsync
Message:

IEM: Use prefix indexed tables for group 12 .

Location:
trunk/src/VBox/VMM/VMMAll
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/IEMAllInstructions.cpp.h

    r65758 r65773  
    644644
    645645
     646/** Repeats a_fn four times.  For decoding tables. */
     647#define IEMOP_X4(a_fn) a_fn, a_fn, a_fn, a_fn
     648
    646649/*
    647650 * Include the tables.
  • trunk/src/VBox/VMM/VMMAll/IEMAllInstructionsTwoByte0f.cpp.h

    r65772 r65773  
    29222922
    29232923/** Opcode 0x66 0x0f 0x71 11/2. */
    2924 FNIEMOP_STUB_1(iemOp_Grp12_psrlw_Udq_Ib, uint8_t, bRm);
     2924FNIEMOP_STUB_1(iemOp_Grp12_vpsrlw_Hx_Ux_Ib, uint8_t, bRm);
    29252925
    29262926/** Opcode 0x0f 0x71 11/4. */
     
    29282928
    29292929/** Opcode 0x66 0x0f 0x71 11/4. */
    2930 FNIEMOP_STUB_1(iemOp_Grp12_psraw_Udq_Ib, uint8_t, bRm);
     2930FNIEMOP_STUB_1(iemOp_Grp12_vpsraw_Hx_Ux_Ib, uint8_t, bRm);
    29312931
    29322932/** Opcode 0x0f 0x71 11/6. */
     
    29342934
    29352935/** Opcode 0x66 0x0f 0x71 11/6. */
    2936 FNIEMOP_STUB_1(iemOp_Grp12_psllw_Udq_Ib, uint8_t, bRm);
     2936FNIEMOP_STUB_1(iemOp_Grp12_vpsllw_Hx_Ux_Ib, uint8_t, bRm);
     2937
     2938
     2939/**
     2940 * Group 12 jump table for register variant.
     2941 */
     2942IEM_STATIC const PFNIEMOPRM g_apfnGroup12RegReg[8*4] =
     2943{
     2944    /** @todo decode imm8? */
     2945    /* /0 */ IEMOP_X4(iemOp_InvalidWithRM),
     2946    /* /1 */ IEMOP_X4(iemOp_InvalidWithRM),
     2947    /* /2 */ iemOp_Grp12_psrlw_Nq_Ib,           iemOp_Grp12_vpsrlw_Hx_Ux_Ib,    iemOp_InvalidWithRM, iemOp_InvalidWithRM,
     2948    /* /3 */ IEMOP_X4(iemOp_InvalidWithRM),
     2949    /* /4 */ iemOp_Grp12_psraw_Nq_Ib,           iemOp_Grp12_vpsraw_Hx_Ux_Ib,    iemOp_InvalidWithRM, iemOp_InvalidWithRM,
     2950    /* /5 */ IEMOP_X4(iemOp_InvalidWithRM),
     2951    /* /6 */ iemOp_Grp12_psllw_Nq_Ib,           iemOp_Grp12_vpsllw_Hx_Ux_Ib,    iemOp_InvalidWithRM, iemOp_InvalidWithRM,
     2952    /* /7 */ IEMOP_X4(iemOp_InvalidWithRM)
     2953};
    29372954
    29382955
     
    29412958{
    29422959    uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm);
    2943     if ((bRm & X86_MODRM_MOD_MASK) != (3 << X86_MODRM_MOD_SHIFT))
    2944         return IEMOP_RAISE_INVALID_OPCODE();
    2945     switch ((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK)
    2946     {
    2947         case 0: case 1: case 3: case 5: case 7:
    2948             return IEMOP_RAISE_INVALID_OPCODE();
    2949         case 2:
    2950             switch (pVCpu->iem.s.fPrefixes & (IEM_OP_PRF_SIZE_OP | IEM_OP_PRF_REPZ | IEM_OP_PRF_REPNZ))
    2951             {
    2952                 case 0:                     return FNIEMOP_CALL_1(iemOp_Grp12_psrlw_Nq_Ib, bRm);
    2953                 case IEM_OP_PRF_SIZE_OP:    return FNIEMOP_CALL_1(iemOp_Grp12_psrlw_Udq_Ib, bRm);
    2954                 default:                    return IEMOP_RAISE_INVALID_OPCODE();
    2955             }
    2956         case 4:
    2957             switch (pVCpu->iem.s.fPrefixes & (IEM_OP_PRF_SIZE_OP | IEM_OP_PRF_REPZ | IEM_OP_PRF_REPNZ))
    2958             {
    2959                 case 0:                     return FNIEMOP_CALL_1(iemOp_Grp12_psraw_Nq_Ib, bRm);
    2960                 case IEM_OP_PRF_SIZE_OP:    return FNIEMOP_CALL_1(iemOp_Grp12_psraw_Udq_Ib, bRm);
    2961                 default:                    return IEMOP_RAISE_INVALID_OPCODE();
    2962             }
    2963         case 6:
    2964             switch (pVCpu->iem.s.fPrefixes & (IEM_OP_PRF_SIZE_OP | IEM_OP_PRF_REPZ | IEM_OP_PRF_REPNZ))
    2965             {
    2966                 case 0:                     return FNIEMOP_CALL_1(iemOp_Grp12_psllw_Nq_Ib, bRm);
    2967                 case IEM_OP_PRF_SIZE_OP:    return FNIEMOP_CALL_1(iemOp_Grp12_psllw_Udq_Ib, bRm);
    2968                 default:                    return IEMOP_RAISE_INVALID_OPCODE();
    2969             }
    2970         IEM_NOT_REACHED_DEFAULT_CASE_RET();
    2971     }
     2960    if ((bRm & X86_MODRM_MOD_MASK) == (3 << X86_MODRM_MOD_SHIFT))
     2961    {
     2962        /* register, register */
     2963        return FNIEMOP_CALL_1(g_apfnGroup12RegReg[((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) * 4 + pVCpu->iem.s.idxPrefix], bRm);
     2964    }
     2965
     2966    /** @todo decode SIB, disp?   */
     2967    return IEMOP_RAISE_INVALID_OPCODE();
    29722968}
    29732969
     
    76447640
    76457641
    7646 /** Repeats a_fn four times.  For decoding tables. */
    7647 #define IEMOP_X4(a_fn) a_fn, a_fn, a_fn, a_fn
    7648 
    76497642/**
    76507643 * Two byte opcode map, first byte 0x0f.
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette