VirtualBox

Changeset 95522 in vbox for trunk/src/VBox/VMM/VMMAll


Ignore:
Timestamp:
Jul 5, 2022 9:36:07 PM (3 years ago)
Author:
vboxsync
Message:

VMM/IEM: Implemented [v]packsswb, [v]packssdw, [v]packuswb and [v]packusdw. bugref:9898

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/IEMAllAImpl.asm

    r95509 r95522  
    36243624
    36253625;;
     3626; Media instruction working on two full sized registers, but no FXSAVE state argument.
     3627;
     3628; @param    1       The instruction
     3629; @param    2       Whether there is an MMX variant (1) or not (0).
     3630;
     3631; @param    A0      Pointer to the first media register size operand (input/output).
     3632; @param    A1      Pointer to the second media register size operand (input).
     3633;
     3634%macro IEMIMPL_MEDIA_OPT_F2 2
     3635%if %2 != 0
     3636BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u64, 8
     3637        PROLOGUE_2_ARGS
     3638        IEMIMPL_MMX_PROLOGUE
     3639
     3640        movq    mm0, [A0]
     3641        movq    mm1, [A1]
     3642        %1      mm0, mm1
     3643        movq    [A0], mm0
     3644
     3645        IEMIMPL_MMX_EPILOGUE
     3646        EPILOGUE_2_ARGS
     3647ENDPROC iemAImpl_ %+ %1 %+ _u64
     3648%endif
     3649
     3650BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u128, 8
     3651        PROLOGUE_2_ARGS
     3652        IEMIMPL_SSE_PROLOGUE
     3653
     3654        movdqu   xmm0, [A0]
     3655        movdqu   xmm1, [A1]
     3656        %1       xmm0, xmm1
     3657        movdqu   [A0], xmm0
     3658
     3659        IEMIMPL_SSE_EPILOGUE
     3660        EPILOGUE_2_ARGS
     3661ENDPROC iemAImpl_ %+ %1 %+ _u128
     3662%endmacro
     3663
     3664IEMIMPL_MEDIA_OPT_F2 packsswb, 1
     3665IEMIMPL_MEDIA_OPT_F2 packssdw, 1
     3666IEMIMPL_MEDIA_OPT_F2 packuswb, 1
     3667IEMIMPL_MEDIA_OPT_F2 packusdw, 0
     3668
     3669
     3670;;
    36263671; Media instruction working on one full sized and one half sized register (lower half).
    36273672;
     
    39263971BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u256, 16
    39273972        PROLOGUE_4_ARGS
    3928         IEMIMPL_SSE_PROLOGUE
     3973        IEMIMPL_AVX_PROLOGUE
    39293974
    39303975        vmovdqu  ymm0, [A2]
     
    39614006
    39624007
     4008;;
     4009; Media instruction working on two full sized source registers and one destination (AVX),
     4010; but no XSAVE state pointer argument.
     4011;
     4012; @param    1       The instruction
     4013;
     4014; @param    A0      Pointer to the destination media register size operand (output).
     4015; @param    A1      Pointer to the first source media register size operand (input).
     4016; @param    A2      Pointer to the second source media register size operand (input).
     4017;
     4018%macro IEMIMPL_MEDIA_OPT_F3 1
     4019BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u128, 12
     4020        PROLOGUE_3_ARGS
     4021        IEMIMPL_AVX_PROLOGUE
     4022
     4023        vmovdqu  xmm0, [A1]
     4024        vmovdqu  xmm1, [A2]
     4025        %1       xmm0, xmm0, xmm1
     4026        vmovdqu  [A0], xmm0
     4027
     4028        IEMIMPL_AVX_PROLOGUE
     4029        EPILOGUE_3_ARGS
     4030ENDPROC iemAImpl_ %+ %1 %+ _u128
     4031
     4032BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u256, 12
     4033        PROLOGUE_3_ARGS
     4034        IEMIMPL_AVX_PROLOGUE
     4035
     4036        vmovdqu  ymm0, [A1]
     4037        vmovdqu  ymm1, [A2]
     4038        %1       ymm0, ymm0, ymm1
     4039        vmovdqu  [A0], ymm0
     4040
     4041        IEMIMPL_AVX_PROLOGUE
     4042        EPILOGUE_3_ARGS
     4043ENDPROC iemAImpl_ %+ %1 %+ _u256
     4044%endmacro
     4045
     4046IEMIMPL_MEDIA_OPT_F3 vpacksswb
     4047IEMIMPL_MEDIA_OPT_F3 vpackssdw
     4048IEMIMPL_MEDIA_OPT_F3 vpackuswb
     4049IEMIMPL_MEDIA_OPT_F3 vpackusdw
     4050
     4051
    39634052;
    39644053; The SSE 4.2 crc32
  • trunk/src/VBox/VMM/VMMAll/IEMAllAImplC.cpp

    r95509 r95522  
    91719171
    91729172/*
     9173 * PACKSSWB - signed words -> signed bytes
     9174 */
     9175#define SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(a_iWord) \
     9176        ( (uint16_t)((a_iWord) + 0x80) <= (uint16_t)0xff  \
     9177          ? (uint8_t)(a_iWord) \
     9178          : (uint8_t)0x7f + (uint8_t)(((a_iWord) >> 15) & 1) ) /* 0x7f = INT8_MAX; 0x80 = INT8_MIN; source bit 15 = sign */
     9179
     9180#ifdef IEM_WITHOUT_ASSEMBLY
     9181
     9182IEM_DECL_IMPL_DEF(void, iemAImpl_packsswb_u64,(uint64_t *puDst, uint64_t const *puSrc))
     9183{
     9184    RTUINT64U const uSrc2 = { *puSrc };
     9185    RTUINT64U const uSrc1 = { *puDst };
     9186    ASMCompilerBarrier();
     9187    RTUINT64U uDstOut;
     9188    uDstOut.au8[0]  = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc1.au16[0]);
     9189    uDstOut.au8[1]  = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc1.au16[1]);
     9190    uDstOut.au8[2]  = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc1.au16[2]);
     9191    uDstOut.au8[3]  = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc1.au16[3]);
     9192    uDstOut.au8[4]  = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc2.au16[0]);
     9193    uDstOut.au8[5]  = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc2.au16[1]);
     9194    uDstOut.au8[6]  = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc2.au16[2]);
     9195    uDstOut.au8[7]  = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc2.au16[3]);
     9196    *puDst = uDstOut.u;
     9197}
     9198
     9199
     9200IEM_DECL_IMPL_DEF(void, iemAImpl_packsswb_u128,(PRTUINT128U puDst, PCRTUINT128U puSrc))
     9201{
     9202    RTUINT128U const uSrc2 = { *puSrc };
     9203    RTUINT128U const uSrc1 = { *puDst };
     9204    ASMCompilerBarrier();
     9205    RTUINT128U uDstOut;
     9206    uDstOut.au8[ 0] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc1.au16[0]);
     9207    uDstOut.au8[ 1] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc1.au16[1]);
     9208    uDstOut.au8[ 2] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc1.au16[2]);
     9209    uDstOut.au8[ 3] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc1.au16[3]);
     9210    uDstOut.au8[ 4] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc1.au16[4]);
     9211    uDstOut.au8[ 5] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc1.au16[5]);
     9212    uDstOut.au8[ 6] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc1.au16[6]);
     9213    uDstOut.au8[ 7] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc1.au16[7]);
     9214    uDstOut.au8[ 8] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc2.au16[0]);
     9215    uDstOut.au8[ 9] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc2.au16[1]);
     9216    uDstOut.au8[10] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc2.au16[2]);
     9217    uDstOut.au8[11] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc2.au16[3]);
     9218    uDstOut.au8[12] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc2.au16[4]);
     9219    uDstOut.au8[13] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc2.au16[5]);
     9220    uDstOut.au8[14] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc2.au16[6]);
     9221    uDstOut.au8[15] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc2.au16[7]);
     9222    *puDst = uDstOut;
     9223}
     9224
     9225#endif
     9226
     9227IEM_DECL_IMPL_DEF(void, iemAImpl_vpacksswb_u128_fallback,(PRTUINT128U puDst, PCRTUINT128U puSrc1, PCRTUINT128U puSrc2))
     9228{
     9229    RTUINT128U const uSrc2 = { *puSrc2 };
     9230    RTUINT128U const uSrc1 = { *puSrc1 };
     9231    ASMCompilerBarrier();
     9232    RTUINT128U uDstOut;
     9233    uDstOut.au8[ 0] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc1.au16[0]);
     9234    uDstOut.au8[ 1] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc1.au16[1]);
     9235    uDstOut.au8[ 2] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc1.au16[2]);
     9236    uDstOut.au8[ 3] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc1.au16[3]);
     9237    uDstOut.au8[ 4] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc1.au16[4]);
     9238    uDstOut.au8[ 5] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc1.au16[5]);
     9239    uDstOut.au8[ 6] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc1.au16[6]);
     9240    uDstOut.au8[ 7] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc1.au16[7]);
     9241    uDstOut.au8[ 8] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc2.au16[0]);
     9242    uDstOut.au8[ 9] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc2.au16[1]);
     9243    uDstOut.au8[10] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc2.au16[2]);
     9244    uDstOut.au8[11] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc2.au16[3]);
     9245    uDstOut.au8[12] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc2.au16[4]);
     9246    uDstOut.au8[13] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc2.au16[5]);
     9247    uDstOut.au8[14] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc2.au16[6]);
     9248    uDstOut.au8[15] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc2.au16[7]);
     9249    *puDst = uDstOut;
     9250}
     9251
     9252
     9253IEM_DECL_IMPL_DEF(void, iemAImpl_vpacksswb_u256_fallback,(PRTUINT256U puDst, PCRTUINT256U puSrc1, PCRTUINT256U puSrc2))
     9254{
     9255    RTUINT256U const uSrc2 = { *puSrc2 };
     9256    RTUINT256U const uSrc1 = { *puSrc1 };
     9257    ASMCompilerBarrier();
     9258    RTUINT256U uDstOut;
     9259    uDstOut.au8[ 0] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc1.au16[0]);
     9260    uDstOut.au8[ 1] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc1.au16[1]);
     9261    uDstOut.au8[ 2] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc1.au16[2]);
     9262    uDstOut.au8[ 3] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc1.au16[3]);
     9263    uDstOut.au8[ 4] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc1.au16[4]);
     9264    uDstOut.au8[ 5] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc1.au16[5]);
     9265    uDstOut.au8[ 6] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc1.au16[6]);
     9266    uDstOut.au8[ 7] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc1.au16[7]);
     9267    uDstOut.au8[ 8] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc2.au16[0]);
     9268    uDstOut.au8[ 9] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc2.au16[1]);
     9269    uDstOut.au8[10] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc2.au16[2]);
     9270    uDstOut.au8[11] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc2.au16[3]);
     9271    uDstOut.au8[12] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc2.au16[4]);
     9272    uDstOut.au8[13] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc2.au16[5]);
     9273    uDstOut.au8[14] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc2.au16[6]);
     9274    uDstOut.au8[15] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc2.au16[7]);
     9275
     9276    uDstOut.au8[16] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc1.au16[ 8]);
     9277    uDstOut.au8[17] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc1.au16[ 9]);
     9278    uDstOut.au8[18] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc1.au16[10]);
     9279    uDstOut.au8[19] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc1.au16[11]);
     9280    uDstOut.au8[20] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc1.au16[12]);
     9281    uDstOut.au8[21] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc1.au16[13]);
     9282    uDstOut.au8[22] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc1.au16[14]);
     9283    uDstOut.au8[23] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc1.au16[15]);
     9284    uDstOut.au8[24] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc2.au16[ 8]);
     9285    uDstOut.au8[25] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc2.au16[ 9]);
     9286    uDstOut.au8[26] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc2.au16[10]);
     9287    uDstOut.au8[27] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc2.au16[11]);
     9288    uDstOut.au8[28] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc2.au16[12]);
     9289    uDstOut.au8[29] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc2.au16[13]);
     9290    uDstOut.au8[30] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc2.au16[14]);
     9291    uDstOut.au8[31] = SATURATED_SIGNED_WORD_TO_SIGNED_BYTE(uSrc2.au16[15]);
     9292    *puDst = uDstOut;
     9293}
     9294
     9295
     9296/*
     9297 * PACKUSWB - signed words -> unsigned bytes
     9298 */
     9299#define SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(a_iWord) \
     9300        ( (uint16_t)(a_iWord) <= (uint16_t)0xff  \
     9301          ? (uint8_t)(a_iWord) \
     9302          : (uint8_t)0xff * (uint8_t)((((a_iWord) >> 15) & 1) ^ 1) ) /* 0xff = UINT8_MAX; 0x00 == UINT8_MIN; source bit 15 = sign */
     9303
     9304#ifdef IEM_WITHOUT_ASSEMBLY
     9305
     9306IEM_DECL_IMPL_DEF(void, iemAImpl_packuswb_u64,(uint64_t *puDst, uint64_t const *puSrc))
     9307{
     9308    RTUINT64U const uSrc2 = { *puSrc };
     9309    RTUINT64U const uSrc1 = { *puDst };
     9310    ASMCompilerBarrier();
     9311    RTUINT64U uDstOut;
     9312    uDstOut.au8[0]  = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc1.au16[0]);
     9313    uDstOut.au8[1]  = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc1.au16[1]);
     9314    uDstOut.au8[2]  = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc1.au16[2]);
     9315    uDstOut.au8[3]  = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc1.au16[3]);
     9316    uDstOut.au8[4]  = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc2.au16[0]);
     9317    uDstOut.au8[5]  = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc2.au16[1]);
     9318    uDstOut.au8[6]  = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc2.au16[2]);
     9319    uDstOut.au8[7]  = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc2.au16[3]);
     9320    *puDst = uDstOut.u;
     9321}
     9322
     9323
     9324IEM_DECL_IMPL_DEF(void, iemAImpl_packuswb_u128,(PRTUINT128U puDst, PCRTUINT128U puSrc))
     9325{
     9326    RTUINT128U const uSrc2 = { *puSrc };
     9327    RTUINT128U const uSrc1 = { *puDst };
     9328    ASMCompilerBarrier();
     9329    RTUINT128U uDstOut;
     9330    uDstOut.au8[ 0] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc1.au16[0]);
     9331    uDstOut.au8[ 1] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc1.au16[1]);
     9332    uDstOut.au8[ 2] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc1.au16[2]);
     9333    uDstOut.au8[ 3] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc1.au16[3]);
     9334    uDstOut.au8[ 4] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc1.au16[4]);
     9335    uDstOut.au8[ 5] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc1.au16[5]);
     9336    uDstOut.au8[ 6] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc1.au16[6]);
     9337    uDstOut.au8[ 7] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc1.au16[7]);
     9338    uDstOut.au8[ 8] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc2.au16[0]);
     9339    uDstOut.au8[ 9] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc2.au16[1]);
     9340    uDstOut.au8[10] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc2.au16[2]);
     9341    uDstOut.au8[11] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc2.au16[3]);
     9342    uDstOut.au8[12] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc2.au16[4]);
     9343    uDstOut.au8[13] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc2.au16[5]);
     9344    uDstOut.au8[14] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc2.au16[6]);
     9345    uDstOut.au8[15] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc2.au16[7]);
     9346    *puDst = uDstOut;
     9347}
     9348
     9349#endif
     9350
     9351IEM_DECL_IMPL_DEF(void, iemAImpl_vpackuswb_u128_fallback,(PRTUINT128U puDst, PCRTUINT128U puSrc1, PCRTUINT128U puSrc2))
     9352{
     9353    RTUINT128U const uSrc2 = { *puSrc2 };
     9354    RTUINT128U const uSrc1 = { *puSrc1 };
     9355    ASMCompilerBarrier();
     9356    RTUINT128U uDstOut;
     9357    uDstOut.au8[ 0] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc1.au16[0]);
     9358    uDstOut.au8[ 1] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc1.au16[1]);
     9359    uDstOut.au8[ 2] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc1.au16[2]);
     9360    uDstOut.au8[ 3] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc1.au16[3]);
     9361    uDstOut.au8[ 4] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc1.au16[4]);
     9362    uDstOut.au8[ 5] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc1.au16[5]);
     9363    uDstOut.au8[ 6] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc1.au16[6]);
     9364    uDstOut.au8[ 7] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc1.au16[7]);
     9365    uDstOut.au8[ 8] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc2.au16[0]);
     9366    uDstOut.au8[ 9] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc2.au16[1]);
     9367    uDstOut.au8[10] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc2.au16[2]);
     9368    uDstOut.au8[11] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc2.au16[3]);
     9369    uDstOut.au8[12] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc2.au16[4]);
     9370    uDstOut.au8[13] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc2.au16[5]);
     9371    uDstOut.au8[14] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc2.au16[6]);
     9372    uDstOut.au8[15] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc2.au16[7]);
     9373    *puDst = uDstOut;
     9374}
     9375
     9376
     9377IEM_DECL_IMPL_DEF(void, iemAImpl_vpackuswb_u256_fallback,(PRTUINT256U puDst, PCRTUINT256U puSrc1, PCRTUINT256U puSrc2))
     9378{
     9379    RTUINT256U const uSrc2 = { *puSrc2 };
     9380    RTUINT256U const uSrc1 = { *puSrc1 };
     9381    ASMCompilerBarrier();
     9382    RTUINT256U uDstOut;
     9383    uDstOut.au8[ 0] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc1.au16[0]);
     9384    uDstOut.au8[ 1] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc1.au16[1]);
     9385    uDstOut.au8[ 2] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc1.au16[2]);
     9386    uDstOut.au8[ 3] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc1.au16[3]);
     9387    uDstOut.au8[ 4] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc1.au16[4]);
     9388    uDstOut.au8[ 5] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc1.au16[5]);
     9389    uDstOut.au8[ 6] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc1.au16[6]);
     9390    uDstOut.au8[ 7] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc1.au16[7]);
     9391    uDstOut.au8[ 8] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc2.au16[0]);
     9392    uDstOut.au8[ 9] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc2.au16[1]);
     9393    uDstOut.au8[10] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc2.au16[2]);
     9394    uDstOut.au8[11] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc2.au16[3]);
     9395    uDstOut.au8[12] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc2.au16[4]);
     9396    uDstOut.au8[13] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc2.au16[5]);
     9397    uDstOut.au8[14] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc2.au16[6]);
     9398    uDstOut.au8[15] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc2.au16[7]);
     9399
     9400    uDstOut.au8[16] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc1.au16[ 8]);
     9401    uDstOut.au8[17] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc1.au16[ 9]);
     9402    uDstOut.au8[18] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc1.au16[10]);
     9403    uDstOut.au8[19] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc1.au16[11]);
     9404    uDstOut.au8[20] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc1.au16[12]);
     9405    uDstOut.au8[21] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc1.au16[13]);
     9406    uDstOut.au8[22] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc1.au16[14]);
     9407    uDstOut.au8[23] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc1.au16[15]);
     9408    uDstOut.au8[24] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc2.au16[ 8]);
     9409    uDstOut.au8[25] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc2.au16[ 9]);
     9410    uDstOut.au8[26] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc2.au16[10]);
     9411    uDstOut.au8[27] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc2.au16[11]);
     9412    uDstOut.au8[28] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc2.au16[12]);
     9413    uDstOut.au8[29] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc2.au16[13]);
     9414    uDstOut.au8[30] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc2.au16[14]);
     9415    uDstOut.au8[31] = SATURATED_SIGNED_WORD_TO_UNSIGNED_BYTE(uSrc2.au16[15]);
     9416    *puDst = uDstOut;
     9417}
     9418
     9419
     9420/*
     9421 * PACKSSDW - signed dwords -> signed words
     9422 */
     9423#define SATURATED_SIGNED_DWORD_TO_SIGNED_WORD(a_iDword) \
     9424        ( (uint32_t)((a_iDword) + 0x8000) <= (uint16_t)0xffff  \
     9425          ? (uint16_t)(a_iDword) \
     9426          : (uint16_t)0x7fff + (uint16_t)(((a_iDword) >> 31) & 1) ) /* 0x7fff = INT16_MAX; 0x8000 = INT16_MIN; source bit 31 = sign */
     9427
     9428#ifdef IEM_WITHOUT_ASSEMBLY
     9429
     9430IEM_DECL_IMPL_DEF(void, iemAImpl_packssdw_u64,(uint64_t *puDst, uint64_t const *puSrc))
     9431{
     9432    RTUINT64U const uSrc2 = { *puSrc };
     9433    RTUINT64U const uSrc1 = { *puDst };
     9434    ASMCompilerBarrier();
     9435    RTUINT64U uDstOut;
     9436    uDstOut.au16[0]  = SATURATED_SIGNED_DWORD_TO_SIGNED_WORD(uSrc1.au32[0]);
     9437    uDstOut.au16[1]  = SATURATED_SIGNED_DWORD_TO_SIGNED_WORD(uSrc1.au32[1]);
     9438    uDstOut.au16[2]  = SATURATED_SIGNED_DWORD_TO_SIGNED_WORD(uSrc2.au32[0]);
     9439    uDstOut.au16[3]  = SATURATED_SIGNED_DWORD_TO_SIGNED_WORD(uSrc2.au32[1]);
     9440    *puDst = uDstOut.u;
     9441}
     9442
     9443
     9444IEM_DECL_IMPL_DEF(void, iemAImpl_packssdw_u128,(PRTUINT128U puDst, PCRTUINT128U puSrc))
     9445{
     9446    RTUINT128U const uSrc2 = { *puSrc };
     9447    RTUINT128U const uSrc1 = { *puDst };
     9448    ASMCompilerBarrier();
     9449    RTUINT128U uDstOut;
     9450    uDstOut.au16[ 0] = SATURATED_SIGNED_DWORD_TO_SIGNED_WORD(uSrc1.au32[0]);
     9451    uDstOut.au16[ 1] = SATURATED_SIGNED_DWORD_TO_SIGNED_WORD(uSrc1.au32[1]);
     9452    uDstOut.au16[ 2] = SATURATED_SIGNED_DWORD_TO_SIGNED_WORD(uSrc1.au32[2]);
     9453    uDstOut.au16[ 3] = SATURATED_SIGNED_DWORD_TO_SIGNED_WORD(uSrc1.au32[3]);
     9454    uDstOut.au16[ 4] = SATURATED_SIGNED_DWORD_TO_SIGNED_WORD(uSrc2.au32[0]);
     9455    uDstOut.au16[ 5] = SATURATED_SIGNED_DWORD_TO_SIGNED_WORD(uSrc2.au32[1]);
     9456    uDstOut.au16[ 6] = SATURATED_SIGNED_DWORD_TO_SIGNED_WORD(uSrc2.au32[2]);
     9457    uDstOut.au16[ 7] = SATURATED_SIGNED_DWORD_TO_SIGNED_WORD(uSrc2.au32[3]);
     9458    *puDst = uDstOut;
     9459}
     9460
     9461#endif
     9462
     9463IEM_DECL_IMPL_DEF(void, iemAImpl_vpackssdw_u128_fallback,(PRTUINT128U puDst, PCRTUINT128U puSrc1, PCRTUINT128U puSrc2))
     9464{
     9465    RTUINT128U const uSrc2 = { *puSrc2 };
     9466    RTUINT128U const uSrc1 = { *puSrc1 };
     9467    ASMCompilerBarrier();
     9468    RTUINT128U uDstOut;
     9469    uDstOut.au16[ 0] = SATURATED_SIGNED_DWORD_TO_SIGNED_WORD(uSrc1.au32[0]);
     9470    uDstOut.au16[ 1] = SATURATED_SIGNED_DWORD_TO_SIGNED_WORD(uSrc1.au32[1]);
     9471    uDstOut.au16[ 2] = SATURATED_SIGNED_DWORD_TO_SIGNED_WORD(uSrc1.au32[2]);
     9472    uDstOut.au16[ 3] = SATURATED_SIGNED_DWORD_TO_SIGNED_WORD(uSrc1.au32[3]);
     9473    uDstOut.au16[ 4] = SATURATED_SIGNED_DWORD_TO_SIGNED_WORD(uSrc2.au32[0]);
     9474    uDstOut.au16[ 5] = SATURATED_SIGNED_DWORD_TO_SIGNED_WORD(uSrc2.au32[1]);
     9475    uDstOut.au16[ 6] = SATURATED_SIGNED_DWORD_TO_SIGNED_WORD(uSrc2.au32[2]);
     9476    uDstOut.au16[ 7] = SATURATED_SIGNED_DWORD_TO_SIGNED_WORD(uSrc2.au32[3]);
     9477    *puDst = uDstOut;
     9478}
     9479
     9480
     9481IEM_DECL_IMPL_DEF(void, iemAImpl_vpackssdw_u256_fallback,(PRTUINT256U puDst, PCRTUINT256U puSrc1, PCRTUINT256U puSrc2))
     9482{
     9483    RTUINT256U const uSrc2 = { *puSrc2 };
     9484    RTUINT256U const uSrc1 = { *puSrc1 };
     9485    ASMCompilerBarrier();
     9486    RTUINT256U uDstOut;
     9487    uDstOut.au16[ 0] = SATURATED_SIGNED_DWORD_TO_SIGNED_WORD(uSrc1.au32[0]);
     9488    uDstOut.au16[ 1] = SATURATED_SIGNED_DWORD_TO_SIGNED_WORD(uSrc1.au32[1]);
     9489    uDstOut.au16[ 2] = SATURATED_SIGNED_DWORD_TO_SIGNED_WORD(uSrc1.au32[2]);
     9490    uDstOut.au16[ 3] = SATURATED_SIGNED_DWORD_TO_SIGNED_WORD(uSrc1.au32[3]);
     9491    uDstOut.au16[ 4] = SATURATED_SIGNED_DWORD_TO_SIGNED_WORD(uSrc2.au32[0]);
     9492    uDstOut.au16[ 5] = SATURATED_SIGNED_DWORD_TO_SIGNED_WORD(uSrc2.au32[1]);
     9493    uDstOut.au16[ 6] = SATURATED_SIGNED_DWORD_TO_SIGNED_WORD(uSrc2.au32[2]);
     9494    uDstOut.au16[ 7] = SATURATED_SIGNED_DWORD_TO_SIGNED_WORD(uSrc2.au32[3]);
     9495
     9496    uDstOut.au16[ 8] = SATURATED_SIGNED_DWORD_TO_SIGNED_WORD(uSrc1.au32[4]);
     9497    uDstOut.au16[ 9] = SATURATED_SIGNED_DWORD_TO_SIGNED_WORD(uSrc1.au32[5]);
     9498    uDstOut.au16[10] = SATURATED_SIGNED_DWORD_TO_SIGNED_WORD(uSrc1.au32[6]);
     9499    uDstOut.au16[11] = SATURATED_SIGNED_DWORD_TO_SIGNED_WORD(uSrc1.au32[7]);
     9500    uDstOut.au16[12] = SATURATED_SIGNED_DWORD_TO_SIGNED_WORD(uSrc2.au32[4]);
     9501    uDstOut.au16[13] = SATURATED_SIGNED_DWORD_TO_SIGNED_WORD(uSrc2.au32[5]);
     9502    uDstOut.au16[14] = SATURATED_SIGNED_DWORD_TO_SIGNED_WORD(uSrc2.au32[6]);
     9503    uDstOut.au16[15] = SATURATED_SIGNED_DWORD_TO_SIGNED_WORD(uSrc2.au32[7]);
     9504    *puDst = uDstOut;
     9505}
     9506
     9507
     9508/*
     9509 * PACKUSDW - signed dwords -> unsigned words
     9510 */
     9511#define SATURATED_SIGNED_DWORD_TO_UNSIGNED_WORD(a_iDword) \
     9512        ( (uint32_t)(a_iDword) <= (uint16_t)0xffff  \
     9513          ? (uint16_t)(a_iDword) \
     9514          : (uint16_t)0xffff * (uint16_t)((((a_iDword) >> 31) & 1) ^ 1) ) /* 0xffff = UINT16_MAX; source bit 31 = sign */
     9515
     9516#ifdef IEM_WITHOUT_ASSEMBLY
     9517IEM_DECL_IMPL_DEF(void, iemAImpl_packusdw_u128,(PRTUINT128U puDst, PCRTUINT128U puSrc))
     9518{
     9519    RTUINT128U const uSrc2 = { *puSrc };
     9520    RTUINT128U const uSrc1 = { *puDst };
     9521    ASMCompilerBarrier();
     9522    RTUINT128U uDstOut;
     9523    uDstOut.au16[ 0] = SATURATED_SIGNED_DWORD_TO_UNSIGNED_WORD(uSrc1.au32[0]);
     9524    uDstOut.au16[ 1] = SATURATED_SIGNED_DWORD_TO_UNSIGNED_WORD(uSrc1.au32[1]);
     9525    uDstOut.au16[ 2] = SATURATED_SIGNED_DWORD_TO_UNSIGNED_WORD(uSrc1.au32[2]);
     9526    uDstOut.au16[ 3] = SATURATED_SIGNED_DWORD_TO_UNSIGNED_WORD(uSrc1.au32[3]);
     9527    uDstOut.au16[ 4] = SATURATED_SIGNED_DWORD_TO_UNSIGNED_WORD(uSrc2.au32[0]);
     9528    uDstOut.au16[ 5] = SATURATED_SIGNED_DWORD_TO_UNSIGNED_WORD(uSrc2.au32[1]);
     9529    uDstOut.au16[ 6] = SATURATED_SIGNED_DWORD_TO_UNSIGNED_WORD(uSrc2.au32[2]);
     9530    uDstOut.au16[ 7] = SATURATED_SIGNED_DWORD_TO_UNSIGNED_WORD(uSrc2.au32[3]);
     9531    *puDst = uDstOut;
     9532}
     9533#endif
     9534
     9535IEM_DECL_IMPL_DEF(void, iemAImpl_vpackusdw_u128_fallback,(PRTUINT128U puDst, PCRTUINT128U puSrc1, PCRTUINT128U puSrc2))
     9536{
     9537    RTUINT128U const uSrc2 = { *puSrc2 };
     9538    RTUINT128U const uSrc1 = { *puSrc1 };
     9539    ASMCompilerBarrier();
     9540    RTUINT128U uDstOut;
     9541    uDstOut.au16[ 0] = SATURATED_SIGNED_DWORD_TO_UNSIGNED_WORD(uSrc1.au32[0]);
     9542    uDstOut.au16[ 1] = SATURATED_SIGNED_DWORD_TO_UNSIGNED_WORD(uSrc1.au32[1]);
     9543    uDstOut.au16[ 2] = SATURATED_SIGNED_DWORD_TO_UNSIGNED_WORD(uSrc1.au32[2]);
     9544    uDstOut.au16[ 3] = SATURATED_SIGNED_DWORD_TO_UNSIGNED_WORD(uSrc1.au32[3]);
     9545    uDstOut.au16[ 4] = SATURATED_SIGNED_DWORD_TO_UNSIGNED_WORD(uSrc2.au32[0]);
     9546    uDstOut.au16[ 5] = SATURATED_SIGNED_DWORD_TO_UNSIGNED_WORD(uSrc2.au32[1]);
     9547    uDstOut.au16[ 6] = SATURATED_SIGNED_DWORD_TO_UNSIGNED_WORD(uSrc2.au32[2]);
     9548    uDstOut.au16[ 7] = SATURATED_SIGNED_DWORD_TO_UNSIGNED_WORD(uSrc2.au32[3]);
     9549    *puDst = uDstOut;
     9550}
     9551
     9552
     9553IEM_DECL_IMPL_DEF(void, iemAImpl_vpackusdw_u256_fallback,(PRTUINT256U puDst, PCRTUINT256U puSrc1, PCRTUINT256U puSrc2))
     9554{
     9555    RTUINT256U const uSrc2 = { *puSrc2 };
     9556    RTUINT256U const uSrc1 = { *puSrc1 };
     9557    ASMCompilerBarrier();
     9558    RTUINT256U uDstOut;
     9559    uDstOut.au16[ 0] = SATURATED_SIGNED_DWORD_TO_UNSIGNED_WORD(uSrc1.au32[0]);
     9560    uDstOut.au16[ 1] = SATURATED_SIGNED_DWORD_TO_UNSIGNED_WORD(uSrc1.au32[1]);
     9561    uDstOut.au16[ 2] = SATURATED_SIGNED_DWORD_TO_UNSIGNED_WORD(uSrc1.au32[2]);
     9562    uDstOut.au16[ 3] = SATURATED_SIGNED_DWORD_TO_UNSIGNED_WORD(uSrc1.au32[3]);
     9563    uDstOut.au16[ 4] = SATURATED_SIGNED_DWORD_TO_UNSIGNED_WORD(uSrc2.au32[0]);
     9564    uDstOut.au16[ 5] = SATURATED_SIGNED_DWORD_TO_UNSIGNED_WORD(uSrc2.au32[1]);
     9565    uDstOut.au16[ 6] = SATURATED_SIGNED_DWORD_TO_UNSIGNED_WORD(uSrc2.au32[2]);
     9566    uDstOut.au16[ 7] = SATURATED_SIGNED_DWORD_TO_UNSIGNED_WORD(uSrc2.au32[3]);
     9567
     9568    uDstOut.au16[ 8] = SATURATED_SIGNED_DWORD_TO_UNSIGNED_WORD(uSrc1.au32[4]);
     9569    uDstOut.au16[ 9] = SATURATED_SIGNED_DWORD_TO_UNSIGNED_WORD(uSrc1.au32[5]);
     9570    uDstOut.au16[10] = SATURATED_SIGNED_DWORD_TO_UNSIGNED_WORD(uSrc1.au32[6]);
     9571    uDstOut.au16[11] = SATURATED_SIGNED_DWORD_TO_UNSIGNED_WORD(uSrc1.au32[7]);
     9572    uDstOut.au16[12] = SATURATED_SIGNED_DWORD_TO_UNSIGNED_WORD(uSrc2.au32[4]);
     9573    uDstOut.au16[13] = SATURATED_SIGNED_DWORD_TO_UNSIGNED_WORD(uSrc2.au32[5]);
     9574    uDstOut.au16[14] = SATURATED_SIGNED_DWORD_TO_UNSIGNED_WORD(uSrc2.au32[6]);
     9575    uDstOut.au16[15] = SATURATED_SIGNED_DWORD_TO_UNSIGNED_WORD(uSrc2.au32[7]);
     9576    *puDst = uDstOut;
     9577}
     9578
     9579
     9580/*
    91739581 * CRC32 (SEE 4.2).
    91749582 */
  • trunk/src/VBox/VMM/VMMAll/IEMAllInstructionsThree0f38.cpp.h

    r95516 r95522  
    3232 *
    3333 * Proper alignment of the 128-bit operand is enforced.
    34  * Exceptions type 4. SSE3 cpuid checks.
     34 * Exceptions type 4. SSSE3 cpuid checks.
    3535 *
    3636 * @sa  iemOpCommonSse2_FullFull_To_Full
     
    4646        IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX();
    4747        IEM_MC_BEGIN(2, 0);
    48         IEM_MC_ARG(PRTUINT128U,          pDst, 0);
    49         IEM_MC_ARG(PCRTUINT128U,         pSrc, 1);
     48        IEM_MC_ARG(PRTUINT128U,                 puDst, 0);
     49        IEM_MC_ARG(PCRTUINT128U,                puSrc, 1);
    5050        IEM_MC_MAYBE_RAISE_SSSE3_RELATED_XCPT();
    5151        IEM_MC_PREPARE_SSE_USAGE();
    52         IEM_MC_REF_XREG_U128(pDst, IEM_GET_MODRM_REG(pVCpu, bRm));
    53         IEM_MC_REF_XREG_U128_CONST(pSrc, IEM_GET_MODRM_RM(pVCpu, bRm));
    54         IEM_MC_CALL_SSE_AIMPL_2(pfnU128, pDst, pSrc);
     52        IEM_MC_REF_XREG_U128(puDst,            IEM_GET_MODRM_REG(pVCpu, bRm));
     53        IEM_MC_REF_XREG_U128_CONST(puSrc,      IEM_GET_MODRM_RM(pVCpu, bRm));
     54        IEM_MC_CALL_SSE_AIMPL_2(pfnU128, puDst, puSrc);
    5555        IEM_MC_ADVANCE_RIP();
    5656        IEM_MC_END();
     
    6262         */
    6363        IEM_MC_BEGIN(2, 2);
    64         IEM_MC_ARG(PRTUINT128U,                 pDst,       0);
     64        IEM_MC_ARG(PRTUINT128U,                 puDst,       0);
    6565        IEM_MC_LOCAL(RTUINT128U,                uSrc);
    66         IEM_MC_ARG_LOCAL_REF(PCRTUINT128U,      pSrc, uSrc, 1);
     66        IEM_MC_ARG_LOCAL_REF(PCRTUINT128U,      puSrc, uSrc, 1);
    6767        IEM_MC_LOCAL(RTGCPTR,                   GCPtrEffSrc);
    6868
     
    7373
    7474        IEM_MC_PREPARE_SSE_USAGE();
    75         IEM_MC_REF_XREG_U128(pDst, IEM_GET_MODRM_REG(pVCpu, bRm));
    76         IEM_MC_CALL_SSE_AIMPL_2(pfnU128, pDst, pSrc);
     75        IEM_MC_REF_XREG_U128(puDst,             IEM_GET_MODRM_REG(pVCpu, bRm));
     76        IEM_MC_CALL_SSE_AIMPL_2(pfnU128, puDst, puSrc);
     77
     78        IEM_MC_ADVANCE_RIP();
     79        IEM_MC_END();
     80    }
     81    return VINF_SUCCESS;
     82}
     83
     84
     85/**
     86 * Common worker for SSE4.1 instructions on the forms:
     87 *      pxxx    xmm1, xmm2/mem128
     88 *
     89 * Proper alignment of the 128-bit operand is enforced.
     90 * Exceptions type 4. SSE4.1 cpuid checks.
     91 *
     92 * @sa  iemOpCommonSse2_FullFull_To_Full, iemOpCommonSsse3_FullFull_To_Full,
     93 *      iemOpCommonSse42_FullFull_To_Full
     94 */
     95FNIEMOP_DEF_1(iemOpCommonSse41_FullFull_To_Full, PFNIEMAIMPLMEDIAF2U128, pfnU128)
     96{
     97    uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm);
     98    if (IEM_IS_MODRM_REG_MODE(bRm))
     99    {
     100        /*
     101         * Register, register.
     102         */
     103        IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX();
     104        IEM_MC_BEGIN(2, 0);
     105        IEM_MC_ARG(PRTUINT128U,                 puDst, 0);
     106        IEM_MC_ARG(PCRTUINT128U,                puSrc, 1);
     107        IEM_MC_MAYBE_RAISE_SSE41_RELATED_XCPT();
     108        IEM_MC_PREPARE_SSE_USAGE();
     109        IEM_MC_REF_XREG_U128(puDst,             IEM_GET_MODRM_REG(pVCpu, bRm));
     110        IEM_MC_REF_XREG_U128_CONST(puSrc,       IEM_GET_MODRM_RM(pVCpu, bRm));
     111        IEM_MC_CALL_SSE_AIMPL_2(pfnU128, puDst, puSrc);
     112        IEM_MC_ADVANCE_RIP();
     113        IEM_MC_END();
     114    }
     115    else
     116    {
     117        /*
     118         * Register, memory.
     119         */
     120        IEM_MC_BEGIN(2, 2);
     121        IEM_MC_ARG(PRTUINT128U,                 puDst,       0);
     122        IEM_MC_LOCAL(RTUINT128U,                uSrc);
     123        IEM_MC_ARG_LOCAL_REF(PCRTUINT128U,      puSrc, uSrc, 1);
     124        IEM_MC_LOCAL(RTGCPTR,                   GCPtrEffSrc);
     125
     126        IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffSrc, bRm, 0);
     127        IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX();
     128        IEM_MC_MAYBE_RAISE_SSE41_RELATED_XCPT();
     129        IEM_MC_FETCH_MEM_U128_ALIGN_SSE(uSrc, pVCpu->iem.s.iEffSeg, GCPtrEffSrc);
     130
     131        IEM_MC_PREPARE_SSE_USAGE();
     132        IEM_MC_REF_XREG_U128(puDst,             IEM_GET_MODRM_REG(pVCpu, bRm));
     133        IEM_MC_CALL_SSE_AIMPL_2(pfnU128, puDst, puSrc);
     134
     135        IEM_MC_ADVANCE_RIP();
     136        IEM_MC_END();
     137    }
     138    return VINF_SUCCESS;
     139}
     140
     141
     142/**
     143 * Common worker for SSE4.1 instructions on the forms:
     144 *      pxxx    xmm1, xmm2/mem128
     145 *
     146 * Proper alignment of the 128-bit operand is enforced.
     147 * Exceptions type 4. SSE4.1 cpuid checks.
     148 *
     149 * Unlike iemOpCommonSse41_FullFull_To_Full, the @a pfnU128 worker function
     150 * takes no FXSAVE state, just the operands.
     151 *
     152 * @sa  iemOpCommonSse2_FullFull_To_Full, iemOpCommonSsse3_FullFull_To_Full,
     153 *      iemOpCommonSse41_FullFull_To_Full, iemOpCommonSse42_FullFull_To_Full
     154 */
     155FNIEMOP_DEF_1(iemOpCommonSse41Opt_FullFull_To_Full, PFNIEMAIMPLMEDIAOPTF2U128, pfnU128)
     156{
     157    uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm);
     158    if (IEM_IS_MODRM_REG_MODE(bRm))
     159    {
     160        /*
     161         * Register, register.
     162         */
     163        IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX();
     164        IEM_MC_BEGIN(2, 0);
     165        IEM_MC_ARG(PRTUINT128U,                 puDst, 0);
     166        IEM_MC_ARG(PCRTUINT128U,                puSrc, 1);
     167        IEM_MC_MAYBE_RAISE_SSE41_RELATED_XCPT();
     168        IEM_MC_PREPARE_SSE_USAGE();
     169        IEM_MC_REF_XREG_U128(puDst,             IEM_GET_MODRM_REG(pVCpu, bRm));
     170        IEM_MC_REF_XREG_U128_CONST(puSrc,       IEM_GET_MODRM_RM(pVCpu, bRm));
     171        IEM_MC_CALL_VOID_AIMPL_2(pfnU128, puDst, puSrc);
     172        IEM_MC_ADVANCE_RIP();
     173        IEM_MC_END();
     174    }
     175    else
     176    {
     177        /*
     178         * Register, memory.
     179         */
     180        IEM_MC_BEGIN(2, 2);
     181        IEM_MC_ARG(PRTUINT128U,                 puDst,       0);
     182        IEM_MC_LOCAL(RTUINT128U,                uSrc);
     183        IEM_MC_ARG_LOCAL_REF(PCRTUINT128U,      puSrc, uSrc, 1);
     184        IEM_MC_LOCAL(RTGCPTR,                   GCPtrEffSrc);
     185
     186        IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffSrc, bRm, 0);
     187        IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX();
     188        IEM_MC_MAYBE_RAISE_SSE41_RELATED_XCPT();
     189        IEM_MC_FETCH_MEM_U128_ALIGN_SSE(uSrc, pVCpu->iem.s.iEffSeg, GCPtrEffSrc);
     190
     191        IEM_MC_PREPARE_SSE_USAGE();
     192        IEM_MC_REF_XREG_U128(puDst,             IEM_GET_MODRM_REG(pVCpu, bRm));
     193        IEM_MC_CALL_VOID_AIMPL_2(pfnU128, puDst, puSrc);
     194
     195        IEM_MC_ADVANCE_RIP();
     196        IEM_MC_END();
     197    }
     198    return VINF_SUCCESS;
     199}
     200
     201
     202/**
     203 * Common worker for SSE4.2 instructions on the forms:
     204 *      pxxx    xmm1, xmm2/mem128
     205 *
     206 * Proper alignment of the 128-bit operand is enforced.
     207 * Exceptions type 4. SSE4.2 cpuid checks.
     208 *
     209 * @sa  iemOpCommonSse2_FullFull_To_Full, iemOpCommonSsse3_FullFull_To_Full,
     210 *      iemOpCommonSse41_FullFull_To_Full
     211 */
     212FNIEMOP_DEF_1(iemOpCommonSse42_FullFull_To_Full, PFNIEMAIMPLMEDIAF2U128, pfnU128)
     213{
     214    uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm);
     215    if (IEM_IS_MODRM_REG_MODE(bRm))
     216    {
     217        /*
     218         * Register, register.
     219         */
     220        IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX();
     221        IEM_MC_BEGIN(2, 0);
     222        IEM_MC_ARG(PRTUINT128U,                 puDst, 0);
     223        IEM_MC_ARG(PCRTUINT128U,                puSrc, 1);
     224        IEM_MC_MAYBE_RAISE_SSE42_RELATED_XCPT();
     225        IEM_MC_PREPARE_SSE_USAGE();
     226        IEM_MC_REF_XREG_U128(puDst,             IEM_GET_MODRM_REG(pVCpu, bRm));
     227        IEM_MC_REF_XREG_U128_CONST(puSrc,       IEM_GET_MODRM_RM(pVCpu, bRm));
     228        IEM_MC_CALL_SSE_AIMPL_2(pfnU128, puDst, puSrc);
     229        IEM_MC_ADVANCE_RIP();
     230        IEM_MC_END();
     231    }
     232    else
     233    {
     234        /*
     235         * Register, memory.
     236         */
     237        IEM_MC_BEGIN(2, 2);
     238        IEM_MC_ARG(PRTUINT128U,                 puDst,       0);
     239        IEM_MC_LOCAL(RTUINT128U,                uSrc);
     240        IEM_MC_ARG_LOCAL_REF(PCRTUINT128U,      puSrc, uSrc, 1);
     241        IEM_MC_LOCAL(RTGCPTR,                   GCPtrEffSrc);
     242
     243        IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffSrc, bRm, 0);
     244        IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX();
     245        IEM_MC_MAYBE_RAISE_SSE42_RELATED_XCPT();
     246        IEM_MC_FETCH_MEM_U128_ALIGN_SSE(uSrc, pVCpu->iem.s.iEffSeg, GCPtrEffSrc);
     247
     248        IEM_MC_PREPARE_SSE_USAGE();
     249        IEM_MC_REF_XREG_U128(puDst,             IEM_GET_MODRM_REG(pVCpu, bRm));
     250        IEM_MC_CALL_SSE_AIMPL_2(pfnU128, puDst, puSrc);
    77251
    78252        IEM_MC_ADVANCE_RIP();
     
    218392FNIEMOP_STUB(iemOp_pmuldq_Vx_Wx);
    219393
    220 /**
    221  * Common worker for SSE4.1 instructions on the forms:
    222  *      pxxx    xmm1, xmm2/mem128
    223  *
    224  * Proper alignment of the 128-bit operand is enforced.
    225  * Exceptions type 4. SSE2 cpuid checks.
    226  *
    227  * @sa  iemOpCommonSse2_FullFull_To_Full
    228  */
    229 FNIEMOP_DEF_1(iemOpCommonSse41_FullFull_To_Full, PFNIEMAIMPLMEDIAF2U128, pfnU128)
    230 {
    231     uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm);
    232     if (IEM_IS_MODRM_REG_MODE(bRm))
    233     {
    234         /*
    235          * Register, register.
    236          */
    237         IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX();
    238         IEM_MC_BEGIN(2, 0);
    239         IEM_MC_ARG(PRTUINT128U,          pDst, 0);
    240         IEM_MC_ARG(PCRTUINT128U,         pSrc, 1);
    241         IEM_MC_MAYBE_RAISE_SSE41_RELATED_XCPT();
    242         IEM_MC_PREPARE_SSE_USAGE();
    243         IEM_MC_REF_XREG_U128(pDst, IEM_GET_MODRM_REG(pVCpu, bRm));
    244         IEM_MC_REF_XREG_U128_CONST(pSrc, IEM_GET_MODRM_RM(pVCpu, bRm));
    245         IEM_MC_CALL_SSE_AIMPL_2(pfnU128, pDst, pSrc);
    246         IEM_MC_ADVANCE_RIP();
    247         IEM_MC_END();
    248     }
    249     else
    250     {
    251         /*
    252          * Register, memory.
    253          */
    254         IEM_MC_BEGIN(2, 2);
    255         IEM_MC_ARG(PRTUINT128U,                 pDst,       0);
    256         IEM_MC_LOCAL(RTUINT128U,                uSrc);
    257         IEM_MC_ARG_LOCAL_REF(PCRTUINT128U,      pSrc, uSrc, 1);
    258         IEM_MC_LOCAL(RTGCPTR,                   GCPtrEffSrc);
    259 
    260         IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffSrc, bRm, 0);
    261         IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX();
    262         IEM_MC_MAYBE_RAISE_SSE41_RELATED_XCPT();
    263         IEM_MC_FETCH_MEM_U128_ALIGN_SSE(uSrc, pVCpu->iem.s.iEffSeg, GCPtrEffSrc);
    264 
    265         IEM_MC_PREPARE_SSE_USAGE();
    266         IEM_MC_REF_XREG_U128(pDst, IEM_GET_MODRM_REG(pVCpu, bRm));
    267         IEM_MC_CALL_SSE_AIMPL_2(pfnU128, pDst, pSrc);
    268 
    269         IEM_MC_ADVANCE_RIP();
    270         IEM_MC_END();
    271     }
    272     return VINF_SUCCESS;
    273 }
    274 
    275 
    276 /**
    277  * Common worker for SSE4.2 instructions on the forms:
    278  *      pxxx    xmm1, xmm2/mem128
    279  *
    280  * Proper alignment of the 128-bit operand is enforced.
    281  * Exceptions type 4. SSE2 cpuid checks.
    282  *
    283  * @sa  iemOpCommonSse2_FullFull_To_Full, iemOpCommonSse41_FullFull_To_Full
    284  */
    285 FNIEMOP_DEF_1(iemOpCommonSse42_FullFull_To_Full, PFNIEMAIMPLMEDIAF2U128, pfnU128)
    286 {
    287     uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm);
    288     if (IEM_IS_MODRM_REG_MODE(bRm))
    289     {
    290         /*
    291          * Register, register.
    292          */
    293         IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX();
    294         IEM_MC_BEGIN(2, 0);
    295         IEM_MC_ARG(PRTUINT128U,          pDst, 0);
    296         IEM_MC_ARG(PCRTUINT128U,         pSrc, 1);
    297         IEM_MC_MAYBE_RAISE_SSE42_RELATED_XCPT();
    298         IEM_MC_PREPARE_SSE_USAGE();
    299         IEM_MC_REF_XREG_U128(pDst, IEM_GET_MODRM_REG(pVCpu, bRm));
    300         IEM_MC_REF_XREG_U128_CONST(pSrc, IEM_GET_MODRM_RM(pVCpu, bRm));
    301         IEM_MC_CALL_SSE_AIMPL_2(pfnU128, pDst, pSrc);
    302         IEM_MC_ADVANCE_RIP();
    303         IEM_MC_END();
    304     }
    305     else
    306     {
    307         /*
    308          * Register, memory.
    309          */
    310         IEM_MC_BEGIN(2, 2);
    311         IEM_MC_ARG(PRTUINT128U,                 pDst,       0);
    312         IEM_MC_LOCAL(RTUINT128U,                uSrc);
    313         IEM_MC_ARG_LOCAL_REF(PCRTUINT128U,      pSrc, uSrc, 1);
    314         IEM_MC_LOCAL(RTGCPTR,                   GCPtrEffSrc);
    315 
    316         IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffSrc, bRm, 0);
    317         IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX();
    318         IEM_MC_MAYBE_RAISE_SSE42_RELATED_XCPT();
    319         IEM_MC_FETCH_MEM_U128_ALIGN_SSE(uSrc, pVCpu->iem.s.iEffSeg, GCPtrEffSrc);
    320 
    321         IEM_MC_PREPARE_SSE_USAGE();
    322         IEM_MC_REF_XREG_U128(pDst, IEM_GET_MODRM_REG(pVCpu, bRm));
    323         IEM_MC_CALL_SSE_AIMPL_2(pfnU128, pDst, pSrc);
    324 
    325         IEM_MC_ADVANCE_RIP();
    326         IEM_MC_END();
    327     }
    328     return VINF_SUCCESS;
    329 }
    330 
    331394
    332395/** Opcode 0x66 0x0f 0x38 0x29. */
     
    386449}
    387450
     451
    388452/** Opcode 0x66 0x0f 0x38 0x2b. */
    389 FNIEMOP_STUB(iemOp_packusdw_Vx_Wx);
     453FNIEMOP_DEF(iemOp_packusdw_Vx_Wx)
     454{
     455    IEMOP_MNEMONIC2(RM, PACKUSDW, packusdw, Vx, Wx, DISOPTYPE_HARMLESS | DISOPTYPE_SSE, 0);
     456    return FNIEMOP_CALL_1(iemOpCommonSse41Opt_FullFull_To_Full, iemAImpl_packusdw_u128);
     457}
     458
     459
    390460/*  Opcode 0x66 0x0f 0x38 0x2c - invalid (vex only). */
    391461/*  Opcode 0x66 0x0f 0x38 0x2d - invalid (vex only). */
  • trunk/src/VBox/VMM/VMMAll/IEMAllInstructionsTwoByte0f.cpp.h

    r95516 r95522  
    8686 * Common worker for MMX instructions on the form:
    8787 *      pxxx    mm1, mm2/mem64
     88 *
     89 * Unlike iemOpCommonMmx_FullFull_To_Full, the @a pfnU64 worker function takes
     90 * no FXSAVE state, just the operands.
     91 */
     92FNIEMOP_DEF_1(iemOpCommonMmxOpt_FullFull_To_Full, PFNIEMAIMPLMEDIAOPTF2U64, pfnU64)
     93{
     94    uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm);
     95    if (IEM_IS_MODRM_REG_MODE(bRm))
     96    {
     97        /*
     98         * Register, register.
     99         */
     100        /** @todo testcase: REX.B / REX.R and MMX register indexing. Ignored? */
     101        /** @todo testcase: REX.B / REX.R and segment register indexing. Ignored? */
     102        IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX();
     103        IEM_MC_BEGIN(2, 0);
     104        IEM_MC_ARG(uint64_t *,          pDst, 0);
     105        IEM_MC_ARG(uint64_t const *,    pSrc, 1);
     106        IEM_MC_MAYBE_RAISE_MMX_RELATED_XCPT();
     107        IEM_MC_PREPARE_FPU_USAGE();
     108        IEM_MC_REF_MREG_U64(pDst, IEM_GET_MODRM_REG_8(bRm));
     109        IEM_MC_REF_MREG_U64_CONST(pSrc, IEM_GET_MODRM_RM_8(bRm));
     110        IEM_MC_CALL_VOID_AIMPL_2(pfnU64, pDst, pSrc);
     111        IEM_MC_MODIFIED_MREG_BY_REF(pDst);
     112        IEM_MC_FPU_TO_MMX_MODE();
     113        IEM_MC_ADVANCE_RIP();
     114        IEM_MC_END();
     115    }
     116    else
     117    {
     118        /*
     119         * Register, memory.
     120         */
     121        IEM_MC_BEGIN(2, 2);
     122        IEM_MC_ARG(uint64_t *,                  pDst,       0);
     123        IEM_MC_LOCAL(uint64_t,                  uSrc);
     124        IEM_MC_ARG_LOCAL_REF(uint64_t const *,  pSrc, uSrc, 1);
     125        IEM_MC_LOCAL(RTGCPTR,                   GCPtrEffSrc);
     126
     127        IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffSrc, bRm, 0);
     128        IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX();
     129        IEM_MC_MAYBE_RAISE_MMX_RELATED_XCPT();
     130        IEM_MC_FETCH_MEM_U64(uSrc, pVCpu->iem.s.iEffSeg, GCPtrEffSrc);
     131
     132        IEM_MC_PREPARE_FPU_USAGE();
     133        IEM_MC_REF_MREG_U64(pDst, IEM_GET_MODRM_REG_8(bRm));
     134        IEM_MC_CALL_VOID_AIMPL_2(pfnU64, pDst, pSrc);
     135        IEM_MC_MODIFIED_MREG_BY_REF(pDst);
     136        IEM_MC_FPU_TO_MMX_MODE();
     137
     138        IEM_MC_ADVANCE_RIP();
     139        IEM_MC_END();
     140    }
     141    return VINF_SUCCESS;
     142}
     143
     144
     145/**
     146 * Common worker for MMX instructions on the form:
     147 *      pxxx    mm1, mm2/mem64
    88148 * that was introduced with SSE2.
    89149 */
     
    189249        IEM_MC_REF_XREG_U128(pDst, IEM_GET_MODRM_REG(pVCpu, bRm));
    190250        IEM_MC_CALL_SSE_AIMPL_2(pfnU128, pDst, pSrc);
     251
     252        IEM_MC_ADVANCE_RIP();
     253        IEM_MC_END();
     254    }
     255    return VINF_SUCCESS;
     256}
     257
     258
     259/**
     260 * Common worker for SSE2 instructions on the forms:
     261 *      pxxx    xmm1, xmm2/mem128
     262 *
     263 * Proper alignment of the 128-bit operand is enforced.
     264 * Exceptions type 4. SSE2 cpuid checks.
     265 *
     266 * Unlike iemOpCommonSse2_FullFull_To_Full, the @a pfnU128 worker function takes
     267 * no FXSAVE state, just the operands.
     268 *
     269 * @sa iemOpCommonSse41_FullFull_To_Full, iemOpCommonSse2_FullFull_To_Full
     270 */
     271FNIEMOP_DEF_1(iemOpCommonSse2Opt_FullFull_To_Full, PFNIEMAIMPLMEDIAOPTF2U128, pfnU128)
     272{
     273    uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm);
     274    if (IEM_IS_MODRM_REG_MODE(bRm))
     275    {
     276        /*
     277         * Register, register.
     278         */
     279        IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX();
     280        IEM_MC_BEGIN(2, 0);
     281        IEM_MC_ARG(PRTUINT128U,          pDst, 0);
     282        IEM_MC_ARG(PCRTUINT128U,         pSrc, 1);
     283        IEM_MC_MAYBE_RAISE_SSE2_RELATED_XCPT();
     284        IEM_MC_PREPARE_SSE_USAGE();
     285        IEM_MC_REF_XREG_U128(pDst, IEM_GET_MODRM_REG(pVCpu, bRm));
     286        IEM_MC_REF_XREG_U128_CONST(pSrc, IEM_GET_MODRM_RM(pVCpu, bRm));
     287        IEM_MC_CALL_VOID_AIMPL_2(pfnU128, pDst, pSrc);
     288        IEM_MC_ADVANCE_RIP();
     289        IEM_MC_END();
     290    }
     291    else
     292    {
     293        /*
     294         * Register, memory.
     295         */
     296        IEM_MC_BEGIN(2, 2);
     297        IEM_MC_ARG(PRTUINT128U,                 pDst,       0);
     298        IEM_MC_LOCAL(RTUINT128U,                uSrc);
     299        IEM_MC_ARG_LOCAL_REF(PCRTUINT128U,      pSrc, uSrc, 1);
     300        IEM_MC_LOCAL(RTGCPTR,                   GCPtrEffSrc);
     301
     302        IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffSrc, bRm, 0);
     303        IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX();
     304        IEM_MC_MAYBE_RAISE_SSE2_RELATED_XCPT();
     305        IEM_MC_FETCH_MEM_U128_ALIGN_SSE(uSrc, pVCpu->iem.s.iEffSeg, GCPtrEffSrc);
     306
     307        IEM_MC_PREPARE_SSE_USAGE();
     308        IEM_MC_REF_XREG_U128(pDst, IEM_GET_MODRM_REG(pVCpu, bRm));
     309        IEM_MC_CALL_VOID_AIMPL_2(pfnU128, pDst, pSrc);
    191310
    192311        IEM_MC_ADVANCE_RIP();
     
    34203539
    34213540/** Opcode      0x0f 0x63 - packsswb Pq, Qq */
    3422 FNIEMOP_STUB(iemOp_packsswb_Pq_Qq);
     3541FNIEMOP_DEF(iemOp_packsswb_Pq_Qq)
     3542{
     3543    IEMOP_MNEMONIC2(RM, PACKSSWB, packsswb, Pq, Qd, DISOPTYPE_HARMLESS | DISOPTYPE_MMX, 0);
     3544    return FNIEMOP_CALL_1(iemOpCommonMmxOpt_FullFull_To_Full, iemAImpl_packsswb_u64);
     3545}
     3546
     3547
    34233548/** Opcode 0x66 0x0f 0x63 - packsswb Vx, Wx */
    3424 FNIEMOP_STUB(iemOp_packsswb_Vx_Wx);
     3549FNIEMOP_DEF(iemOp_packsswb_Vx_Wx)
     3550{
     3551    IEMOP_MNEMONIC2(RM, PACKSSWB, packsswb, Vx, Wx, DISOPTYPE_HARMLESS | DISOPTYPE_SSE, 0);
     3552    return FNIEMOP_CALL_1(iemOpCommonSse2Opt_FullFull_To_Full, iemAImpl_packsswb_u128);
     3553}
     3554
     3555
    34253556/*  Opcode 0xf3 0x0f 0x63 - invalid */
    34263557
     
    34823613/*  Opcode 0xf3 0x0f 0x66 - invalid */
    34833614
     3615
    34843616/** Opcode      0x0f 0x67 - packuswb Pq, Qq */
    3485 FNIEMOP_STUB(iemOp_packuswb_Pq_Qq);
     3617FNIEMOP_DEF(iemOp_packuswb_Pq_Qq)
     3618{
     3619    IEMOP_MNEMONIC2(RM, PACKUSWB, packuswb, Pq, Qd, DISOPTYPE_HARMLESS | DISOPTYPE_MMX, 0);
     3620    return FNIEMOP_CALL_1(iemOpCommonMmxOpt_FullFull_To_Full, iemAImpl_packuswb_u64);
     3621}
     3622
     3623
    34863624/** Opcode 0x66 0x0f 0x67 - packuswb Vx, W */
    3487 FNIEMOP_STUB(iemOp_packuswb_Vx_W);
     3625FNIEMOP_DEF(iemOp_packuswb_Vx_W)
     3626{
     3627    IEMOP_MNEMONIC2(RM, PACKUSWB, packuswb, Vx, Wx, DISOPTYPE_HARMLESS | DISOPTYPE_SSE, 0);
     3628    return FNIEMOP_CALL_1(iemOpCommonSse2Opt_FullFull_To_Full, iemAImpl_packuswb_u128);
     3629}
     3630
     3631
    34883632/*  Opcode 0xf3 0x0f 0x67 - invalid */
    34893633
     
    36783822
    36793823/** Opcode      0x0f 0x6b - packssdw Pq, Qd */
    3680 FNIEMOP_STUB(iemOp_packssdw_Pq_Qd);
     3824FNIEMOP_DEF(iemOp_packssdw_Pq_Qd)
     3825{
     3826    IEMOP_MNEMONIC2(RM, PACKSSDW, packssdw, Pq, Qd, DISOPTYPE_HARMLESS | DISOPTYPE_MMX, 0);
     3827    return FNIEMOP_CALL_1(iemOpCommonMmxOpt_FullFull_To_Full, iemAImpl_packssdw_u64);
     3828}
     3829
     3830
    36813831/** Opcode 0x66 0x0f 0x6b - packssdw Vx, Wx */
    3682 FNIEMOP_STUB(iemOp_packssdw_Vx_Wx);
     3832FNIEMOP_DEF(iemOp_packssdw_Vx_Wx)
     3833{
     3834    IEMOP_MNEMONIC2(RM, PACKSSDW, packssdw, Vx, Wx, DISOPTYPE_HARMLESS | DISOPTYPE_SSE, 0);
     3835    return FNIEMOP_CALL_1(iemOpCommonSse2Opt_FullFull_To_Full, iemAImpl_packssdw_u128);
     3836}
     3837
     3838
    36833839/*  Opcode 0xf3 0x0f 0x6b - invalid */
    36843840
  • trunk/src/VBox/VMM/VMMAll/IEMAllInstructionsVexMap1.cpp.h

    r95517 r95522  
    21472147
    21482148/*  Opcode VEX.0F 0x63 - invalid */
     2149
     2150
    21492151/** Opcode VEX.66.0F 0x63 - vpacksswb Vx, Hx, Wx */
    2150 FNIEMOP_STUB(iemOp_vpacksswb_Vx_Hx_Wx);
     2152FNIEMOP_DEF(iemOp_vpacksswb_Vx_Hx_Wx)
     2153{
     2154    IEMOP_MNEMONIC3(VEX_RVM, VPACKSSWB, vpacksswb, Vx, Hx, Wx, DISOPTYPE_HARMLESS | DISOPTYPE_AVX, 0);
     2155    IEMOPMEDIAOPTF3_INIT_VARS(          vpacksswb);
     2156    return FNIEMOP_CALL_1(iemOpCommonAvxAvx2_Vx_Hx_Wx_Opt, IEM_SELECT_HOST_OR_FALLBACK(fAvx2, &s_Host, &s_Fallback));
     2157}
     2158
     2159
    21512160/*  Opcode VEX.F3.0F 0x63 - invalid */
    21522161
     
    21942203
    21952204/*  Opcode VEX.0F 0x67 - invalid */
     2205
     2206
    21962207/** Opcode VEX.66.0F 0x67 - vpackuswb Vx, Hx, W */
    2197 FNIEMOP_STUB(iemOp_vpackuswb_Vx_Hx_W);
     2208FNIEMOP_DEF(iemOp_vpackuswb_Vx_Hx_W)
     2209{
     2210    IEMOP_MNEMONIC3(VEX_RVM, VPACKUSWB, vpackuswb, Vx, Hx, Wx, DISOPTYPE_HARMLESS | DISOPTYPE_AVX, 0);
     2211    IEMOPMEDIAOPTF3_INIT_VARS(          vpackuswb);
     2212    return FNIEMOP_CALL_1(iemOpCommonAvxAvx2_Vx_Hx_Wx_Opt, IEM_SELECT_HOST_OR_FALLBACK(fAvx2, &s_Host, &s_Fallback));
     2213}
     2214
     2215
    21982216/*  Opcode VEX.F3.0F 0x67 - invalid */
    21992217
     
    23012319
    23022320/*  Opcode VEX.0F 0x6b - invalid */
     2321
     2322
    23032323/** Opcode VEX.66.0F 0x6b - vpackssdw Vx, Hx, Wx */
    2304 FNIEMOP_STUB(iemOp_vpackssdw_Vx_Hx_Wx);
     2324FNIEMOP_DEF(iemOp_vpackssdw_Vx_Hx_Wx)
     2325{
     2326    IEMOP_MNEMONIC3(VEX_RVM, VPACKSSDW, vpackssdw, Vx, Hx, Wx, DISOPTYPE_HARMLESS | DISOPTYPE_AVX, 0);
     2327    IEMOPMEDIAOPTF3_INIT_VARS(          vpackssdw);
     2328    return FNIEMOP_CALL_1(iemOpCommonAvxAvx2_Vx_Hx_Wx_Opt, IEM_SELECT_HOST_OR_FALLBACK(fAvx2, &s_Host, &s_Fallback));
     2329}
     2330
     2331
    23052332/*  Opcode VEX.F3.0F 0x6b - invalid */
    23062333
  • trunk/src/VBox/VMM/VMMAll/IEMAllInstructionsVexMap2.cpp.h

    r95517 r95522  
    233233     */
    234234    return IEMOP_RAISE_INVALID_OPCODE();
    235 
    236235}
    237236
    238237
    239238/** Opcode VEX.66.0F38 0x2b. */
    240 FNIEMOP_STUB(iemOp_vpackusdw_Vx_Hx_Wx);
     239FNIEMOP_DEF(iemOp_vpackusdw_Vx_Hx_Wx)
     240{
     241    IEMOP_MNEMONIC3(VEX_RVM, VPACKUSDW, vpackusdw, Vx, Hx, Wx, DISOPTYPE_HARMLESS | DISOPTYPE_AVX, 0);
     242    IEMOPMEDIAOPTF3_INIT_VARS(          vpackusdw);
     243    return FNIEMOP_CALL_1(iemOpCommonAvxAvx2_Vx_Hx_Wx_Opt, IEM_SELECT_HOST_OR_FALLBACK(fAvx2, &s_Host, &s_Fallback));
     244}
     245
     246
    241247/** Opcode VEX.66.0F38 0x2c. */
    242248FNIEMOP_STUB(iemOp_vmaskmovps_Vx_Hx_Mx);
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