VirtualBox

Changeset 104288 in vbox for trunk


Ignore:
Timestamp:
Apr 11, 2024 8:53:09 AM (9 months ago)
Author:
vboxsync
Message:

VMM/IEM: Convert all the ps{r,l}* isntructions to use a preprocessor body in preparation for the native emitters, bugref:10652

File:
1 edited

Legend:

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

    r104279 r104288  
    64906490
    64916491
     6492#if 0 /*unused*/
    64926493/**
    64936494 * Common worker for SSE2 instructions of the form:
     
    65306531    }
    65316532}
     6533#endif
     6534
     6535
     6536/**
     6537 * Preprocessor macro variant of iemOpCommonSse2_Shift_Imm
     6538 */
     6539#define SSE2_SHIFT_BODY_Imm(a_Ins, a_bRm, a_fRegNativeArchs) \
     6540        if (IEM_IS_MODRM_REG_MODE((a_bRm))) \
     6541        { \
     6542            /* \
     6543             * Register, immediate. \
     6544             */ \
     6545            IEM_MC_BEGIN(0, 0); \
     6546            uint8_t bImm; IEM_OPCODE_GET_NEXT_U8(&bImm); \
     6547            IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX_EX(fSse2); \
     6548            IEM_MC_MAYBE_RAISE_SSE_RELATED_XCPT(); \
     6549            IEM_MC_PREPARE_SSE_USAGE(); \
     6550            IEM_MC_NATIVE_IF(a_fRegNativeArchs) { \
     6551                IEM_MC_NATIVE_EMIT_2(RT_CONCAT3(iemNativeEmit_,a_Ins,_ri_u128), IEM_GET_MODRM_RM(pVCpu, (a_bRm)), bImm); \
     6552            } IEM_MC_NATIVE_ELSE() { \
     6553                IEM_MC_ARG(PRTUINT128U,         pDst, 0); \
     6554                IEM_MC_ARG_CONST(uint8_t,       bShiftArg, /*=*/ bImm, 1); \
     6555                IEM_MC_REF_XREG_U128(pDst, IEM_GET_MODRM_RM(pVCpu, (a_bRm))); \
     6556                IEM_MC_CALL_VOID_AIMPL_2(RT_CONCAT3(iemAImpl_,a_Ins,_imm_u128), pDst, bShiftArg); \
     6557            } IEM_MC_NATIVE_ENDIF(); \
     6558            IEM_MC_ADVANCE_RIP_AND_FINISH(); \
     6559            IEM_MC_END(); \
     6560        } \
     6561        else \
     6562        { \
     6563            /* \
     6564             * Register, memory. \
     6565             */ \
     6566            AssertFailedReturn(VINF_SUCCESS); \
     6567        } (void)0
    65326568
    65336569
     
    65446580{
    65456581//    IEMOP_MNEMONIC2(RI, PSRLW, psrlw, Ux, Ib, DISOPTYPE_HARMLESS | DISOPTYPE_X86_SSE, 0);
    6546     return FNIEMOP_CALL_2(iemOpCommonSse2_Shift_Imm, bRm, iemAImpl_psrlw_imm_u128);
     6582    SSE2_SHIFT_BODY_Imm(psrlw, bRm, 0);
    65476583}
    65486584
     
    65606596{
    65616597//    IEMOP_MNEMONIC2(RI, PSRAW, psraw, Ux, Ib, DISOPTYPE_HARMLESS | DISOPTYPE_X86_SSE, 0);
    6562     return FNIEMOP_CALL_2(iemOpCommonSse2_Shift_Imm, bRm, iemAImpl_psraw_imm_u128);
     6598    SSE2_SHIFT_BODY_Imm(psraw, bRm, 0);
    65636599}
    65646600
     
    65766612{
    65776613//    IEMOP_MNEMONIC2(RI, PSLLW, psllw, Ux, Ib, DISOPTYPE_HARMLESS | DISOPTYPE_X86_SSE, 0);
    6578     return FNIEMOP_CALL_2(iemOpCommonSse2_Shift_Imm, bRm, iemAImpl_psllw_imm_u128);
     6614    SSE2_SHIFT_BODY_Imm(psllw, bRm, 0);
    65796615}
    65806616
     
    66216657{
    66226658//    IEMOP_MNEMONIC2(RI, PSRLD, psrld, Ux, Ib, DISOPTYPE_HARMLESS | DISOPTYPE_X86_SSE, 0);
    6623     return FNIEMOP_CALL_2(iemOpCommonSse2_Shift_Imm, bRm, iemAImpl_psrld_imm_u128);
     6659    SSE2_SHIFT_BODY_Imm(psrld, bRm, 0);
    66246660}
    66256661
     
    66376673{
    66386674//    IEMOP_MNEMONIC2(RI, PSRAD, psrad, Ux, Ib, DISOPTYPE_HARMLESS | DISOPTYPE_X86_SSE, 0);
    6639     return FNIEMOP_CALL_2(iemOpCommonSse2_Shift_Imm, bRm, iemAImpl_psrad_imm_u128);
     6675    SSE2_SHIFT_BODY_Imm(psrad, bRm, 0);
    66406676}
    66416677
     
    66526688{
    66536689//    IEMOP_MNEMONIC2(RI, PSLLD, pslld, Ux, Ib, DISOPTYPE_HARMLESS | DISOPTYPE_X86_SSE, 0);
    6654     return FNIEMOP_CALL_2(iemOpCommonSse2_Shift_Imm, bRm, iemAImpl_pslld_imm_u128);
     6690    SSE2_SHIFT_BODY_Imm(pslld, bRm, 0);
    66556691}
    66566692
     
    66966732{
    66976733//    IEMOP_MNEMONIC2(RI, PSRLQ, psrlq, Ux, Ib, DISOPTYPE_HARMLESS | DISOPTYPE_X86_SSE, 0);
    6698     return FNIEMOP_CALL_2(iemOpCommonSse2_Shift_Imm, bRm, iemAImpl_psrlq_imm_u128);
     6734    SSE2_SHIFT_BODY_Imm(psrlq, bRm, 0);
    66996735}
    67006736
     
    67046740{
    67056741//    IEMOP_MNEMONIC2(RI, PSRLDQ, psrldq, Ux, Ib, DISOPTYPE_HARMLESS | DISOPTYPE_X86_SSE, 0);
    6706     return FNIEMOP_CALL_2(iemOpCommonSse2_Shift_Imm, bRm, iemAImpl_psrldq_imm_u128);
     6742    SSE2_SHIFT_BODY_Imm(psrldq, bRm, 0);
    67076743}
    67086744
     
    67206756{
    67216757//    IEMOP_MNEMONIC2(RI, PSLLQ, psllq, Ux, Ib, DISOPTYPE_HARMLESS | DISOPTYPE_X86_SSE, 0);
    6722     return FNIEMOP_CALL_2(iemOpCommonSse2_Shift_Imm, bRm, iemAImpl_psllq_imm_u128);
     6758    SSE2_SHIFT_BODY_Imm(psllq, bRm, 0);
    67236759}
    67246760
     
    67286764{
    67296765//    IEMOP_MNEMONIC2(RI, PSLLDQ, pslldq, Ux, Ib, DISOPTYPE_HARMLESS | DISOPTYPE_X86_SSE, 0);
    6730     return FNIEMOP_CALL_2(iemOpCommonSse2_Shift_Imm, bRm, iemAImpl_pslldq_imm_u128);
     6766    SSE2_SHIFT_BODY_Imm(pslldq, bRm, 0);
    67316767}
    67326768
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