VirtualBox

Changeset 103730 in vbox


Ignore:
Timestamp:
Mar 7, 2024 3:24:23 PM (13 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
162099
Message:

VMM/IEM: More fun with the three byte vex prefix. bugref:10369

File:
1 edited

Legend:

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

    r103721 r103730  
    89188918            uint8_t bOpcode; IEM_OPCODE_GET_NEXT_U8(&bOpcode);
    89198919            pVCpu->iem.s.fPrefixes |= IEM_OP_PRF_VEX;
     8920#if 1
     8921            AssertCompile(IEM_OP_PRF_SIZE_REX_W == RT_BIT_32(9));
     8922            pVCpu->iem.s.fPrefixes |= (uint32_t)(bVex2 & 0x80) << (9 - 7);
     8923#else
     8924            if (bVex2 & 0x80 /* VEX.W */)
     8925                pVCpu->iem.s.fPrefixes |= IEM_OP_PRF_SIZE_REX_W;
     8926#endif
    89208927            if (IEM_IS_64BIT_CODE(pVCpu))
    89218928            {
    89228929#if 1
    8923                 AssertCompile(IEM_OP_PRF_SIZE_REX_W == RT_BIT_32(9));
    8924                 pVCpu->iem.s.fPrefixes |= (uint32_t)(bVex2 & 0x80) << (9 - 7);
    89258930                AssertCompile(IEM_OP_PRF_REX_B == RT_BIT_32(25) && IEM_OP_PRF_REX_X == RT_BIT_32(26) && IEM_OP_PRF_REX_R == RT_BIT_32(27));
    89268931                pVCpu->iem.s.fPrefixes |= (uint32_t)(~bRm & 0xe0) << (25 - 5);
    89278932#else
    8928                 if (bVex2 & 0x80 /* VEX.W */)
    8929                     pVCpu->iem.s.fPrefixes |= IEM_OP_PRF_SIZE_REX_W;
    89308933                if (~bRm & 0x20 /* VEX.~B */)
    89318934                    pVCpu->iem.s.fPrefixes |= IEM_OP_PRF_SIZE_REX_B;
     
    89358938                    pVCpu->iem.s.fPrefixes |= IEM_OP_PRF_SIZE_REX_R;
    89368939#endif
     8940                pVCpu->iem.s.uRexReg    = (~bRm >> (7 - 3)) & 0x8;
     8941                pVCpu->iem.s.uRexIndex  = (~bRm >> (6 - 3)) & 0x8;
     8942                pVCpu->iem.s.uRexB      = (~bRm >> (5 - 3)) & 0x8;
     8943                pVCpu->iem.s.uVex3rdReg = (~bVex2 >> 3) & 0xf;
     8944                pVCpu->iem.s.uVex3rdReg = (~bVex2 >> 3) & 0xf;
    89378945            }
    8938             pVCpu->iem.s.uRexReg    = (~bRm >> (7 - 3)) & 0x8;
    8939             pVCpu->iem.s.uRexIndex  = (~bRm >> (6 - 3)) & 0x8;
    8940             pVCpu->iem.s.uRexB      = (~bRm >> (5 - 3)) & 0x8;
    8941             pVCpu->iem.s.uVex3rdReg = (~bVex2 >> 3) & 0xf;
     8946            else
     8947            {
     8948                pVCpu->iem.s.uRexReg    = 0;
     8949                pVCpu->iem.s.uRexIndex  = 0;
     8950                pVCpu->iem.s.uRexB      = 0;
     8951                pVCpu->iem.s.uVex3rdReg = (~bVex2 >> 3) & 0x7;
     8952            }
    89428953            pVCpu->iem.s.uVexLength = (bVex2 >> 2) & 1;
    89438954            pVCpu->iem.s.idxPrefix  = bVex2 & 0x3;
Note: See TracChangeset for help on using the changeset viewer.

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