Changeset 36829 in vbox for trunk/src/VBox/VMM/VMMAll/IEMAllInstructions.cpp.h
- Timestamp:
- Apr 24, 2011 1:45:25 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllInstructions.cpp.h
r36828 r36829 1647 1647 1648 1648 /** Opcode 0x0f 0x90. */ 1649 FNIEMOP_STUB(iemOp_seto_Jv); 1649 FNIEMOP_DEF(iemOp_seto_Eb) 1650 { 1651 IEMOP_MNEMONIC("seto Eb"); 1652 uint8_t bRm; IEM_OPCODE_GET_NEXT_BYTE(pIemCpu, &bRm); 1653 IEMOP_HLP_NO_LOCK_PREFIX(); /** @todo too early? */ 1654 1655 /** @todo Encoding test: Check if the 'reg' field is ignored or decoded in 1656 * any way. AMD says it's "unused", whatever that means. We're 1657 * ignoring for now. */ 1658 if ((bRm & X86_MODRM_MOD_MASK) == (3 << X86_MODRM_MOD_SHIFT)) 1659 { 1660 /* register target */ 1661 IEM_MC_BEGIN(0, 0); 1662 IEM_MC_IF_EFL_BIT_SET(X86_EFL_OF) { 1663 IEM_MC_STORE_GREG_U8((bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB, 1); 1664 } IEM_MC_ELSE() { 1665 IEM_MC_STORE_GREG_U8((bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB, 0); 1666 } IEM_MC_ENDIF(); 1667 IEM_MC_ADVANCE_RIP(); 1668 IEM_MC_END(); 1669 } 1670 else 1671 { 1672 /* memory target */ 1673 IEM_MC_BEGIN(0, 1); 1674 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); 1675 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm); 1676 IEM_MC_IF_EFL_BIT_SET(X86_EFL_OF) { 1677 IEM_MC_STORE_MEM_U8(pIemCpu->iEffSeg, GCPtrEffDst, 1); 1678 } IEM_MC_ELSE() { 1679 IEM_MC_STORE_MEM_U8(pIemCpu->iEffSeg, GCPtrEffDst, 0); 1680 } IEM_MC_ENDIF(); 1681 IEM_MC_ADVANCE_RIP(); 1682 IEM_MC_END(); 1683 } 1684 return VINF_SUCCESS; 1685 } 1686 1687 1650 1688 /** Opcode 0x0f 0x91. */ 1651 FNIEMOP_STUB(iemOp_setno_Jv); 1689 FNIEMOP_DEF(iemOp_setno_Eb) 1690 { 1691 IEMOP_MNEMONIC("setno Eb"); 1692 uint8_t bRm; IEM_OPCODE_GET_NEXT_BYTE(pIemCpu, &bRm); 1693 IEMOP_HLP_NO_LOCK_PREFIX(); /** @todo too early? */ 1694 1695 /** @todo Encoding test: Check if the 'reg' field is ignored or decoded in 1696 * any way. AMD says it's "unused", whatever that means. We're 1697 * ignoring for now. */ 1698 if ((bRm & X86_MODRM_MOD_MASK) == (3 << X86_MODRM_MOD_SHIFT)) 1699 { 1700 /* register target */ 1701 IEM_MC_BEGIN(0, 0); 1702 IEM_MC_IF_EFL_BIT_SET(X86_EFL_OF) { 1703 IEM_MC_STORE_GREG_U8((bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB, 0); 1704 } IEM_MC_ELSE() { 1705 IEM_MC_STORE_GREG_U8((bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB, 1); 1706 } IEM_MC_ENDIF(); 1707 IEM_MC_ADVANCE_RIP(); 1708 IEM_MC_END(); 1709 } 1710 else 1711 { 1712 /* memory target */ 1713 IEM_MC_BEGIN(0, 1); 1714 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); 1715 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm); 1716 IEM_MC_IF_EFL_BIT_SET(X86_EFL_OF) { 1717 IEM_MC_STORE_MEM_U8(pIemCpu->iEffSeg, GCPtrEffDst, 0); 1718 } IEM_MC_ELSE() { 1719 IEM_MC_STORE_MEM_U8(pIemCpu->iEffSeg, GCPtrEffDst, 1); 1720 } IEM_MC_ENDIF(); 1721 IEM_MC_ADVANCE_RIP(); 1722 IEM_MC_END(); 1723 } 1724 return VINF_SUCCESS; 1725 } 1726 1727 1652 1728 /** Opcode 0x0f 0x92. */ 1653 FNIEMOP_STUB(iemOp_setc_Jv); 1729 FNIEMOP_DEF(iemOp_setc_Eb) 1730 { 1731 IEMOP_MNEMONIC("setc Eb"); 1732 uint8_t bRm; IEM_OPCODE_GET_NEXT_BYTE(pIemCpu, &bRm); 1733 IEMOP_HLP_NO_LOCK_PREFIX(); /** @todo too early? */ 1734 1735 /** @todo Encoding test: Check if the 'reg' field is ignored or decoded in 1736 * any way. AMD says it's "unused", whatever that means. We're 1737 * ignoring for now. */ 1738 if ((bRm & X86_MODRM_MOD_MASK) == (3 << X86_MODRM_MOD_SHIFT)) 1739 { 1740 /* register target */ 1741 IEM_MC_BEGIN(0, 0); 1742 IEM_MC_IF_EFL_BIT_SET(X86_EFL_CF) { 1743 IEM_MC_STORE_GREG_U8((bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB, 1); 1744 } IEM_MC_ELSE() { 1745 IEM_MC_STORE_GREG_U8((bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB, 0); 1746 } IEM_MC_ENDIF(); 1747 IEM_MC_ADVANCE_RIP(); 1748 IEM_MC_END(); 1749 } 1750 else 1751 { 1752 /* memory target */ 1753 IEM_MC_BEGIN(0, 1); 1754 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); 1755 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm); 1756 IEM_MC_IF_EFL_BIT_SET(X86_EFL_CF) { 1757 IEM_MC_STORE_MEM_U8(pIemCpu->iEffSeg, GCPtrEffDst, 1); 1758 } IEM_MC_ELSE() { 1759 IEM_MC_STORE_MEM_U8(pIemCpu->iEffSeg, GCPtrEffDst, 0); 1760 } IEM_MC_ENDIF(); 1761 IEM_MC_ADVANCE_RIP(); 1762 IEM_MC_END(); 1763 } 1764 return VINF_SUCCESS; 1765 } 1766 1767 1654 1768 /** Opcode 0x0f 0x93. */ 1655 FNIEMOP_STUB(iemOp_setnc_Jv); 1769 FNIEMOP_DEF(iemOp_setnc_Eb) 1770 { 1771 IEMOP_MNEMONIC("setnc Eb"); 1772 uint8_t bRm; IEM_OPCODE_GET_NEXT_BYTE(pIemCpu, &bRm); 1773 IEMOP_HLP_NO_LOCK_PREFIX(); /** @todo too early? */ 1774 1775 /** @todo Encoding test: Check if the 'reg' field is ignored or decoded in 1776 * any way. AMD says it's "unused", whatever that means. We're 1777 * ignoring for now. */ 1778 if ((bRm & X86_MODRM_MOD_MASK) == (3 << X86_MODRM_MOD_SHIFT)) 1779 { 1780 /* register target */ 1781 IEM_MC_BEGIN(0, 0); 1782 IEM_MC_IF_EFL_BIT_SET(X86_EFL_CF) { 1783 IEM_MC_STORE_GREG_U8((bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB, 0); 1784 } IEM_MC_ELSE() { 1785 IEM_MC_STORE_GREG_U8((bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB, 1); 1786 } IEM_MC_ENDIF(); 1787 IEM_MC_ADVANCE_RIP(); 1788 IEM_MC_END(); 1789 } 1790 else 1791 { 1792 /* memory target */ 1793 IEM_MC_BEGIN(0, 1); 1794 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); 1795 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm); 1796 IEM_MC_IF_EFL_BIT_SET(X86_EFL_CF) { 1797 IEM_MC_STORE_MEM_U8(pIemCpu->iEffSeg, GCPtrEffDst, 0); 1798 } IEM_MC_ELSE() { 1799 IEM_MC_STORE_MEM_U8(pIemCpu->iEffSeg, GCPtrEffDst, 1); 1800 } IEM_MC_ENDIF(); 1801 IEM_MC_ADVANCE_RIP(); 1802 IEM_MC_END(); 1803 } 1804 return VINF_SUCCESS; 1805 } 1806 1807 1656 1808 /** Opcode 0x0f 0x94. */ 1657 FNIEMOP_STUB(iemOp_sete_Jv); 1809 FNIEMOP_DEF(iemOp_sete_Eb) 1810 { 1811 IEMOP_MNEMONIC("sete Eb"); 1812 uint8_t bRm; IEM_OPCODE_GET_NEXT_BYTE(pIemCpu, &bRm); 1813 IEMOP_HLP_NO_LOCK_PREFIX(); /** @todo too early? */ 1814 1815 /** @todo Encoding test: Check if the 'reg' field is ignored or decoded in 1816 * any way. AMD says it's "unused", whatever that means. We're 1817 * ignoring for now. */ 1818 if ((bRm & X86_MODRM_MOD_MASK) == (3 << X86_MODRM_MOD_SHIFT)) 1819 { 1820 /* register target */ 1821 IEM_MC_BEGIN(0, 0); 1822 IEM_MC_IF_EFL_BIT_SET(X86_EFL_ZF) { 1823 IEM_MC_STORE_GREG_U8((bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB, 1); 1824 } IEM_MC_ELSE() { 1825 IEM_MC_STORE_GREG_U8((bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB, 0); 1826 } IEM_MC_ENDIF(); 1827 IEM_MC_ADVANCE_RIP(); 1828 IEM_MC_END(); 1829 } 1830 else 1831 { 1832 /* memory target */ 1833 IEM_MC_BEGIN(0, 1); 1834 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); 1835 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm); 1836 IEM_MC_IF_EFL_BIT_SET(X86_EFL_ZF) { 1837 IEM_MC_STORE_MEM_U8(pIemCpu->iEffSeg, GCPtrEffDst, 1); 1838 } IEM_MC_ELSE() { 1839 IEM_MC_STORE_MEM_U8(pIemCpu->iEffSeg, GCPtrEffDst, 0); 1840 } IEM_MC_ENDIF(); 1841 IEM_MC_ADVANCE_RIP(); 1842 IEM_MC_END(); 1843 } 1844 return VINF_SUCCESS; 1845 } 1846 1847 1658 1848 /** Opcode 0x0f 0x95. */ 1659 FNIEMOP_STUB(iemOp_setne_Jv); 1849 FNIEMOP_DEF(iemOp_setne_Eb) 1850 { 1851 IEMOP_MNEMONIC("setne Eb"); 1852 uint8_t bRm; IEM_OPCODE_GET_NEXT_BYTE(pIemCpu, &bRm); 1853 IEMOP_HLP_NO_LOCK_PREFIX(); /** @todo too early? */ 1854 1855 /** @todo Encoding test: Check if the 'reg' field is ignored or decoded in 1856 * any way. AMD says it's "unused", whatever that means. We're 1857 * ignoring for now. */ 1858 if ((bRm & X86_MODRM_MOD_MASK) == (3 << X86_MODRM_MOD_SHIFT)) 1859 { 1860 /* register target */ 1861 IEM_MC_BEGIN(0, 0); 1862 IEM_MC_IF_EFL_BIT_SET(X86_EFL_ZF) { 1863 IEM_MC_STORE_GREG_U8((bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB, 0); 1864 } IEM_MC_ELSE() { 1865 IEM_MC_STORE_GREG_U8((bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB, 1); 1866 } IEM_MC_ENDIF(); 1867 IEM_MC_ADVANCE_RIP(); 1868 IEM_MC_END(); 1869 } 1870 else 1871 { 1872 /* memory target */ 1873 IEM_MC_BEGIN(0, 1); 1874 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); 1875 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm); 1876 IEM_MC_IF_EFL_BIT_SET(X86_EFL_ZF) { 1877 IEM_MC_STORE_MEM_U8(pIemCpu->iEffSeg, GCPtrEffDst, 0); 1878 } IEM_MC_ELSE() { 1879 IEM_MC_STORE_MEM_U8(pIemCpu->iEffSeg, GCPtrEffDst, 1); 1880 } IEM_MC_ENDIF(); 1881 IEM_MC_ADVANCE_RIP(); 1882 IEM_MC_END(); 1883 } 1884 return VINF_SUCCESS; 1885 } 1886 1887 1660 1888 /** Opcode 0x0f 0x96. */ 1661 FNIEMOP_STUB(iemOp_setbe_Jv); 1889 FNIEMOP_DEF(iemOp_setbe_Eb) 1890 { 1891 IEMOP_MNEMONIC("setbe Eb"); 1892 uint8_t bRm; IEM_OPCODE_GET_NEXT_BYTE(pIemCpu, &bRm); 1893 IEMOP_HLP_NO_LOCK_PREFIX(); /** @todo too early? */ 1894 1895 /** @todo Encoding test: Check if the 'reg' field is ignored or decoded in 1896 * any way. AMD says it's "unused", whatever that means. We're 1897 * ignoring for now. */ 1898 if ((bRm & X86_MODRM_MOD_MASK) == (3 << X86_MODRM_MOD_SHIFT)) 1899 { 1900 /* register target */ 1901 IEM_MC_BEGIN(0, 0); 1902 IEM_MC_IF_EFL_ANY_BITS_SET(X86_EFL_CF | X86_EFL_ZF) { 1903 IEM_MC_STORE_GREG_U8((bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB, 1); 1904 } IEM_MC_ELSE() { 1905 IEM_MC_STORE_GREG_U8((bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB, 0); 1906 } IEM_MC_ENDIF(); 1907 IEM_MC_ADVANCE_RIP(); 1908 IEM_MC_END(); 1909 } 1910 else 1911 { 1912 /* memory target */ 1913 IEM_MC_BEGIN(0, 1); 1914 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); 1915 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm); 1916 IEM_MC_IF_EFL_ANY_BITS_SET(X86_EFL_CF | X86_EFL_ZF) { 1917 IEM_MC_STORE_MEM_U8(pIemCpu->iEffSeg, GCPtrEffDst, 1); 1918 } IEM_MC_ELSE() { 1919 IEM_MC_STORE_MEM_U8(pIemCpu->iEffSeg, GCPtrEffDst, 0); 1920 } IEM_MC_ENDIF(); 1921 IEM_MC_ADVANCE_RIP(); 1922 IEM_MC_END(); 1923 } 1924 return VINF_SUCCESS; 1925 } 1926 1927 1662 1928 /** Opcode 0x0f 0x97. */ 1663 FNIEMOP_STUB(iemOp_setnbe_Jv); 1929 FNIEMOP_DEF(iemOp_setnbe_Eb) 1930 { 1931 IEMOP_MNEMONIC("setnbe Eb"); 1932 uint8_t bRm; IEM_OPCODE_GET_NEXT_BYTE(pIemCpu, &bRm); 1933 IEMOP_HLP_NO_LOCK_PREFIX(); /** @todo too early? */ 1934 1935 /** @todo Encoding test: Check if the 'reg' field is ignored or decoded in 1936 * any way. AMD says it's "unused", whatever that means. We're 1937 * ignoring for now. */ 1938 if ((bRm & X86_MODRM_MOD_MASK) == (3 << X86_MODRM_MOD_SHIFT)) 1939 { 1940 /* register target */ 1941 IEM_MC_BEGIN(0, 0); 1942 IEM_MC_IF_EFL_ANY_BITS_SET(X86_EFL_CF | X86_EFL_ZF) { 1943 IEM_MC_STORE_GREG_U8((bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB, 0); 1944 } IEM_MC_ELSE() { 1945 IEM_MC_STORE_GREG_U8((bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB, 1); 1946 } IEM_MC_ENDIF(); 1947 IEM_MC_ADVANCE_RIP(); 1948 IEM_MC_END(); 1949 } 1950 else 1951 { 1952 /* memory target */ 1953 IEM_MC_BEGIN(0, 1); 1954 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); 1955 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm); 1956 IEM_MC_IF_EFL_ANY_BITS_SET(X86_EFL_CF | X86_EFL_ZF) { 1957 IEM_MC_STORE_MEM_U8(pIemCpu->iEffSeg, GCPtrEffDst, 0); 1958 } IEM_MC_ELSE() { 1959 IEM_MC_STORE_MEM_U8(pIemCpu->iEffSeg, GCPtrEffDst, 1); 1960 } IEM_MC_ENDIF(); 1961 IEM_MC_ADVANCE_RIP(); 1962 IEM_MC_END(); 1963 } 1964 return VINF_SUCCESS; 1965 } 1966 1967 1664 1968 /** Opcode 0x0f 0x98. */ 1665 FNIEMOP_STUB(iemOp_sets_Jv); 1969 FNIEMOP_DEF(iemOp_sets_Eb) 1970 { 1971 IEMOP_MNEMONIC("sets Eb"); 1972 uint8_t bRm; IEM_OPCODE_GET_NEXT_BYTE(pIemCpu, &bRm); 1973 IEMOP_HLP_NO_LOCK_PREFIX(); /** @todo too early? */ 1974 1975 /** @todo Encoding test: Check if the 'reg' field is ignored or decoded in 1976 * any way. AMD says it's "unused", whatever that means. We're 1977 * ignoring for now. */ 1978 if ((bRm & X86_MODRM_MOD_MASK) == (3 << X86_MODRM_MOD_SHIFT)) 1979 { 1980 /* register target */ 1981 IEM_MC_BEGIN(0, 0); 1982 IEM_MC_IF_EFL_BIT_SET(X86_EFL_SF) { 1983 IEM_MC_STORE_GREG_U8((bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB, 1); 1984 } IEM_MC_ELSE() { 1985 IEM_MC_STORE_GREG_U8((bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB, 0); 1986 } IEM_MC_ENDIF(); 1987 IEM_MC_ADVANCE_RIP(); 1988 IEM_MC_END(); 1989 } 1990 else 1991 { 1992 /* memory target */ 1993 IEM_MC_BEGIN(0, 1); 1994 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); 1995 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm); 1996 IEM_MC_IF_EFL_BIT_SET(X86_EFL_SF) { 1997 IEM_MC_STORE_MEM_U8(pIemCpu->iEffSeg, GCPtrEffDst, 1); 1998 } IEM_MC_ELSE() { 1999 IEM_MC_STORE_MEM_U8(pIemCpu->iEffSeg, GCPtrEffDst, 0); 2000 } IEM_MC_ENDIF(); 2001 IEM_MC_ADVANCE_RIP(); 2002 IEM_MC_END(); 2003 } 2004 return VINF_SUCCESS; 2005 } 2006 2007 1666 2008 /** Opcode 0x0f 0x99. */ 1667 FNIEMOP_STUB(iemOp_setns_Jv); 2009 FNIEMOP_DEF(iemOp_setns_Eb) 2010 { 2011 IEMOP_MNEMONIC("setns Eb"); 2012 uint8_t bRm; IEM_OPCODE_GET_NEXT_BYTE(pIemCpu, &bRm); 2013 IEMOP_HLP_NO_LOCK_PREFIX(); /** @todo too early? */ 2014 2015 /** @todo Encoding test: Check if the 'reg' field is ignored or decoded in 2016 * any way. AMD says it's "unused", whatever that means. We're 2017 * ignoring for now. */ 2018 if ((bRm & X86_MODRM_MOD_MASK) == (3 << X86_MODRM_MOD_SHIFT)) 2019 { 2020 /* register target */ 2021 IEM_MC_BEGIN(0, 0); 2022 IEM_MC_IF_EFL_BIT_SET(X86_EFL_SF) { 2023 IEM_MC_STORE_GREG_U8((bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB, 0); 2024 } IEM_MC_ELSE() { 2025 IEM_MC_STORE_GREG_U8((bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB, 1); 2026 } IEM_MC_ENDIF(); 2027 IEM_MC_ADVANCE_RIP(); 2028 IEM_MC_END(); 2029 } 2030 else 2031 { 2032 /* memory target */ 2033 IEM_MC_BEGIN(0, 1); 2034 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); 2035 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm); 2036 IEM_MC_IF_EFL_BIT_SET(X86_EFL_SF) { 2037 IEM_MC_STORE_MEM_U8(pIemCpu->iEffSeg, GCPtrEffDst, 0); 2038 } IEM_MC_ELSE() { 2039 IEM_MC_STORE_MEM_U8(pIemCpu->iEffSeg, GCPtrEffDst, 1); 2040 } IEM_MC_ENDIF(); 2041 IEM_MC_ADVANCE_RIP(); 2042 IEM_MC_END(); 2043 } 2044 return VINF_SUCCESS; 2045 } 2046 2047 1668 2048 /** Opcode 0x0f 0x9a. */ 1669 FNIEMOP_STUB(iemOp_setp_Jv); 2049 FNIEMOP_DEF(iemOp_setp_Eb) 2050 { 2051 IEMOP_MNEMONIC("setnp Eb"); 2052 uint8_t bRm; IEM_OPCODE_GET_NEXT_BYTE(pIemCpu, &bRm); 2053 IEMOP_HLP_NO_LOCK_PREFIX(); /** @todo too early? */ 2054 2055 /** @todo Encoding test: Check if the 'reg' field is ignored or decoded in 2056 * any way. AMD says it's "unused", whatever that means. We're 2057 * ignoring for now. */ 2058 if ((bRm & X86_MODRM_MOD_MASK) == (3 << X86_MODRM_MOD_SHIFT)) 2059 { 2060 /* register target */ 2061 IEM_MC_BEGIN(0, 0); 2062 IEM_MC_IF_EFL_BIT_SET(X86_EFL_PF) { 2063 IEM_MC_STORE_GREG_U8((bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB, 1); 2064 } IEM_MC_ELSE() { 2065 IEM_MC_STORE_GREG_U8((bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB, 0); 2066 } IEM_MC_ENDIF(); 2067 IEM_MC_ADVANCE_RIP(); 2068 IEM_MC_END(); 2069 } 2070 else 2071 { 2072 /* memory target */ 2073 IEM_MC_BEGIN(0, 1); 2074 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); 2075 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm); 2076 IEM_MC_IF_EFL_BIT_SET(X86_EFL_PF) { 2077 IEM_MC_STORE_MEM_U8(pIemCpu->iEffSeg, GCPtrEffDst, 1); 2078 } IEM_MC_ELSE() { 2079 IEM_MC_STORE_MEM_U8(pIemCpu->iEffSeg, GCPtrEffDst, 0); 2080 } IEM_MC_ENDIF(); 2081 IEM_MC_ADVANCE_RIP(); 2082 IEM_MC_END(); 2083 } 2084 return VINF_SUCCESS; 2085 } 2086 2087 1670 2088 /** Opcode 0x0f 0x9b. */ 1671 FNIEMOP_STUB(iemOp_setnp_Jv); 2089 FNIEMOP_DEF(iemOp_setnp_Eb) 2090 { 2091 IEMOP_MNEMONIC("setnp Eb"); 2092 uint8_t bRm; IEM_OPCODE_GET_NEXT_BYTE(pIemCpu, &bRm); 2093 IEMOP_HLP_NO_LOCK_PREFIX(); /** @todo too early? */ 2094 2095 /** @todo Encoding test: Check if the 'reg' field is ignored or decoded in 2096 * any way. AMD says it's "unused", whatever that means. We're 2097 * ignoring for now. */ 2098 if ((bRm & X86_MODRM_MOD_MASK) == (3 << X86_MODRM_MOD_SHIFT)) 2099 { 2100 /* register target */ 2101 IEM_MC_BEGIN(0, 0); 2102 IEM_MC_IF_EFL_BIT_SET(X86_EFL_PF) { 2103 IEM_MC_STORE_GREG_U8((bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB, 0); 2104 } IEM_MC_ELSE() { 2105 IEM_MC_STORE_GREG_U8((bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB, 1); 2106 } IEM_MC_ENDIF(); 2107 IEM_MC_ADVANCE_RIP(); 2108 IEM_MC_END(); 2109 } 2110 else 2111 { 2112 /* memory target */ 2113 IEM_MC_BEGIN(0, 1); 2114 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); 2115 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm); 2116 IEM_MC_IF_EFL_BIT_SET(X86_EFL_PF) { 2117 IEM_MC_STORE_MEM_U8(pIemCpu->iEffSeg, GCPtrEffDst, 0); 2118 } IEM_MC_ELSE() { 2119 IEM_MC_STORE_MEM_U8(pIemCpu->iEffSeg, GCPtrEffDst, 1); 2120 } IEM_MC_ENDIF(); 2121 IEM_MC_ADVANCE_RIP(); 2122 IEM_MC_END(); 2123 } 2124 return VINF_SUCCESS; 2125 } 2126 2127 1672 2128 /** Opcode 0x0f 0x9c. */ 1673 FNIEMOP_STUB(iemOp_setl_Jv); 2129 FNIEMOP_DEF(iemOp_setl_Eb) 2130 { 2131 IEMOP_MNEMONIC("setl Eb"); 2132 uint8_t bRm; IEM_OPCODE_GET_NEXT_BYTE(pIemCpu, &bRm); 2133 IEMOP_HLP_NO_LOCK_PREFIX(); /** @todo too early? */ 2134 2135 /** @todo Encoding test: Check if the 'reg' field is ignored or decoded in 2136 * any way. AMD says it's "unused", whatever that means. We're 2137 * ignoring for now. */ 2138 if ((bRm & X86_MODRM_MOD_MASK) == (3 << X86_MODRM_MOD_SHIFT)) 2139 { 2140 /* register target */ 2141 IEM_MC_BEGIN(0, 0); 2142 IEM_MC_IF_EFL_BITS_NE(X86_EFL_SF, X86_EFL_OF) { 2143 IEM_MC_STORE_GREG_U8((bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB, 1); 2144 } IEM_MC_ELSE() { 2145 IEM_MC_STORE_GREG_U8((bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB, 0); 2146 } IEM_MC_ENDIF(); 2147 IEM_MC_ADVANCE_RIP(); 2148 IEM_MC_END(); 2149 } 2150 else 2151 { 2152 /* memory target */ 2153 IEM_MC_BEGIN(0, 1); 2154 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); 2155 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm); 2156 IEM_MC_IF_EFL_BITS_NE(X86_EFL_SF, X86_EFL_OF) { 2157 IEM_MC_STORE_MEM_U8(pIemCpu->iEffSeg, GCPtrEffDst, 1); 2158 } IEM_MC_ELSE() { 2159 IEM_MC_STORE_MEM_U8(pIemCpu->iEffSeg, GCPtrEffDst, 0); 2160 } IEM_MC_ENDIF(); 2161 IEM_MC_ADVANCE_RIP(); 2162 IEM_MC_END(); 2163 } 2164 return VINF_SUCCESS; 2165 } 2166 2167 1674 2168 /** Opcode 0x0f 0x9d. */ 1675 FNIEMOP_STUB(iemOp_setnl_Jv); 2169 FNIEMOP_DEF(iemOp_setnl_Eb) 2170 { 2171 IEMOP_MNEMONIC("setnl Eb"); 2172 uint8_t bRm; IEM_OPCODE_GET_NEXT_BYTE(pIemCpu, &bRm); 2173 IEMOP_HLP_NO_LOCK_PREFIX(); /** @todo too early? */ 2174 2175 /** @todo Encoding test: Check if the 'reg' field is ignored or decoded in 2176 * any way. AMD says it's "unused", whatever that means. We're 2177 * ignoring for now. */ 2178 if ((bRm & X86_MODRM_MOD_MASK) == (3 << X86_MODRM_MOD_SHIFT)) 2179 { 2180 /* register target */ 2181 IEM_MC_BEGIN(0, 0); 2182 IEM_MC_IF_EFL_BITS_NE(X86_EFL_SF, X86_EFL_OF) { 2183 IEM_MC_STORE_GREG_U8((bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB, 0); 2184 } IEM_MC_ELSE() { 2185 IEM_MC_STORE_GREG_U8((bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB, 1); 2186 } IEM_MC_ENDIF(); 2187 IEM_MC_ADVANCE_RIP(); 2188 IEM_MC_END(); 2189 } 2190 else 2191 { 2192 /* memory target */ 2193 IEM_MC_BEGIN(0, 1); 2194 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); 2195 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm); 2196 IEM_MC_IF_EFL_BITS_NE(X86_EFL_SF, X86_EFL_OF) { 2197 IEM_MC_STORE_MEM_U8(pIemCpu->iEffSeg, GCPtrEffDst, 0); 2198 } IEM_MC_ELSE() { 2199 IEM_MC_STORE_MEM_U8(pIemCpu->iEffSeg, GCPtrEffDst, 1); 2200 } IEM_MC_ENDIF(); 2201 IEM_MC_ADVANCE_RIP(); 2202 IEM_MC_END(); 2203 } 2204 return VINF_SUCCESS; 2205 } 2206 2207 1676 2208 /** Opcode 0x0f 0x9e. */ 1677 FNIEMOP_STUB(iemOp_setle_Jv); 2209 FNIEMOP_DEF(iemOp_setle_Eb) 2210 { 2211 IEMOP_MNEMONIC("setle Eb"); 2212 uint8_t bRm; IEM_OPCODE_GET_NEXT_BYTE(pIemCpu, &bRm); 2213 IEMOP_HLP_NO_LOCK_PREFIX(); /** @todo too early? */ 2214 2215 /** @todo Encoding test: Check if the 'reg' field is ignored or decoded in 2216 * any way. AMD says it's "unused", whatever that means. We're 2217 * ignoring for now. */ 2218 if ((bRm & X86_MODRM_MOD_MASK) == (3 << X86_MODRM_MOD_SHIFT)) 2219 { 2220 /* register target */ 2221 IEM_MC_BEGIN(0, 0); 2222 IEM_MC_IF_EFL_BIT_SET_OR_BITS_NE(X86_EFL_ZF, X86_EFL_SF, X86_EFL_OF) { 2223 IEM_MC_STORE_GREG_U8((bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB, 1); 2224 } IEM_MC_ELSE() { 2225 IEM_MC_STORE_GREG_U8((bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB, 0); 2226 } IEM_MC_ENDIF(); 2227 IEM_MC_ADVANCE_RIP(); 2228 IEM_MC_END(); 2229 } 2230 else 2231 { 2232 /* memory target */ 2233 IEM_MC_BEGIN(0, 1); 2234 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); 2235 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm); 2236 IEM_MC_IF_EFL_BIT_SET_OR_BITS_NE(X86_EFL_ZF, X86_EFL_SF, X86_EFL_OF) { 2237 IEM_MC_STORE_MEM_U8(pIemCpu->iEffSeg, GCPtrEffDst, 1); 2238 } IEM_MC_ELSE() { 2239 IEM_MC_STORE_MEM_U8(pIemCpu->iEffSeg, GCPtrEffDst, 0); 2240 } IEM_MC_ENDIF(); 2241 IEM_MC_ADVANCE_RIP(); 2242 IEM_MC_END(); 2243 } 2244 return VINF_SUCCESS; 2245 } 2246 2247 1678 2248 /** Opcode 0x0f 0x9f. */ 1679 FNIEMOP_STUB(iemOp_setnle_Jv); 2249 FNIEMOP_DEF(iemOp_setnle_Eb) 2250 { 2251 IEMOP_MNEMONIC("setnle Eb"); 2252 uint8_t bRm; IEM_OPCODE_GET_NEXT_BYTE(pIemCpu, &bRm); 2253 IEMOP_HLP_NO_LOCK_PREFIX(); /** @todo too early? */ 2254 2255 /** @todo Encoding test: Check if the 'reg' field is ignored or decoded in 2256 * any way. AMD says it's "unused", whatever that means. We're 2257 * ignoring for now. */ 2258 if ((bRm & X86_MODRM_MOD_MASK) == (3 << X86_MODRM_MOD_SHIFT)) 2259 { 2260 /* register target */ 2261 IEM_MC_BEGIN(0, 0); 2262 IEM_MC_IF_EFL_BIT_SET_OR_BITS_NE(X86_EFL_ZF, X86_EFL_SF, X86_EFL_OF) { 2263 IEM_MC_STORE_GREG_U8((bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB, 0); 2264 } IEM_MC_ELSE() { 2265 IEM_MC_STORE_GREG_U8((bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB, 1); 2266 } IEM_MC_ENDIF(); 2267 IEM_MC_ADVANCE_RIP(); 2268 IEM_MC_END(); 2269 } 2270 else 2271 { 2272 /* memory target */ 2273 IEM_MC_BEGIN(0, 1); 2274 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); 2275 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm); 2276 IEM_MC_IF_EFL_BIT_SET_OR_BITS_NE(X86_EFL_ZF, X86_EFL_SF, X86_EFL_OF) { 2277 IEM_MC_STORE_MEM_U8(pIemCpu->iEffSeg, GCPtrEffDst, 0); 2278 } IEM_MC_ELSE() { 2279 IEM_MC_STORE_MEM_U8(pIemCpu->iEffSeg, GCPtrEffDst, 1); 2280 } IEM_MC_ENDIF(); 2281 IEM_MC_ADVANCE_RIP(); 2282 IEM_MC_END(); 2283 } 2284 return VINF_SUCCESS; 2285 } 1680 2286 1681 2287 … … 2270 2876 /* 0x88 */ iemOp_js_Jv, iemOp_jns_Jv, iemOp_jp_Jv, iemOp_jnp_Jv, 2271 2877 /* 0x8c */ iemOp_jl_Jv, iemOp_jnl_Jv, iemOp_jle_Jv, iemOp_jnle_Jv, 2272 /* 0x90 */ iemOp_seto_ Jv, iemOp_setno_Jv, iemOp_setc_Jv, iemOp_setnc_Jv,2273 /* 0x94 */ iemOp_sete_ Jv, iemOp_setne_Jv, iemOp_setbe_Jv, iemOp_setnbe_Jv,2274 /* 0x98 */ iemOp_sets_ Jv, iemOp_setns_Jv, iemOp_setp_Jv, iemOp_setnp_Jv,2275 /* 0x9c */ iemOp_setl_ Jv, iemOp_setnl_Jv, iemOp_setle_Jv, iemOp_setnle_Jv,2878 /* 0x90 */ iemOp_seto_Eb, iemOp_setno_Eb, iemOp_setc_Eb, iemOp_setnc_Eb, 2879 /* 0x94 */ iemOp_sete_Eb, iemOp_setne_Eb, iemOp_setbe_Eb, iemOp_setnbe_Eb, 2880 /* 0x98 */ iemOp_sets_Eb, iemOp_setns_Eb, iemOp_setp_Eb, iemOp_setnp_Eb, 2881 /* 0x9c */ iemOp_setl_Eb, iemOp_setnl_Eb, iemOp_setle_Eb, iemOp_setnle_Eb, 2276 2882 /* 0xa0 */ iemOp_push_fs, iemOp_pop_fs, iemOp_cpuid, iemOp_bt_Ev_Gv, 2277 2883 /* 0xa4 */ iemOp_shld_Ev_Gv_Ib, iemOp_shld_Ev_Gv_CL, iemOp_Invalid, iemOp_Invalid, … … 5804 6410 } IEM_MC_ENDIF(); \ 5805 6411 IEM_MC_ADVANCE_RIP(); \ 5806 IEM_MC_END(); \ 5807 6412 IEM_MC_END(); 5808 6413 5809 6414 /** Opcode 0xa4. */ … … 5813 6418 5814 6419 /* 5815 * Use the C implementation if a repeat eprefix is encountered.6420 * Use the C implementation if a repeat prefix is encountered. 5816 6421 */ 5817 6422 if (pIemCpu->fPrefixes & (IEM_OP_PRF_REPNZ | IEM_OP_PRF_REPZ)) … … 5848 6453 5849 6454 /* 5850 * Use the C implementation if a repeat eprefix is encountered.6455 * Use the C implementation if a repeat prefix is encountered. 5851 6456 */ 5852 6457 if (pIemCpu->fPrefixes & (IEM_OP_PRF_REPNZ | IEM_OP_PRF_REPZ)) … … 5927 6532 #undef IEM_MOVS_CASE 5928 6533 6534 /** Macro used by iemOp_cmpsb_Xb_Yb and iemOp_cmpswd_Xv_Yv */ 6535 #define IEM_CMPS_CASE(ValBits, AddrBits) \ 6536 IEM_MC_BEGIN(3, 3); \ 6537 IEM_MC_ARG(uint##ValBits##_t *, puValue1, 0); \ 6538 IEM_MC_ARG(uint##ValBits##_t, uValue2, 1); \ 6539 IEM_MC_ARG(uint32_t *, pEFlags, 2); \ 6540 IEM_MC_LOCAL(uint##ValBits##_t, uValue1); \ 6541 IEM_MC_LOCAL(uint##AddrBits##_t, uAddr); \ 6542 \ 6543 IEM_MC_FETCH_GREG_U##AddrBits(uAddr, X86_GREG_xSI); \ 6544 IEM_MC_FETCH_MEM_U##ValBits(uValue1, pIemCpu->iEffSeg, uAddr); \ 6545 IEM_MC_FETCH_GREG_U##AddrBits(uAddr, X86_GREG_xDI); \ 6546 IEM_MC_FETCH_MEM_U##ValBits(uValue2, X86_SREG_ES, uAddr); \ 6547 IEM_MC_REF_LOCAL(puValue1, uValue1); \ 6548 IEM_MC_REF_EFLAGS(pEFlags); \ 6549 IEM_MC_CALL_VOID_AIMPL_3(iemAImpl_cmp_u##ValBits, puValue1, uValue2, pEFlags); \ 6550 \ 6551 IEM_MC_IF_EFL_BIT_SET(X86_EFL_DF) { \ 6552 IEM_MC_SUB_GREG_U##AddrBits(X86_GREG_xDI, ValBits / 8); \ 6553 IEM_MC_SUB_GREG_U##AddrBits(X86_GREG_xSI, ValBits / 8); \ 6554 } IEM_MC_ELSE() { \ 6555 IEM_MC_ADD_GREG_U##AddrBits(X86_GREG_xDI, ValBits / 8); \ 6556 IEM_MC_ADD_GREG_U##AddrBits(X86_GREG_xSI, ValBits / 8); \ 6557 } IEM_MC_ENDIF(); \ 6558 IEM_MC_ADVANCE_RIP(); \ 6559 IEM_MC_END(); \ 6560 5929 6561 /** Opcode 0xa6. */ 5930 FNIEMOP_STUB(iemOp_cmpsb_Xb_Yb); 6562 FNIEMOP_DEF(iemOp_cmpsb_Xb_Yb) 6563 { 6564 IEMOP_HLP_NO_LOCK_PREFIX(); 6565 6566 /* 6567 * Use the C implementation if a repeat prefix is encountered. 6568 */ 6569 if (pIemCpu->fPrefixes & IEM_OP_PRF_REPZ) 6570 { 6571 IEMOP_MNEMONIC("repe cmps Xb,Yb"); 6572 switch (pIemCpu->enmEffAddrMode) 6573 { 6574 case IEMMODE_16BIT: return IEM_MC_DEFER_TO_CIMPL_1(iemCImpl_repe_cmps_op8_addr16, pIemCpu->iEffSeg); 6575 case IEMMODE_32BIT: return IEM_MC_DEFER_TO_CIMPL_1(iemCImpl_repe_cmps_op8_addr32, pIemCpu->iEffSeg); 6576 case IEMMODE_64BIT: return IEM_MC_DEFER_TO_CIMPL_1(iemCImpl_repe_cmps_op8_addr64, pIemCpu->iEffSeg); 6577 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 6578 } 6579 } 6580 if (pIemCpu->fPrefixes & IEM_OP_PRF_REPNZ) 6581 { 6582 IEMOP_MNEMONIC("repe cmps Xb,Yb"); 6583 switch (pIemCpu->enmEffAddrMode) 6584 { 6585 case IEMMODE_16BIT: return IEM_MC_DEFER_TO_CIMPL_1(iemCImpl_repne_cmps_op8_addr16, pIemCpu->iEffSeg); 6586 case IEMMODE_32BIT: return IEM_MC_DEFER_TO_CIMPL_1(iemCImpl_repne_cmps_op8_addr32, pIemCpu->iEffSeg); 6587 case IEMMODE_64BIT: return IEM_MC_DEFER_TO_CIMPL_1(iemCImpl_repne_cmps_op8_addr64, pIemCpu->iEffSeg); 6588 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 6589 } 6590 } 6591 IEMOP_MNEMONIC("cmps Xb,Yb"); 6592 6593 /* 6594 * Sharing case implementation with cmps[wdq] below. 6595 */ 6596 switch (pIemCpu->enmEffAddrMode) 6597 { 6598 case IEMMODE_16BIT: IEM_CMPS_CASE(8, 16); break; 6599 case IEMMODE_32BIT: IEM_CMPS_CASE(8, 32); break; 6600 case IEMMODE_64BIT: IEM_CMPS_CASE(8, 64); break; 6601 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 6602 } 6603 return VINF_SUCCESS; 6604 6605 } 6606 6607 5931 6608 /** Opcode 0xa7. */ 5932 FNIEMOP_STUB(iemOp_cmpswd_Xv_Yv); 5933 6609 FNIEMOP_DEF(iemOp_cmpswd_Xv_Yv) 6610 { 6611 IEMOP_HLP_NO_LOCK_PREFIX(); 6612 6613 /* 6614 * Use the C implementation if a repeat prefix is encountered. 6615 */ 6616 if (pIemCpu->fPrefixes & IEM_OP_PRF_REPZ) 6617 { 6618 IEMOP_MNEMONIC("repe cmps Xv,Yv"); 6619 switch (pIemCpu->enmEffOpSize) 6620 { 6621 case IEMMODE_16BIT: 6622 switch (pIemCpu->enmEffAddrMode) 6623 { 6624 case IEMMODE_16BIT: return IEM_MC_DEFER_TO_CIMPL_1(iemCImpl_repe_cmps_op16_addr16, pIemCpu->iEffSeg); 6625 case IEMMODE_32BIT: return IEM_MC_DEFER_TO_CIMPL_1(iemCImpl_repe_cmps_op16_addr32, pIemCpu->iEffSeg); 6626 case IEMMODE_64BIT: return IEM_MC_DEFER_TO_CIMPL_1(iemCImpl_repe_cmps_op16_addr64, pIemCpu->iEffSeg); 6627 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 6628 } 6629 break; 6630 case IEMMODE_32BIT: 6631 switch (pIemCpu->enmEffAddrMode) 6632 { 6633 case IEMMODE_16BIT: return IEM_MC_DEFER_TO_CIMPL_1(iemCImpl_repe_cmps_op32_addr16, pIemCpu->iEffSeg); 6634 case IEMMODE_32BIT: return IEM_MC_DEFER_TO_CIMPL_1(iemCImpl_repe_cmps_op32_addr32, pIemCpu->iEffSeg); 6635 case IEMMODE_64BIT: return IEM_MC_DEFER_TO_CIMPL_1(iemCImpl_repe_cmps_op32_addr64, pIemCpu->iEffSeg); 6636 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 6637 } 6638 case IEMMODE_64BIT: 6639 switch (pIemCpu->enmEffAddrMode) 6640 { 6641 case IEMMODE_16BIT: AssertFailedReturn(VERR_INTERNAL_ERROR_3); 6642 case IEMMODE_32BIT: return IEM_MC_DEFER_TO_CIMPL_1(iemCImpl_repe_cmps_op64_addr32, pIemCpu->iEffSeg); 6643 case IEMMODE_64BIT: return IEM_MC_DEFER_TO_CIMPL_1(iemCImpl_repe_cmps_op64_addr64, pIemCpu->iEffSeg); 6644 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 6645 } 6646 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 6647 } 6648 } 6649 6650 if (pIemCpu->fPrefixes & IEM_OP_PRF_REPNZ) 6651 { 6652 IEMOP_MNEMONIC("repne cmps Xv,Yv"); 6653 switch (pIemCpu->enmEffOpSize) 6654 { 6655 case IEMMODE_16BIT: 6656 switch (pIemCpu->enmEffAddrMode) 6657 { 6658 case IEMMODE_16BIT: return IEM_MC_DEFER_TO_CIMPL_1(iemCImpl_repne_cmps_op16_addr16, pIemCpu->iEffSeg); 6659 case IEMMODE_32BIT: return IEM_MC_DEFER_TO_CIMPL_1(iemCImpl_repne_cmps_op16_addr32, pIemCpu->iEffSeg); 6660 case IEMMODE_64BIT: return IEM_MC_DEFER_TO_CIMPL_1(iemCImpl_repne_cmps_op16_addr64, pIemCpu->iEffSeg); 6661 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 6662 } 6663 break; 6664 case IEMMODE_32BIT: 6665 switch (pIemCpu->enmEffAddrMode) 6666 { 6667 case IEMMODE_16BIT: return IEM_MC_DEFER_TO_CIMPL_1(iemCImpl_repne_cmps_op32_addr16, pIemCpu->iEffSeg); 6668 case IEMMODE_32BIT: return IEM_MC_DEFER_TO_CIMPL_1(iemCImpl_repne_cmps_op32_addr32, pIemCpu->iEffSeg); 6669 case IEMMODE_64BIT: return IEM_MC_DEFER_TO_CIMPL_1(iemCImpl_repne_cmps_op32_addr64, pIemCpu->iEffSeg); 6670 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 6671 } 6672 case IEMMODE_64BIT: 6673 switch (pIemCpu->enmEffAddrMode) 6674 { 6675 case IEMMODE_16BIT: AssertFailedReturn(VERR_INTERNAL_ERROR_3); 6676 case IEMMODE_32BIT: return IEM_MC_DEFER_TO_CIMPL_1(iemCImpl_repne_cmps_op64_addr32, pIemCpu->iEffSeg); 6677 case IEMMODE_64BIT: return IEM_MC_DEFER_TO_CIMPL_1(iemCImpl_repne_cmps_op64_addr64, pIemCpu->iEffSeg); 6678 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 6679 } 6680 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 6681 } 6682 } 6683 6684 IEMOP_MNEMONIC("cmps Xv,Yv"); 6685 6686 /* 6687 * Annoying double switch here. 6688 * Using ugly macro for implementing the cases, sharing it with cmpsb. 6689 */ 6690 switch (pIemCpu->enmEffOpSize) 6691 { 6692 case IEMMODE_16BIT: 6693 switch (pIemCpu->enmEffAddrMode) 6694 { 6695 case IEMMODE_16BIT: IEM_CMPS_CASE(16, 16); break; 6696 case IEMMODE_32BIT: IEM_CMPS_CASE(16, 32); break; 6697 case IEMMODE_64BIT: IEM_CMPS_CASE(16, 64); break; 6698 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 6699 } 6700 break; 6701 6702 case IEMMODE_32BIT: 6703 switch (pIemCpu->enmEffAddrMode) 6704 { 6705 case IEMMODE_16BIT: IEM_CMPS_CASE(32, 16); break; 6706 case IEMMODE_32BIT: IEM_CMPS_CASE(32, 32); break; 6707 case IEMMODE_64BIT: IEM_CMPS_CASE(32, 64); break; 6708 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 6709 } 6710 break; 6711 6712 case IEMMODE_64BIT: 6713 switch (pIemCpu->enmEffAddrMode) 6714 { 6715 case IEMMODE_16BIT: AssertFailedReturn(VERR_INTERNAL_ERROR_4); /* cannot be encoded */ break; 6716 case IEMMODE_32BIT: IEM_CMPS_CASE(64, 32); break; 6717 case IEMMODE_64BIT: IEM_CMPS_CASE(64, 64); break; 6718 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 6719 } 6720 break; 6721 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 6722 } 6723 return VINF_SUCCESS; 6724 6725 } 6726 6727 #undef IEM_CMPS_CASE 5934 6728 5935 6729 /** Opcode 0xa8. */ … … 5971 6765 5972 6766 /* 5973 * Use the C implementation if a repeat eprefix is encountered.6767 * Use the C implementation if a repeat prefix is encountered. 5974 6768 */ 5975 6769 if (pIemCpu->fPrefixes & (IEM_OP_PRF_REPNZ | IEM_OP_PRF_REPZ)) … … 6006 6800 6007 6801 /* 6008 * Use the C implementation if a repeat eprefix is encountered.6802 * Use the C implementation if a repeat prefix is encountered. 6009 6803 */ 6010 6804 if (pIemCpu->fPrefixes & (IEM_OP_PRF_REPNZ | IEM_OP_PRF_REPZ)) … … 6107 6901 6108 6902 /* 6109 * Use the C implementation if a repeat eprefix is encountered.6903 * Use the C implementation if a repeat prefix is encountered. 6110 6904 */ 6111 6905 if (pIemCpu->fPrefixes & (IEM_OP_PRF_REPNZ | IEM_OP_PRF_REPZ)) … … 6142 6936 6143 6937 /* 6144 * Use the C implementation if a repeat eprefix is encountered.6938 * Use the C implementation if a repeat prefix is encountered. 6145 6939 */ 6146 6940 if (pIemCpu->fPrefixes & (IEM_OP_PRF_REPNZ | IEM_OP_PRF_REPZ)) … … 6221 7015 #undef IEM_LODS_CASE 6222 7016 7017 /** Macro used by iemOp_scasb_AL_Xb and iemOp_scaswd_eAX_Xv */ 7018 #define IEM_SCAS_CASE(ValBits, AddrBits) \ 7019 IEM_MC_BEGIN(1, 2); \ 7020 IEM_MC_ARG(uint##ValBits##_t *, puRax, 0); \ 7021 IEM_MC_ARG(uint##ValBits##_t, uValue, 1); \ 7022 IEM_MC_ARG(uint32_t *, pEFlags, 2); \ 7023 IEM_MC_LOCAL(uint##AddrBits##_t, uAddr); \ 7024 \ 7025 IEM_MC_FETCH_GREG_U##AddrBits(uAddr, X86_GREG_xDI); \ 7026 IEM_MC_FETCH_MEM_U##ValBits(uValue, X86_SREG_ES, uAddr); \ 7027 IEM_MC_REF_GREG_U##ValBits(puRax, X86_GREG_xAX); \ 7028 IEM_MC_REF_EFLAGS(pEFlags); \ 7029 IEM_MC_CALL_VOID_AIMPL_3(iemAImpl_cmp_u##ValBits, puRax, uValue, pEFlags); \ 7030 \ 7031 IEM_MC_IF_EFL_BIT_SET(X86_EFL_DF) { \ 7032 IEM_MC_SUB_GREG_U##AddrBits(X86_GREG_xDI, ValBits / 8); \ 7033 } IEM_MC_ELSE() { \ 7034 IEM_MC_ADD_GREG_U##AddrBits(X86_GREG_xDI, ValBits / 8); \ 7035 } IEM_MC_ENDIF(); \ 7036 IEM_MC_ADVANCE_RIP(); \ 7037 IEM_MC_END(); 7038 6223 7039 /** Opcode 0xae. */ 6224 FNIEMOP_STUB(iemOp_scasb_AL_Xb); 7040 FNIEMOP_DEF(iemOp_scasb_AL_Xb) 7041 { 7042 IEMOP_HLP_NO_LOCK_PREFIX(); 7043 7044 /* 7045 * Use the C implementation if a repeat prefix is encountered. 7046 */ 7047 if (pIemCpu->fPrefixes & IEM_OP_PRF_REPZ) 7048 { 7049 IEMOP_MNEMONIC("repe scasb al,Xb"); 7050 switch (pIemCpu->enmEffAddrMode) 7051 { 7052 case IEMMODE_16BIT: return IEM_MC_DEFER_TO_CIMPL_0(iemCImpl_repe_scas_al_m16); 7053 case IEMMODE_32BIT: return IEM_MC_DEFER_TO_CIMPL_0(iemCImpl_repe_scas_al_m32); 7054 case IEMMODE_64BIT: return IEM_MC_DEFER_TO_CIMPL_0(iemCImpl_repe_scas_al_m64); 7055 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 7056 } 7057 } 7058 if (pIemCpu->fPrefixes & IEM_OP_PRF_REPNZ) 7059 { 7060 IEMOP_MNEMONIC("repne scasb al,Xb"); 7061 switch (pIemCpu->enmEffAddrMode) 7062 { 7063 case IEMMODE_16BIT: return IEM_MC_DEFER_TO_CIMPL_0(iemCImpl_repne_scas_al_m16); 7064 case IEMMODE_32BIT: return IEM_MC_DEFER_TO_CIMPL_0(iemCImpl_repne_scas_al_m32); 7065 case IEMMODE_64BIT: return IEM_MC_DEFER_TO_CIMPL_0(iemCImpl_repne_scas_al_m64); 7066 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 7067 } 7068 } 7069 IEMOP_MNEMONIC("scasb al,Xb"); 7070 7071 /* 7072 * Sharing case implementation with stos[wdq] below. 7073 */ 7074 switch (pIemCpu->enmEffAddrMode) 7075 { 7076 case IEMMODE_16BIT: IEM_SCAS_CASE(8, 16); break; 7077 case IEMMODE_32BIT: IEM_SCAS_CASE(8, 32); break; 7078 case IEMMODE_64BIT: IEM_SCAS_CASE(8, 64); break; 7079 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 7080 } 7081 return VINF_SUCCESS; 7082 } 7083 7084 6225 7085 /** Opcode 0xaf. */ 6226 FNIEMOP_STUB(iemOp_scaswd_eAX_Xv); 7086 FNIEMOP_DEF(iemOp_scaswd_eAX_Xv) 7087 { 7088 IEMOP_HLP_NO_LOCK_PREFIX(); 7089 7090 /* 7091 * Use the C implementation if a repeat prefix is encountered. 7092 */ 7093 if (pIemCpu->fPrefixes & IEM_OP_PRF_REPZ) 7094 { 7095 IEMOP_MNEMONIC("repe scas rAX,Xv"); 7096 switch (pIemCpu->enmEffOpSize) 7097 { 7098 case IEMMODE_16BIT: 7099 switch (pIemCpu->enmEffAddrMode) 7100 { 7101 case IEMMODE_16BIT: return IEM_MC_DEFER_TO_CIMPL_0(iemCImpl_repe_scas_ax_m16); 7102 case IEMMODE_32BIT: return IEM_MC_DEFER_TO_CIMPL_0(iemCImpl_repe_scas_ax_m32); 7103 case IEMMODE_64BIT: return IEM_MC_DEFER_TO_CIMPL_0(iemCImpl_repe_scas_ax_m64); 7104 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 7105 } 7106 break; 7107 case IEMMODE_32BIT: 7108 switch (pIemCpu->enmEffAddrMode) 7109 { 7110 case IEMMODE_16BIT: return IEM_MC_DEFER_TO_CIMPL_0(iemCImpl_repe_scas_eax_m16); 7111 case IEMMODE_32BIT: return IEM_MC_DEFER_TO_CIMPL_0(iemCImpl_repe_scas_eax_m32); 7112 case IEMMODE_64BIT: return IEM_MC_DEFER_TO_CIMPL_0(iemCImpl_repe_scas_eax_m64); 7113 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 7114 } 7115 case IEMMODE_64BIT: 7116 switch (pIemCpu->enmEffAddrMode) 7117 { 7118 case IEMMODE_16BIT: AssertFailedReturn(VERR_INTERNAL_ERROR_3); /** @todo It's this wrong, we can do 16-bit addressing in 64-bit mode, but not 32-bit. right? */ 7119 case IEMMODE_32BIT: return IEM_MC_DEFER_TO_CIMPL_0(iemCImpl_repe_scas_rax_m32); 7120 case IEMMODE_64BIT: return IEM_MC_DEFER_TO_CIMPL_0(iemCImpl_repe_scas_rax_m64); 7121 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 7122 } 7123 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 7124 } 7125 } 7126 if (pIemCpu->fPrefixes & IEM_OP_PRF_REPNZ) 7127 { 7128 IEMOP_MNEMONIC("repne scas rAX,Xv"); 7129 switch (pIemCpu->enmEffOpSize) 7130 { 7131 case IEMMODE_16BIT: 7132 switch (pIemCpu->enmEffAddrMode) 7133 { 7134 case IEMMODE_16BIT: return IEM_MC_DEFER_TO_CIMPL_0(iemCImpl_repe_scas_ax_m16); 7135 case IEMMODE_32BIT: return IEM_MC_DEFER_TO_CIMPL_0(iemCImpl_repe_scas_ax_m32); 7136 case IEMMODE_64BIT: return IEM_MC_DEFER_TO_CIMPL_0(iemCImpl_repe_scas_ax_m64); 7137 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 7138 } 7139 break; 7140 case IEMMODE_32BIT: 7141 switch (pIemCpu->enmEffAddrMode) 7142 { 7143 case IEMMODE_16BIT: return IEM_MC_DEFER_TO_CIMPL_0(iemCImpl_repe_scas_eax_m16); 7144 case IEMMODE_32BIT: return IEM_MC_DEFER_TO_CIMPL_0(iemCImpl_repe_scas_eax_m32); 7145 case IEMMODE_64BIT: return IEM_MC_DEFER_TO_CIMPL_0(iemCImpl_repe_scas_eax_m64); 7146 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 7147 } 7148 case IEMMODE_64BIT: 7149 switch (pIemCpu->enmEffAddrMode) 7150 { 7151 case IEMMODE_16BIT: AssertFailedReturn(VERR_INTERNAL_ERROR_3); 7152 case IEMMODE_32BIT: return IEM_MC_DEFER_TO_CIMPL_0(iemCImpl_repe_scas_rax_m32); 7153 case IEMMODE_64BIT: return IEM_MC_DEFER_TO_CIMPL_0(iemCImpl_repe_scas_rax_m64); 7154 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 7155 } 7156 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 7157 } 7158 } 7159 IEMOP_MNEMONIC("scas rAX,Xv"); 7160 7161 /* 7162 * Annoying double switch here. 7163 * Using ugly macro for implementing the cases, sharing it with scasb. 7164 */ 7165 switch (pIemCpu->enmEffOpSize) 7166 { 7167 case IEMMODE_16BIT: 7168 switch (pIemCpu->enmEffAddrMode) 7169 { 7170 case IEMMODE_16BIT: IEM_SCAS_CASE(16, 16); break; 7171 case IEMMODE_32BIT: IEM_SCAS_CASE(16, 32); break; 7172 case IEMMODE_64BIT: IEM_SCAS_CASE(16, 64); break; 7173 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 7174 } 7175 break; 7176 7177 case IEMMODE_32BIT: 7178 switch (pIemCpu->enmEffAddrMode) 7179 { 7180 case IEMMODE_16BIT: IEM_SCAS_CASE(32, 16); break; 7181 case IEMMODE_32BIT: IEM_SCAS_CASE(32, 32); break; 7182 case IEMMODE_64BIT: IEM_SCAS_CASE(32, 64); break; 7183 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 7184 } 7185 break; 7186 7187 case IEMMODE_64BIT: 7188 switch (pIemCpu->enmEffAddrMode) 7189 { 7190 case IEMMODE_16BIT: AssertFailedReturn(VERR_INTERNAL_ERROR_4); /* cannot be encoded */ break; 7191 case IEMMODE_32BIT: IEM_SCAS_CASE(64, 32); break; 7192 case IEMMODE_64BIT: IEM_SCAS_CASE(64, 64); break; 7193 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 7194 } 7195 break; 7196 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 7197 } 7198 return VINF_SUCCESS; 7199 } 7200 7201 #undef IEM_SCAS_CASE 6227 7202 6228 7203 /** … … 8678 9653 * @param bRm The RM byte. 8679 9654 */ 8680 FNIEMOP_ DEF_1(iemOp_Grp5_jmpf_Ep, uint8_t, bRm)8681 {8682 /* decode and use a C worker. */8683 AssertFailed(); // FNIEMOP_STUB8684 return VERR_NOT_IMPLEMENTED;8685 }9655 FNIEMOP_STUB_1(iemOp_Grp5_jmpf_Ep, uint8_t, bRm); 9656 //{ 9657 // /* decode and use a C worker. */ 9658 // AssertFailed(); // FNIEMOP_STUB 9659 // return VERR_NOT_IMPLEMENTED; 9660 //} 8686 9661 8687 9662
Note:
See TracChangeset
for help on using the changeset viewer.