VirtualBox

Ignore:
Timestamp:
Jul 4, 2022 10:53:58 PM (2 years ago)
Author:
vboxsync
Message:

VMM/IEM: Implemented vpunpcklbw, vpunpcklwd, vpunpckldq, vpunpcklqdq, vpunpckhbw, vpunpckhwd, vpunpckhdq, vpunpckhqdq and fixed the corresponding SSE and MMX instruction. bugref:9898

File:
1 edited

Legend:

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

    r95499 r95509  
    36293629; @param    2       1 if MMX is included, 0 if not.
    36303630;
    3631 ; @param    A0      FPU context (fxsave).
    3632 ; @param    A1      Pointer to the first full sized media register operand (input/output).
    3633 ; @param    A2      Pointer to the second half sized media register operand (input).
     3631; @param    A0      Pointer to the first full sized media register operand (input/output).
     3632; @param    A1      Pointer to the second half sized media register operand (input).
    36343633;
    36353634%macro IEMIMPL_MEDIA_F1L1 2
    36363635 %if %2 != 0
    3637 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u64, 12
    3638         PROLOGUE_3_ARGS
     3636BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u64, 8
     3637        PROLOGUE_2_ARGS
    36393638        IEMIMPL_MMX_PROLOGUE
    36403639
    3641         movq    mm0, [A1]
    3642         movd    mm1, [A2]
     3640        movq    mm0, [A0]
     3641        movq    mm1, [A1]
    36433642        %1      mm0, mm1
    3644         movq    [A1], mm0
     3643        movq    [A0], mm0
    36453644
    36463645        IEMIMPL_MMX_EPILOGUE
    3647         EPILOGUE_3_ARGS
     3646        EPILOGUE_2_ARGS
    36483647ENDPROC iemAImpl_ %+ %1 %+ _u64
    36493648 %endif
    36503649
    3651 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u128, 12
    3652         PROLOGUE_3_ARGS
     3650BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u128, 8
     3651        PROLOGUE_2_ARGS
    36533652        IEMIMPL_SSE_PROLOGUE
    36543653
    3655         movdqu   xmm0, [A1]
    3656         movq     xmm1, [A2]
     3654        movdqu   xmm0, [A0]
     3655        movdqu   xmm1, [A1]
    36573656        %1       xmm0, xmm1
    3658         movdqu   [A1], xmm0
     3657        movdqu   [A0], xmm0
    36593658
    36603659        IEMIMPL_SSE_EPILOGUE
    3661         EPILOGUE_3_ARGS
     3660        EPILOGUE_2_ARGS
    36623661ENDPROC iemAImpl_ %+ %1 %+ _u128
    36633662%endmacro
     
    36703669
    36713670;;
     3671; Media instruction working two half sized input registers (lower half) and a full sized
     3672; destination register (vpunpckh*).
     3673;
     3674; @param    1       The instruction
     3675;
     3676; @param    A0      Pointer to the destination register (full sized, output only).
     3677; @param    A1      Pointer to the first full sized media source register operand, where we
     3678;                   will only use the lower half as input - but we'll be loading it in full.
     3679; @param    A2      Pointer to the second full sized media source register operand, where we
     3680;                   will only use the lower half as input - but we'll be loading it in full.
     3681;
     3682%macro IEMIMPL_MEDIA_F1L1L1 1
     3683BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u128, 12
     3684        PROLOGUE_3_ARGS
     3685        IEMIMPL_AVX_PROLOGUE
     3686
     3687        vmovdqu xmm0, [A1]
     3688        vmovdqu xmm1, [A2]
     3689        %1      xmm0, xmm0, xmm1
     3690        vmovdqu [A0], xmm0
     3691
     3692        IEMIMPL_AVX_PROLOGUE
     3693        EPILOGUE_3_ARGS
     3694ENDPROC iemAImpl_ %+ %1 %+ _u128
     3695
     3696BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u256, 12
     3697        PROLOGUE_3_ARGS
     3698        IEMIMPL_AVX_PROLOGUE
     3699
     3700        vmovdqu  ymm0, [A1]
     3701        vmovdqu  ymm1, [A2]
     3702        %1       ymm0, ymm0, ymm1
     3703        vmovdqu  [A0], ymm0
     3704
     3705        IEMIMPL_AVX_PROLOGUE
     3706        EPILOGUE_3_ARGS
     3707ENDPROC iemAImpl_ %+ %1 %+ _u256
     3708%endmacro
     3709
     3710IEMIMPL_MEDIA_F1L1L1 vpunpcklbw
     3711IEMIMPL_MEDIA_F1L1L1 vpunpcklwd
     3712IEMIMPL_MEDIA_F1L1L1 vpunpckldq
     3713IEMIMPL_MEDIA_F1L1L1 vpunpcklqdq
     3714
     3715
     3716;;
    36723717; Media instruction working on one full sized and one half sized register (high half).
    36733718;
     
    36753720; @param    2       1 if MMX is included, 0 if not.
    36763721;
    3677 ; @param    A0      FPU context (fxsave).
    3678 ; @param    A1      Pointer to the first full sized media register operand (input/output).
    3679 ; @param    A2      Pointer to the second full sized media register operand, where we
    3680 ;                   will only use the upper half (input).
     3722; @param    A0      Pointer to the first full sized media register operand (input/output).
     3723; @param    A1      Pointer to the second full sized media register operand, where we
     3724;                   will only use the upper half as input - but we'll load it in full.
    36813725;
    36823726%macro IEMIMPL_MEDIA_F1H1 2
    3683  %if %2 != 0
    3684 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u64, 12
    3685         PROLOGUE_3_ARGS
    3686         IEMIMPL_MMX_PROLOGUE
    3687 
    3688         movq    mm0, [A1]
    3689         movq    mm1, [A2]
    3690         %1      mm0, mm1
    3691         movq    [A1], mm0
    3692 
    3693         IEMIMPL_MMX_EPILOGUE
    3694         EPILOGUE_3_ARGS
    3695 ENDPROC iemAImpl_ %+ %1 %+ _u64
    3696  %endif
    3697 
    3698 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u128, 12
    3699         PROLOGUE_3_ARGS
    3700         IEMIMPL_SSE_PROLOGUE
    3701 
    3702         movdqu   xmm0, [A1]
    3703         movdqu   xmm1, [A2]
    3704         %1       xmm0, xmm1
    3705         movdqu   [A1], xmm0
    3706 
    3707         IEMIMPL_SSE_EPILOGUE
    3708         EPILOGUE_3_ARGS
    3709 ENDPROC iemAImpl_ %+ %1 %+ _u128
     3727IEMIMPL_MEDIA_F1L1 %1, %2
    37103728%endmacro
    37113729
     
    37143732IEMIMPL_MEDIA_F1L1 punpckhdq,  1
    37153733IEMIMPL_MEDIA_F1L1 punpckhqdq, 0
     3734
     3735
     3736;;
     3737; Media instruction working two half sized input registers (high half) and a full sized
     3738; destination register (vpunpckh*).
     3739;
     3740; @param    1       The instruction
     3741;
     3742; @param    A0      Pointer to the destination register (full sized, output only).
     3743; @param    A1      Pointer to the first full sized media source register operand, where we
     3744;                   will only use the upper half as input - but we'll be loading it in full.
     3745; @param    A2      Pointer to the second full sized media source register operand, where we
     3746;                   will only use the upper half as input - but we'll be loading it in full.
     3747;
     3748%macro IEMIMPL_MEDIA_F1H1H1 1
     3749IEMIMPL_MEDIA_F1L1L1 %1
     3750%endmacro
     3751
     3752IEMIMPL_MEDIA_F1H1H1 vpunpckhbw
     3753IEMIMPL_MEDIA_F1H1H1 vpunpckhwd
     3754IEMIMPL_MEDIA_F1H1H1 vpunpckhdq
     3755IEMIMPL_MEDIA_F1H1H1 vpunpckhqdq
    37163756
    37173757
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