Changeset 53155 in vbox for trunk/src/VBox/Disassembler
- Timestamp:
- Oct 27, 2014 4:43:43 PM (10 years ago)
- Location:
- trunk/src/VBox/Disassembler
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Disassembler/DisasmCore.cpp
r53131 r53155 2142 2142 offInstr++; 2143 2143 2144 /** @todo Should we take the first or last prefix byte in case of multiple prefix bytes??? */2145 Assert(pDis->bLastPrefix == OP_OPSIZE);2146 2147 2144 /* default to the non-prefixed table. */ 2148 2145 PCDISOPCODE pOpcode; 2149 if (g_apThreeByteMapX86_660F3A[pDis->bOpCode >> 4]) 2146 if (g_apThreeByteMapX86_0F3A[pDis->bOpCode >> 4]) 2147 { 2148 pOpcode = g_apThreeByteMapX86_0F3A[pDis->bOpCode >> 4]; 2149 pOpcode = &pOpcode[pDis->bOpCode & 0xf]; 2150 } 2151 else 2152 pOpcode = &g_InvalidOpcode[0]; 2153 2154 /** @todo Should we take the first or last prefix byte in case of multiple prefix bytes??? */ 2155 if (pDis->bLastPrefix == OP_OPSIZE && g_apThreeByteMapX86_660F3A[pDis->bOpCode >> 4]) 2150 2156 { 2151 2157 pOpcode = g_apThreeByteMapX86_660F3A[pDis->bOpCode >> 4]; … … 2167 2173 } 2168 2174 } 2169 else2170 pOpcode = &g_InvalidOpcode[0];2171 2175 2172 2176 return disParseInstruction(offInstr, pOpcode, pDis); -
trunk/src/VBox/Disassembler/DisasmInternal.h
r53094 r53155 111 111 extern PCDISOPCODE const g_apThreeByteMapX86_F30F38[16]; 112 112 113 extern PCDISOPCODE const g_apThreeByteMapX86_0F3A[16]; 114 113 115 /** Three byte opcode map with prefix 0x66 (0xF 0x3A) */ 114 116 extern PCDISOPCODE const g_apThreeByteMapX86_660F3A[16]; -
trunk/src/VBox/Disassembler/DisasmTables.cpp
r53150 r53155 458 458 OP("3 byte escape A4", IDX_ParseThreeByteEsc4,0, 0, OP_3B_ESC4, OP_PARM_NONE, OP_PARM_NONE, OP_PARM_NONE, DISOPTYPE_HARMLESS), 459 459 INVALID_OPCODE, 460 INVALID_OPCODE, /** 0x3A - 3-byte escape table A-5 */460 OP("3 byte escape A5", IDX_ParseThreeByteEsc5,0, 0, OP_3B_ESC5, OP_PARM_NONE, OP_PARM_NONE, OP_PARM_NONE, DISOPTYPE_HARMLESS), 461 461 INVALID_OPCODE, 462 462 /* SSE2 */ … … 1669 1669 }; 1670 1670 1671 const DISOPCODE g_aThreeByteMapX86_0F3A_0[16] = 1672 { 1673 INVALID_OPCODE, 1674 INVALID_OPCODE, 1675 INVALID_OPCODE, 1676 INVALID_OPCODE, 1677 INVALID_OPCODE, 1678 INVALID_OPCODE, 1679 INVALID_OPCODE, 1680 INVALID_OPCODE, 1681 INVALID_OPCODE, 1682 INVALID_OPCODE, 1683 INVALID_OPCODE, 1684 INVALID_OPCODE, 1685 INVALID_OPCODE, 1686 INVALID_OPCODE, 1687 INVALID_OPCODE, 1688 OP("palignr %Pq,%Qq,%Ib", IDX_ParseModRM, IDX_UseModRM, IDX_ParseImmByte, OP_PALIGNR, OP_PARM_Pq, OP_PARM_Qq, OP_PARM_Ib, DISOPTYPE_HARMLESS), 1689 }; 1690 1691 PCDISOPCODE const g_apThreeByteMapX86_0F3A[16] = 1692 { 1693 /* 0 */ 1694 g_aThreeByteMapX86_0F3A_0, 1695 /* 1 */ 1696 NULL, 1697 /* 2 */ 1698 NULL, 1699 /* 3 */ 1700 NULL, 1701 /* 4 */ 1702 NULL, 1703 /* 5 */ 1704 NULL, 1705 /* 6 */ 1706 NULL, 1707 /* 7 */ 1708 NULL, 1709 /* 8 */ 1710 NULL, 1711 /* 9 */ 1712 NULL, 1713 /* a */ 1714 NULL, 1715 /* b */ 1716 NULL, 1717 /* c */ 1718 NULL, 1719 /* d */ 1720 NULL, 1721 /* e */ 1722 NULL, 1723 /* f */ 1724 NULL, 1725 }; 1726 1727 const DISOPCODE g_aThreeByteMapX86_660F3A_0[16] = 1728 { 1729 INVALID_OPCODE, 1730 INVALID_OPCODE, 1731 INVALID_OPCODE, 1732 INVALID_OPCODE, 1733 INVALID_OPCODE, 1734 INVALID_OPCODE, 1735 INVALID_OPCODE, 1736 INVALID_OPCODE, 1737 OP("roundps %Vdq,%Wdq,%Ib", IDX_ParseModRM, IDX_UseModRM, IDX_ParseImmByte, OP_ROUNDPS, OP_PARM_Vdq, OP_PARM_Wdq, OP_PARM_Ib, DISOPTYPE_HARMLESS), 1738 OP("roundpd %Vdq,%Wdq,%Ib", IDX_ParseModRM, IDX_UseModRM, IDX_ParseImmByte, OP_ROUNDPD, OP_PARM_Vdq, OP_PARM_Wdq, OP_PARM_Ib, DISOPTYPE_HARMLESS), 1739 OP("roundss %Vss,%Wss,%Ib", IDX_ParseModRM, IDX_UseModRM, IDX_ParseImmByte, OP_ROUNDSS, OP_PARM_Vss, OP_PARM_Wss, OP_PARM_Ib, DISOPTYPE_HARMLESS), 1740 OP("roundsd %Vsd,%Wsd,%Ib", IDX_ParseModRM, IDX_UseModRM, IDX_ParseImmByte, OP_ROUNDSD, OP_PARM_Vsd, OP_PARM_Wsd, OP_PARM_Ib, DISOPTYPE_HARMLESS), 1741 OP("blendps %Vdq,%Wdq,%Ib", IDX_ParseModRM, IDX_UseModRM, IDX_ParseImmByte, OP_BLENDPS, OP_PARM_Vdq, OP_PARM_Wdq, OP_PARM_Ib, DISOPTYPE_HARMLESS), 1742 OP("blendpd %Vdq,%Wdq,%Ib", IDX_ParseModRM, IDX_UseModRM, IDX_ParseImmByte, OP_BLENDPD, OP_PARM_Vdq, OP_PARM_Wdq, OP_PARM_Ib, DISOPTYPE_HARMLESS), 1743 OP("pblendw %Vdq,%Wdq,%Ib", IDX_ParseModRM, IDX_UseModRM, IDX_ParseImmByte, OP_PBLENDW, OP_PARM_Vdq, OP_PARM_Wdq, OP_PARM_Ib, DISOPTYPE_HARMLESS), 1744 OP("palignr %Vdq,%Wdq,%Ib", IDX_ParseModRM, IDX_UseModRM, IDX_ParseImmByte, OP_PALIGNR, OP_PARM_Vdq, OP_PARM_Wdq, OP_PARM_Ib, DISOPTYPE_HARMLESS), 1745 }; 1746 1671 1747 const DISOPCODE g_aThreeByteMapX86_660F3A_10[16] = 1672 1748 { … … 1691 1767 const DISOPCODE g_aThreeByteMapX86_660F3A_20[16] = 1692 1768 { 1693 // vpinsrb %Vdq,%Hdq,%Ry/Mb,%Ib1769 // pinsrb %Vdq,%Ry/Mb,%Ib 1694 1770 OP("pinsrb %Vdq,%Ey,%Ib", IDX_ParseModRM, IDX_UseModRM, IDX_ParseImmByte, OP_PINSRB, OP_PARM_Vdq, OP_PARM_Ey, OP_PARM_Ib, DISOPTYPE_HARMLESS), 1695 // vinsertps %Vdq,%Hdq,%Udq/Md,%Ib1771 // insertps %Vdq,%Udq/Md,%Ib 1696 1772 OP("insertps %Vdq,%Wdq,%Ib",IDX_ParseModRM, IDX_UseModRM, IDX_ParseImmByte, OP_INSERTPS, OP_PARM_Vdq, OP_PARM_Wdq, OP_PARM_Ib, DISOPTYPE_HARMLESS), 1697 1773 OP("pinsrd %Vdq,%Ey,%Ib", IDX_ParseModRM, IDX_UseModRM, IDX_ParseImmByte, OP_PINSRD, OP_PARM_Vdq, OP_PARM_Ey, OP_PARM_Ib, DISOPTYPE_HARMLESS), … … 1776 1852 { 1777 1853 /* 0 */ 1778 NULL,1854 g_aThreeByteMapX86_660F3A_0, 1779 1855 /* 1 */ 1780 1856 g_aThreeByteMapX86_660F3A_10, … … 3999 4075 OPVEX("vblendps %Vx,%Hx,%Wx,%Ib", IDX_ParseModRM, IDX_ParseVexDest, IDX_UseModRM, IDX_ParseImmByte, OP_BLENDPS, OP_PARM_Vx, OP_PARM_Hx, OP_PARM_Wx, OP_PARM_Ib, DISOPTYPE_HARMLESS), 4000 4076 OPVEX("vblendpd %Vx,%Hx,%Wx,%Ib", IDX_ParseModRM, IDX_ParseVexDest, IDX_UseModRM, IDX_ParseImmByte, OP_BLENDPD, OP_PARM_Vx, OP_PARM_Hx, OP_PARM_Wx, OP_PARM_Ib, DISOPTYPE_HARMLESS), 4001 OPVEX("v blendw %Vx,%Hx,%Wx,%Ib", IDX_ParseModRM, IDX_ParseVexDest, IDX_UseModRM, IDX_ParseImmByte, OP_BLENDW,OP_PARM_Vx, OP_PARM_Hx, OP_PARM_Wx, OP_PARM_Ib, DISOPTYPE_HARMLESS),4002 OPVEX("vpalignr %Vx,%Hx,%Wx,%Ib", IDX_ParseModRM, IDX_ParseVexDest, IDX_UseModRM, IDX_ParseImmByte, OP_ ALIGNR,OP_PARM_Vx, OP_PARM_Hx, OP_PARM_Wx, OP_PARM_Ib, DISOPTYPE_HARMLESS),4077 OPVEX("vpblendw %Vx,%Hx,%Wx,%Ib", IDX_ParseModRM, IDX_ParseVexDest, IDX_UseModRM, IDX_ParseImmByte, OP_PBLENDW, OP_PARM_Vx, OP_PARM_Hx, OP_PARM_Wx, OP_PARM_Ib, DISOPTYPE_HARMLESS), 4078 OPVEX("vpalignr %Vx,%Hx,%Wx,%Ib", IDX_ParseModRM, IDX_ParseVexDest, IDX_UseModRM, IDX_ParseImmByte, OP_PALIGNR, OP_PARM_Vx, OP_PARM_Hx, OP_PARM_Wx, OP_PARM_Ib, DISOPTYPE_HARMLESS), 4003 4079 4004 4080 /* 1 */ … … 4024 4100 /* 2 */ 4025 4101 // vpinsrb %Vdq,%Hdq,%Ry/Mb,%Ib 4026 OPVEX("vpinsrb %Vdq,%Hdq,%E y,%Ib", IDX_ParseModRM, IDX_ParseVexDest, IDX_UseModRM, IDX_ParseImmByte, OP_PINSRB, OP_PARM_Vdq, OP_PARM_Hdq, OP_PARM_Ey, OP_PARM_Ib, DISOPTYPE_HARMLESS),4102 OPVEX("vpinsrb %Vdq,%Hdq,%Eb,%Ib", IDX_ParseModRM, IDX_ParseVexDest, IDX_UseModRM, IDX_ParseImmByte, OP_PINSRB, OP_PARM_Vdq, OP_PARM_Hdq, OP_PARM_Eb, OP_PARM_Ib, DISOPTYPE_HARMLESS), 4027 4103 // vinsertps %Vdq,%Hdq,%Udq/Md,%Ib 4028 OPVEX("vinsertps %Vdq,%Hdq,%Wd q,%Ib", IDX_ParseModRM, IDX_ParseVexDest, IDX_UseModRM, IDX_ParseImmByte, OP_INSERTPS, OP_PARM_Vdq, OP_PARM_Hdq, OP_PARM_Wdq, OP_PARM_Ib, DISOPTYPE_HARMLESS),4029 OPVEX("vpinsrd/q %Vdq,%Hdq,%Ey,%Ib", IDX_ParseModRM, IDX_ParseVexDest, IDX_UseModRM, IDX_ParseImmByte, OP_PINSRD,OP_PARM_Vdq, OP_PARM_Hdq, OP_PARM_Ey, OP_PARM_Ib, DISOPTYPE_HARMLESS),4104 OPVEX("vinsertps %Vdq,%Hdq,%Wd,%Ib", IDX_ParseModRM, IDX_ParseVexDest, IDX_UseModRM, IDX_ParseImmByte, OP_INSERTPS, OP_PARM_Vdq, OP_PARM_Hdq, OP_PARM_Wd, OP_PARM_Ib, DISOPTYPE_HARMLESS), 4105 OPVEX("vpinsrd/q %Vdq,%Hdq,%Ey,%Ib", IDX_ParseModRM, IDX_ParseVexDest, IDX_UseModRM, IDX_ParseImmByte, OP_PINSRD, OP_PARM_Vdq, OP_PARM_Hdq, OP_PARM_Ey, OP_PARM_Ib, DISOPTYPE_HARMLESS), 4030 4106 INVALID_OPCODE, 4031 4107 INVALID_OPCODE, … … 4071 4147 INVALID_OPCODE, 4072 4148 INVALID_OPCODE, 4073 OPVEX("v pblendvps %Vx,%Hx,%Wx,%Lx", IDX_ParseModRM, IDX_ParseVexDest, IDX_UseModRM, IDX_ParseImmByte, OP_PBLENDVPS, OP_PARM_Vx, OP_PARM_Hx, OP_PARM_Wx, OP_PARM_Lx, DISOPTYPE_HARMLESS),4074 OPVEX("v pblendvpd %Vx,%Hx,%Wx,%Lx", IDX_ParseModRM, IDX_ParseVexDest, IDX_UseModRM, IDX_ParseImmByte, OP_PBLENDVPD, OP_PARM_Vx, OP_PARM_Hx, OP_PARM_Wx, OP_PARM_Lx, DISOPTYPE_HARMLESS),4075 OPVEX("vpblendv pb %Vx,%Hx,%Wx,%Lx", IDX_ParseModRM, IDX_ParseVexDest, IDX_UseModRM, IDX_ParseImmByte, OP_PBLENDVPB,OP_PARM_Vx, OP_PARM_Hx, OP_PARM_Wx, OP_PARM_Lx, DISOPTYPE_HARMLESS),4149 OPVEX("vblendvps %Vx,%Hx,%Wx,%Lx", IDX_ParseModRM, IDX_ParseVexDest, IDX_UseModRM, IDX_ParseImmByte, OP_BLENDVPS, OP_PARM_Vx, OP_PARM_Hx, OP_PARM_Wx, OP_PARM_Lx, DISOPTYPE_HARMLESS), 4150 OPVEX("vblendvpd %Vx,%Hx,%Wx,%Lx", IDX_ParseModRM, IDX_ParseVexDest, IDX_UseModRM, IDX_ParseImmByte, OP_BLENDVPD, OP_PARM_Vx, OP_PARM_Hx, OP_PARM_Wx, OP_PARM_Lx, DISOPTYPE_HARMLESS), 4151 OPVEX("vpblendvb %Vx,%Hx,%Wx,%Lx", IDX_ParseModRM, IDX_ParseVexDest, IDX_UseModRM, IDX_ParseImmByte, OP_PBLENDVB, OP_PARM_Vx, OP_PARM_Hx, OP_PARM_Wx, OP_PARM_Lx, DISOPTYPE_HARMLESS), 4076 4152 INVALID_OPCODE, 4077 4153 INVALID_OPCODE, -
trunk/src/VBox/Disassembler/testcase/tstDisasm-1A.asm
r53150 r53155 207 207 vpmovsxbw xmm0,qword [0x100] 208 208 vbroadcastf128 ymm0,oword [0x100] 209 210 palignr mm0, mm1, 1 211 vpinsrb xmm0, xmm1, eax, 1 212 vpinsrb xmm0, xmm1, [100h], 1 213 vinsertps xmm0, xmm1, xmm2, 1 214 vinsertps xmm0, xmm1, [100h], 1 215 216 vblendvps xmm0, xmm1, xmm2, xmm3 217 vblendvps ymm0, ymm1, ymm2, ymm3 209 218 210 219 ENDPROC TestProc32
Note:
See TracChangeset
for help on using the changeset viewer.