Changeset 67083 in vbox for trunk/src/VBox/ValidationKit
- Timestamp:
- May 25, 2017 11:07:11 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1-template.c
r67082 r67083 1300 1300 1301 1301 /** 1302 * Inserts a ModR/M byte with mod=3 and set the two idxFields members. 1303 * 1304 * @returns off + 1. 1305 * @param pThis The state. 1306 * @param off Current instruction offset. 1307 * @param uReg Register index for ModR/M.reg. 1308 * @param uRegMem Register index for ModR/M.rm. 1309 */ 1310 static unsigned Bs3Cg1InsertModRmWithRegFields(PBS3CG1STATE pThis, unsigned off, uint8_t uReg, uint8_t uRegMem) 1311 { 1312 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, uReg & 7, uRegMem & 7); 1313 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + uReg; 1314 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + uRegMem; 1315 return off; 1316 } 1317 1318 1319 1320 /** 1302 1321 * Cleans up state and context changes made by the encoder. 1303 1322 * … … 1733 1752 pThis->aOperands[pThis->iRmOp ].enmLocation = pThis->aOperands[pThis->iRmOp].enmLocationReg; 1734 1753 off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0)); 1735 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 1, 0); 1736 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 0; 1737 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 1; 1754 off = Bs3Cg1InsertModRmWithRegFields(pThis, off, 1, 0); 1738 1755 break; 1739 1756 case 1: 1740 1757 pThis->aOperands[pThis->iRmOp ].enmLocation = pThis->aOperands[pThis->iRmOp].enmLocationReg; 1741 1758 off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0)); 1742 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 4, 7); 1743 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 7; 1744 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 4; 1759 off = Bs3Cg1InsertModRmWithRegFields(pThis, off, 4, 7); 1745 1760 iEncoding += !BS3CG1_IS_64BIT_TARGET(pThis) ? 1 : 0; 1746 1761 break; … … 1750 1765 pThis->abCurInstr[off++] = REX__RBX; 1751 1766 off = Bs3Cg1InsertOpcodes(pThis, off); 1752 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 6, 2); 1753 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 2; /* no +8*/ 1754 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 6; /* no +8*/ 1767 off = Bs3Cg1InsertModRmWithRegFields(pThis, off, 6 /*no +8*/, 2 /*no +8*/); 1755 1768 break; 1756 1769 #endif … … 1815 1828 pThis->aOperands[pThis->iRmOp ].enmLocation = pThis->aOperands[pThis->iRmOp].enmLocationReg; 1816 1829 off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0)); 1817 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 1, 0); 1818 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 0; 1819 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 1; 1830 off = Bs3Cg1InsertModRmWithRegFields(pThis, off, 1, 0); 1820 1831 break; 1821 1832 case 1: 1822 1833 off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0)); 1823 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 6, 2); 1824 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 2; 1825 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 6; 1834 off = Bs3Cg1InsertModRmWithRegFields(pThis, off, 6, 2); 1826 1835 iEncoding += !BS3CG1_IS_64BIT_TARGET(pThis) ? 1 : 0; 1827 1836 break; … … 1831 1840 pThis->abCurInstr[off++] = REX__RBX; 1832 1841 off = Bs3Cg1InsertOpcodes(pThis, off); 1833 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 6, 2); 1834 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 2 + 8; 1835 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 6; /* no +8*/ 1842 off = Bs3Cg1InsertModRmWithRegFields(pThis, off, 6 /*no +8*/, 2+8); 1836 1843 break; 1837 1844 #endif … … 1876 1883 pThis->abCurInstr[off++] = REX_W___; 1877 1884 off = Bs3Cg1InsertOpcodes(pThis, off); 1878 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 1, 0); 1879 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 0; 1880 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 1; 1885 off = Bs3Cg1InsertModRmWithRegFields(pThis, off, 1, 0); 1881 1886 break; 1882 1887 case 1: … … 1884 1889 pThis->abCurInstr[off++] = REX_W___; 1885 1890 off = Bs3Cg1InsertOpcodes(pThis, off); 1886 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 6, 2); 1887 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 2; 1888 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 6; 1891 off = Bs3Cg1InsertModRmWithRegFields(pThis, off, 6, 2); 1889 1892 break; 1890 1893 case 2: … … 1892 1895 pThis->abCurInstr[off++] = REX_WRBX; 1893 1896 off = Bs3Cg1InsertOpcodes(pThis, off); 1894 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 6, 2); 1895 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 2 + 8; 1896 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 6; /* no +8*/ 1897 off = Bs3Cg1InsertModRmWithRegFields(pThis, off, 6 /*no +8*/, 2+8); 1897 1898 break; 1898 1899 case 3: … … 1936 1937 pThis->aOperands[pThis->iRmOp ].enmLocation = pThis->aOperands[pThis->iRmOp].enmLocationReg; 1937 1938 off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0)); 1938 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 1, 0); 1939 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 0; 1940 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 1; 1939 off = Bs3Cg1InsertModRmWithRegFields(pThis, off, 1, 0); 1941 1940 break; 1942 1941 case 1: 1943 1942 off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0)); 1944 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 6, 2); 1945 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 2; 1946 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 6; 1943 off = Bs3Cg1InsertModRmWithRegFields(pThis, off, 6, 2); 1947 1944 iEncoding += !BS3CG1_IS_64BIT_TARGET(pThis) ? 1 : 0; 1948 1945 break; … … 1952 1949 pThis->abCurInstr[off++] = REX__RBX; 1953 1950 off = Bs3Cg1InsertOpcodes(pThis, off); 1954 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 6, 2); 1955 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 2 + 8; 1956 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 6 + 8; 1951 off = Bs3Cg1InsertModRmWithRegFields(pThis, off, 6+8, 2+8); 1957 1952 break; 1958 1953 #endif … … 1998 1993 pThis->abCurInstr[off++] = REX_W___; 1999 1994 off = Bs3Cg1InsertOpcodes(pThis, off); 2000 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 1, 0); 2001 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 0; 2002 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 1; 1995 off = Bs3Cg1InsertModRmWithRegFields(pThis, off, 1, 0); 2003 1996 break; 2004 1997 case 1: … … 2006 1999 pThis->abCurInstr[off++] = REX_W___; 2007 2000 off = Bs3Cg1InsertOpcodes(pThis, off); 2008 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 6, 2); 2009 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 2; 2010 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 6; 2001 off = Bs3Cg1InsertModRmWithRegFields(pThis, off, 6, 2); 2011 2002 break; 2012 2003 case 2: … … 2014 2005 pThis->abCurInstr[off++] = REX_WRBX; 2015 2006 off = Bs3Cg1InsertOpcodes(pThis, off); 2016 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 6, 2); 2017 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 2 + 8; 2018 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 6 + 8; 2007 off = Bs3Cg1InsertModRmWithRegFields(pThis, off, 6+8, 2+8); 2019 2008 break; 2020 2009 case 4: … … 2240 2229 case 0: 2241 2230 pThis->aOperands[pThis->iRmOp].enmLocation = pThis->aOperands[pThis->iRmOp].enmLocationReg; 2242 off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0)); 2243 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 1, 0); 2244 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 0; 2245 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 1; 2231 off = Bs3Cg1InsertModRmWithRegFields(pThis, Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0)), 1, 0); 2246 2232 break; 2247 2233 case 1: … … 2269 2255 case 0: 2270 2256 off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0)); 2271 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 1, 0); 2272 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 0; 2273 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 1; 2257 off = Bs3Cg1InsertModRmWithRegFields(pThis, off, 1, 0); 2274 2258 break; 2275 2259 case 1: 2276 2260 off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0)); 2277 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 6, 7); 2278 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 7; 2279 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 6; 2261 off = Bs3Cg1InsertModRmWithRegFields(pThis, off, 6, 7); 2280 2262 iEncoding += !BS3CG1_IS_64BIT_TARGET(pThis) ? 1 : 0; 2281 2263 break; … … 2284 2266 pThis->abCurInstr[off++] = REX_WRBX; 2285 2267 off = Bs3Cg1InsertOpcodes(pThis, off); 2286 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 6, 7); 2287 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 7; /* no +8 here */ 2288 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 6 + 8; 2268 off = Bs3Cg1InsertModRmWithRegFields(pThis, off, 6 + 8, 7 /*no +8*/); 2289 2269 break; 2290 2270 … … 2675 2655 2676 2656 2657 /** 2658 * Inserts a ModR/M byte with mod=3 and set the two idxFields members. 2659 * 2660 * @returns off + 1. 2661 * @param pThis The state. 2662 * @param off Current instruction offset. 2663 * @param uReg Register index for ModR/M.reg. 2664 * @param uRegMem Register index for ModR/M.rm. 2665 * @param uVexVvvv The VEX.vvvv register. 2666 */ 2667 static unsigned Bs3Cg1InsertModRmWithRegFieldsAndVvvv(PBS3CG1STATE pThis, unsigned off, 2668 uint8_t uReg, uint8_t uRegMem, uint8_t uVexVvvv) 2669 { 2670 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, uReg & 7, uRegMem & 7); 2671 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + uReg; 2672 pThis->aOperands[1 ].idxField = pThis->aOperands[1 ].idxFieldBase + uVexVvvv; 2673 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + uRegMem; 2674 return off; 2675 } 2676 2677 2677 2678 static unsigned BS3_NEAR_CODE Bs3Cg1EncodeNext_VEX_MODRM_Vd_WO_Ed_WZ(PBS3CG1STATE pThis, unsigned iEncoding) 2678 2679 { … … 2684 2685 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 1 /*~R*/); 2685 2686 off = Bs3Cg1InsertOpcodes(pThis, off); 2686 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 1, 0); 2687 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 0; 2688 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 1; 2687 off = Bs3Cg1InsertModRmWithRegFields(pThis, off, 1, 0); 2689 2688 break; 2690 2689 case 1: 2691 2690 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/); 2692 2691 off = Bs3Cg1InsertOpcodes(pThis, off); 2693 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 6, 2); 2694 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 2; 2695 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 6; 2692 off = Bs3Cg1InsertModRmWithRegFields(pThis, off, 6, 2); 2696 2693 break; 2697 2694 case 2: 2698 2695 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 1 /*L-invalid*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/); 2699 2696 off = Bs3Cg1InsertOpcodes(pThis, off); 2700 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 6, 2); 2701 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 2; 2702 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 6; 2697 off = Bs3Cg1InsertModRmWithRegFields(pThis, off, 6, 2); 2703 2698 pThis->fInvalidEncoding = true; 2704 2699 break; … … 2706 2701 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xe /*~V-invalid*/, 0 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/); 2707 2702 off = Bs3Cg1InsertOpcodes(pThis, off); 2708 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 6, 2); 2709 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 2; 2710 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 6; 2703 off = Bs3Cg1InsertModRmWithRegFields(pThis, off, 6, 2); 2711 2704 pThis->fInvalidEncoding = true; 2712 2705 iEncoding += !BS3CG1_IS_64BIT_TARGET(pThis) ? 1 : 0; … … 2716 2709 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 0 /*~R*/, 1 /*~X*/, 0 /*~B*/, 0 /*W*/); 2717 2710 off = Bs3Cg1InsertOpcodes(pThis, off); 2718 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 6, 2); 2719 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 2 + 8; 2720 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 6 + 8; 2711 off = Bs3Cg1InsertModRmWithRegFields(pThis, off, 6+8, 2+8); 2721 2712 break; 2722 2713 #endif … … 2776 2767 { 2777 2768 case 0: 2778 pThis->aOperands[pThis->iRmOp 2769 pThis->aOperands[pThis->iRmOp].enmLocation = pThis->aOperands[pThis->iRmOp].enmLocationReg; 2779 2770 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 1 /*W*/); 2780 2771 off = Bs3Cg1InsertOpcodes(pThis, off); 2781 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 6, 2); 2782 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 2; 2783 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 6; 2772 off = Bs3Cg1InsertModRmWithRegFields(pThis, off, 6, 2); 2784 2773 break; 2785 2774 case 1: 2786 2775 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 1 /*L-invalid*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 1 /*W*/); 2787 2776 off = Bs3Cg1InsertOpcodes(pThis, off); 2788 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 6, 2); 2789 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 2; 2790 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 6; 2777 off = Bs3Cg1InsertModRmWithRegFields(pThis, off, 6, 2); 2791 2778 pThis->fInvalidEncoding = true; 2792 2779 break; … … 2794 2781 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xe /*~V-invalid*/, 0 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 1 /*W*/); 2795 2782 off = Bs3Cg1InsertOpcodes(pThis, off); 2796 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 6, 2); 2797 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 2; 2798 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 6; 2783 off = Bs3Cg1InsertModRmWithRegFields(pThis, off, 6, 2); 2799 2784 pThis->fInvalidEncoding = true; 2800 2785 break; … … 2802 2787 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 0 /*~R*/, 1 /*~X*/, 0 /*~B*/, 1 /*W*/); 2803 2788 off = Bs3Cg1InsertOpcodes(pThis, off); 2804 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 6, 2); 2805 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 2 + 8; 2806 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 6 + 8; 2789 off = Bs3Cg1InsertModRmWithRegFields(pThis, off, 6+8, 2+8); 2807 2790 break; 2808 2791 case 4: … … 2848 2831 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 1 /*~R*/); 2849 2832 off = Bs3Cg1InsertOpcodes(pThis, off); 2850 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 2, 1); 2851 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 2; 2852 pThis->aOperands[1 ].idxField = pThis->aOperands[1 ].idxFieldBase + 0; 2853 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 1; 2833 off = Bs3Cg1InsertModRmWithRegFieldsAndVvvv(pThis, off, 2, 1, 0); 2854 2834 break; 2855 2835 case 1: 2856 2836 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0x8 /*~V*/, 1 /*L-ignored*/, 1 /*~R*/); 2857 2837 off = Bs3Cg1InsertOpcodes(pThis, off); 2858 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 3, 1); 2859 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 3; 2860 pThis->aOperands[1 ].idxField = pThis->aOperands[1 ].idxFieldBase + 7; 2861 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 1; 2838 off = Bs3Cg1InsertModRmWithRegFieldsAndVvvv(pThis, off, 3, 1, 7); 2862 2839 iEncoding += !BS3CG1_IS_64BIT_TARGET(pThis) ? 1 : 0; 2863 2840 break; … … 2866 2843 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0 /*~V*/, 0 /*L*/, 0 /*~R*/); 2867 2844 off = Bs3Cg1InsertOpcodes(pThis, off); 2868 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 3, 2); 2869 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 11; 2870 pThis->aOperands[1 ].idxField = pThis->aOperands[1 ].idxFieldBase + 15; 2871 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 2; 2845 off = Bs3Cg1InsertModRmWithRegFieldsAndVvvv(pThis, off, 3+8, 2, 15); 2872 2846 break; 2873 2847 #endif … … 2875 2849 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/); 2876 2850 off = Bs3Cg1InsertOpcodes(pThis, off); 2877 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 2, 1); 2878 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 2; 2879 pThis->aOperands[1 ].idxField = pThis->aOperands[1 ].idxFieldBase + 0; 2880 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 1; 2851 off = Bs3Cg1InsertModRmWithRegFieldsAndVvvv(pThis, off, 2, 1, 0); 2881 2852 break; 2882 2853 case 4: 2883 2854 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 1 /*L - ignored*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/); 2884 2855 off = Bs3Cg1InsertOpcodes(pThis, off); 2885 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 2, 1); 2886 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 2; 2887 pThis->aOperands[1 ].idxField = pThis->aOperands[1 ].idxFieldBase + 0; 2888 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 1; 2856 off = Bs3Cg1InsertModRmWithRegFieldsAndVvvv(pThis, off, 2, 1, 0); 2889 2857 break; 2890 2858 case 5: 2891 2859 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xc /*~V*/, 0 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 1 /*W-ignored*/); 2892 2860 off = Bs3Cg1InsertOpcodes(pThis, off); 2893 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 2, 1); 2894 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 2; 2895 pThis->aOperands[1 ].idxField = pThis->aOperands[1 ].idxFieldBase + 3; 2896 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 1; 2861 off = Bs3Cg1InsertModRmWithRegFieldsAndVvvv(pThis, off, 2, 1, 3); 2897 2862 break; 2898 2863 case 6: 2899 2864 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0 /*~V*/, 0 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 1 /*W-ignored*/); 2900 2865 off = Bs3Cg1InsertOpcodes(pThis, off); 2901 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 2, 1); 2902 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 2; 2903 pThis->aOperands[1 ].idxField = pThis->aOperands[1 ].idxFieldBase + (BS3CG1_IS_64BIT_TARGET(pThis) ? 15 : 7); 2904 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 1; 2866 off = Bs3Cg1InsertModRmWithRegFieldsAndVvvv(pThis, off, 2, 1, BS3CG1_IS_64BIT_TARGET(pThis) ? 15 : 7); 2905 2867 break; 2906 2868 case 7: 2907 2869 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0 /*~V*/, 0 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/); 2908 2870 off = Bs3Cg1InsertOpcodes(pThis, off); 2909 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 2, 1); 2910 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 2; 2911 pThis->aOperands[1 ].idxField = pThis->aOperands[1 ].idxFieldBase + (BS3CG1_IS_64BIT_TARGET(pThis) ? 15 : 7); 2912 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 1; 2871 off = Bs3Cg1InsertModRmWithRegFieldsAndVvvv(pThis, off, 2, 1, BS3CG1_IS_64BIT_TARGET(pThis) ? 15 : 7); 2913 2872 break; 2914 2873 default: … … 2932 2891 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 1 /*~R*/); 2933 2892 off = Bs3Cg1InsertOpcodes(pThis, off); 2934 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 2, 1); 2935 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 2; 2936 pThis->aOperands[1 ].idxField = pThis->aOperands[1 ].idxFieldBase + 0; 2937 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 1; 2893 off = Bs3Cg1InsertModRmWithRegFieldsAndVvvv(pThis, off, 2, 1, 0); 2938 2894 break; 2939 2895 case 1: 2940 2896 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0x8 /*~V*/, 1 /*L-ignored*/, 1 /*~R*/); 2941 2897 off = Bs3Cg1InsertOpcodes(pThis, off); 2942 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 3, 1); 2943 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 3; 2944 pThis->aOperands[1 ].idxField = pThis->aOperands[1 ].idxFieldBase + 7; 2945 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 1; 2898 off = Bs3Cg1InsertModRmWithRegFieldsAndVvvv(pThis, off, 3, 1, 7); 2946 2899 pThis->fInvalidEncoding = true; 2947 2900 iEncoding += !BS3CG1_IS_64BIT_TARGET(pThis) ? 1 : 0; … … 2951 2904 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0 /*~V*/, 0 /*L*/, 0 /*~R*/); 2952 2905 off = Bs3Cg1InsertOpcodes(pThis, off); 2953 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 3, 2); 2954 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 11; 2955 pThis->aOperands[1 ].idxField = pThis->aOperands[1 ].idxFieldBase + 15; 2956 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 2; 2906 off = Bs3Cg1InsertModRmWithRegFieldsAndVvvv(pThis, off, 3+8, 2, 15); 2957 2907 break; 2958 2908 #endif … … 2960 2910 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/); 2961 2911 off = Bs3Cg1InsertOpcodes(pThis, off); 2962 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 2, 1); 2963 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 2; 2964 pThis->aOperands[1 ].idxField = pThis->aOperands[1 ].idxFieldBase + 0; 2965 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 1; 2912 off = Bs3Cg1InsertModRmWithRegFieldsAndVvvv(pThis, off, 2, 1, 0); 2966 2913 break; 2967 2914 case 4: 2968 2915 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 1 /*L - ignored*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/); 2969 2916 off = Bs3Cg1InsertOpcodes(pThis, off); 2970 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 2, 1); 2971 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 2; 2972 pThis->aOperands[1 ].idxField = pThis->aOperands[1 ].idxFieldBase + 0; 2973 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 1; 2917 off = Bs3Cg1InsertModRmWithRegFieldsAndVvvv(pThis, off, 2, 1, 0); 2974 2918 pThis->fInvalidEncoding = true; 2975 2919 break; … … 2977 2921 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xc /*~V*/, 0 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 1 /*W-ignored*/); 2978 2922 off = Bs3Cg1InsertOpcodes(pThis, off); 2979 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 2, 1); 2980 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 2; 2981 pThis->aOperands[1 ].idxField = pThis->aOperands[1 ].idxFieldBase + 3; 2982 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 1; 2923 off = Bs3Cg1InsertModRmWithRegFieldsAndVvvv(pThis, off, 2, 1, 3); 2983 2924 break; 2984 2925 case 6: 2985 2926 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0 /*~V*/, 0 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 1 /*W-ignored*/); 2986 2927 off = Bs3Cg1InsertOpcodes(pThis, off); 2987 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 2, 1); 2988 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 2; 2989 pThis->aOperands[1 ].idxField = pThis->aOperands[1 ].idxFieldBase + (BS3CG1_IS_64BIT_TARGET(pThis) ? 15 : 7); 2990 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 1; 2928 off = Bs3Cg1InsertModRmWithRegFieldsAndVvvv(pThis, off, 2, 1, BS3CG1_IS_64BIT_TARGET(pThis) ? 15 : 7); 2991 2929 break; 2992 2930 case 7: 2993 2931 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0 /*~V*/, 0 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/); 2994 2932 off = Bs3Cg1InsertOpcodes(pThis, off); 2995 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 2, 1); 2996 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 2; 2997 pThis->aOperands[1 ].idxField = pThis->aOperands[1 ].idxFieldBase + (BS3CG1_IS_64BIT_TARGET(pThis) ? 15 : 7); 2998 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 1; 2933 off = Bs3Cg1InsertModRmWithRegFieldsAndVvvv(pThis, off, 2, 1, BS3CG1_IS_64BIT_TARGET(pThis) ? 15 : 7); 2999 2934 break; 3000 2935 default: … … 3557 3492 /* 128-bit wide stuff goes first, then we'll update the operand widths afterwards. */ 3558 3493 case 0: 3494 pThis->aOperands[pThis->iRmOp ].enmLocation = pThis->aOperands[pThis->iRmOp].enmLocationReg; 3559 3495 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 1 /*~R*/); 3560 3496 off = Bs3Cg1InsertOpcodes(pThis, off); 3561 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 1, 0); 3562 pThis->aOperands[pThis->iRmOp ].enmLocation = pThis->aOperands[pThis->iRmOp].enmLocationReg; 3563 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 0; 3564 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 1; 3497 off = Bs3Cg1InsertModRmWithRegFields(pThis, off, 1, 0); 3565 3498 break; 3566 3499 … … 3568 3501 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/); 3569 3502 off = Bs3Cg1InsertOpcodes(pThis, off); 3570 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 4, 5); 3571 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 5; 3572 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 4; 3503 off = Bs3Cg1InsertModRmWithRegFields(pThis, off, 4, 5); 3573 3504 break; 3574 3505 case 2: 3575 3506 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 1 /*W - ignored*/); 3576 3507 off = Bs3Cg1InsertOpcodes(pThis, off); 3577 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 5, 4); 3578 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 4; 3579 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 5; 3508 off = Bs3Cg1InsertModRmWithRegFields(pThis, off, 5, 4); 3580 3509 break; 3581 3510 case 3: … … 3611 3540 /* 128-bit invalid encodings: */ 3612 3541 case 8: 3542 pThis->aOperands[pThis->iRmOp ].enmLocation = pThis->aOperands[pThis->iRmOp].enmLocationReg; 3613 3543 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0xe /*~V*/, 0 /*L*/, 1 /*~R*/); /* Bad V value */ 3614 3544 off = Bs3Cg1InsertOpcodes(pThis, off); 3615 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 1, 0); 3616 pThis->aOperands[pThis->iRmOp ].enmLocation = pThis->aOperands[pThis->iRmOp].enmLocationReg; 3617 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 0; 3618 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 1; 3545 off = Bs3Cg1InsertModRmWithRegFields(pThis, off, 1, 0); 3619 3546 pThis->fInvalidEncoding = true; 3620 3547 break; … … 3622 3549 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0 /*~V*/, 0 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/); 3623 3550 off = Bs3Cg1InsertOpcodes(pThis, off); 3624 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 4, 5); 3625 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 5; 3626 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 4; 3551 off = Bs3Cg1InsertModRmWithRegFields(pThis, off, 4, 5); 3627 3552 pThis->fInvalidEncoding = true; 3628 3553 iEncoding = 20-1; … … 3658 3583 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, iEncoding >= 20 /*L*/, 1 /*~R*/); 3659 3584 off = Bs3Cg1InsertOpcodes(pThis, off); 3660 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 1, 0); 3661 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 0; 3662 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 1; 3585 off = Bs3Cg1InsertModRmWithRegFields(pThis, off, 1, 0); 3663 3586 break; 3664 3587 … … 3667 3590 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, iEncoding >= 20 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/); 3668 3591 off = Bs3Cg1InsertOpcodes(pThis, off); 3669 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 4, 5); 3670 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 5; 3671 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 4; 3592 off = Bs3Cg1InsertModRmWithRegFields(pThis, off, 4, 5); 3672 3593 break; 3673 3594 case 2: … … 3675 3596 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, iEncoding >= 20 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 1 /*W - ignored*/); 3676 3597 off = Bs3Cg1InsertOpcodes(pThis, off); 3677 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 5, 4); 3678 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 4; 3679 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 5; 3598 off = Bs3Cg1InsertModRmWithRegFields(pThis, off, 5, 4); 3680 3599 break; 3681 3600 case 3: … … 3717 3636 case 8: 3718 3637 case 28: 3638 pThis->aOperands[pThis->iRmOp ].enmLocation = pThis->aOperands[pThis->iRmOp].enmLocationReg; 3719 3639 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0xe /*~V*/, iEncoding >= 20 /*L*/, 1 /*~R*/); /* Bad V value */ 3720 3640 off = Bs3Cg1InsertOpcodes(pThis, off); 3721 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 1, 0); 3722 pThis->aOperands[pThis->iRmOp ].enmLocation = pThis->aOperands[pThis->iRmOp].enmLocationReg; 3723 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 0; 3724 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 1; 3641 off = Bs3Cg1InsertModRmWithRegFields(pThis, off, 1, 0); 3725 3642 pThis->fInvalidEncoding = true; 3726 3643 break; … … 3729 3646 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0 /*~V*/, iEncoding >= 20 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/); 3730 3647 off = Bs3Cg1InsertOpcodes(pThis, off); 3731 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 4, 5); 3732 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 5; 3733 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 4; 3648 off = Bs3Cg1InsertModRmWithRegFields(pThis, off, 4, 5); 3734 3649 pThis->fInvalidEncoding = true; 3735 3650 break; … … 3740 3655 off = Bs3Cg1InsertVex3bPrefix(pThis, 1 /*offDst*/, 0xf /*~V*/, iEncoding >= 20 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/); 3741 3656 off = Bs3Cg1InsertOpcodes(pThis, off); 3742 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 4, 5); 3743 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 5; 3744 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 4; 3657 off = Bs3Cg1InsertModRmWithRegFields(pThis, off, 4, 5); 3745 3658 pThis->fInvalidEncoding = true; 3746 3659 break; … … 3750 3663 off = Bs3Cg1InsertVex3bPrefix(pThis, 1 /*offDst*/, 0xf /*~V*/, iEncoding >= 20 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/); 3751 3664 off = Bs3Cg1InsertOpcodes(pThis, off); 3752 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 4, 5); 3753 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 5; 3754 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 4; 3665 off = Bs3Cg1InsertModRmWithRegFields(pThis, off, 4, 5); 3755 3666 pThis->fInvalidEncoding = true; 3756 3667 break; … … 3760 3671 off = Bs3Cg1InsertVex3bPrefix(pThis, 1 /*offDst*/, 0xf /*~V*/, iEncoding >= 20 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/); 3761 3672 off = Bs3Cg1InsertOpcodes(pThis, off); 3762 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 4, 5); 3763 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 5; 3764 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 4; 3673 off = Bs3Cg1InsertModRmWithRegFields(pThis, off, 4, 5); 3765 3674 pThis->fInvalidEncoding = true; 3766 3675 break; … … 3770 3679 off = Bs3Cg1InsertVex3bPrefix(pThis, 1 /*offDst*/, 0xf /*~V*/, iEncoding >= 20 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/); 3771 3680 off = Bs3Cg1InsertOpcodes(pThis, off); 3772 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 4, 5); 3773 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 5; 3774 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 4; 3681 off = Bs3Cg1InsertModRmWithRegFields(pThis, off, 4, 5); 3775 3682 pThis->fInvalidEncoding = true; 3776 3683 iEncoding += !BS3CG1_IS_64BIT_TARGET(pThis) ? 2 + 4 : 0; … … 3783 3690 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, iEncoding >= 20 /*L*/, 0 /*~R*/); 3784 3691 off = Bs3Cg1InsertOpcodes(pThis, off); 3785 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 3, 4); 3786 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 4; 3787 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 11; 3692 off = Bs3Cg1InsertModRmWithRegFields(pThis, off, 3+8, 4); 3788 3693 break; 3789 3694 case 15: … … 3791 3696 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, iEncoding >= 20 /*L*/, 0 /*~R*/, 1 /*~X*/, 0 /*~B*/, 0 /*W*/); 3792 3697 off = Bs3Cg1InsertOpcodes(pThis, off); 3793 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 1, 4); 3794 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 12; 3795 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 9; 3698 off = Bs3Cg1InsertModRmWithRegFields(pThis, off, 1+8, 4+8); 3796 3699 iEncoding += 4; 3797 3700 break; … … 6470 6373 #if 0 6471 6374 /* (for debugging) */ 6472 if (bMode != BS3_MODE_ PP32)6375 if (bMode != BS3_MODE_LM64) 6473 6376 return BS3TESTDOMODE_SKIPPED; 6474 6377 #endif
Note:
See TracChangeset
for help on using the changeset viewer.