Changeset 37002 in vbox
- Timestamp:
- May 8, 2011 5:01:56 PM (14 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAll.cpp
r36860 r37002 114 114 115 115 /** 116 * Function table for a binary operator providing implementation based on117 * operand size.118 */119 typedef struct IEMOPBINSIZES120 {121 PFNIEMAIMPLBINU8 pfnNormalU8, pfnLockedU8;122 PFNIEMAIMPLBINU16 pfnNormalU16, pfnLockedU16;123 PFNIEMAIMPLBINU32 pfnNormalU32, pfnLockedU32;124 PFNIEMAIMPLBINU64 pfnNormalU64, pfnLockedU64;125 } IEMOPBINSIZES;126 /** Pointer to a binary operator function table. */127 typedef IEMOPBINSIZES const *PCIEMOPBINSIZES;128 129 130 /**131 * Function table for a unary operator providing implementation based on132 * operand size.133 */134 typedef struct IEMOPUNARYSIZES135 {136 PFNIEMAIMPLUNARYU8 pfnNormalU8, pfnLockedU8;137 PFNIEMAIMPLUNARYU16 pfnNormalU16, pfnLockedU16;138 PFNIEMAIMPLUNARYU32 pfnNormalU32, pfnLockedU32;139 PFNIEMAIMPLUNARYU64 pfnNormalU64, pfnLockedU64;140 } IEMOPUNARYSIZES;141 /** Pointer to a unary operator function table. */142 typedef IEMOPUNARYSIZES const *PCIEMOPUNARYSIZES;143 144 145 /**146 * Function table for a shift operator providing implementation based on147 * operand size.148 */149 typedef struct IEMOPSHIFTSIZES150 {151 PFNIEMAIMPLSHIFTU8 pfnNormalU8;152 PFNIEMAIMPLSHIFTU16 pfnNormalU16;153 PFNIEMAIMPLSHIFTU32 pfnNormalU32;154 PFNIEMAIMPLSHIFTU64 pfnNormalU64;155 } IEMOPSHIFTSIZES;156 /** Pointer to a shift operator function table. */157 typedef IEMOPSHIFTSIZES const *PCIEMOPSHIFTSIZES;158 159 160 /**161 * Function table for a multiplication or division operation.162 */163 typedef struct IEMOPMULDIVSIZES164 {165 PFNIEMAIMPLMULDIVU8 pfnU8;166 PFNIEMAIMPLMULDIVU16 pfnU16;167 PFNIEMAIMPLMULDIVU32 pfnU32;168 PFNIEMAIMPLMULDIVU64 pfnU64;169 } IEMOPMULDIVSIZES;170 /** Pointer to a multiplication or division operation function table. */171 typedef IEMOPMULDIVSIZES const *PCIEMOPMULDIVSIZES;172 173 174 /**175 * Function table for a double precision shift operator providing implementation176 * based on operand size.177 */178 typedef struct IEMOPSHIFTDBLSIZES179 {180 PFNIEMAIMPLSHIFTDBLU16 pfnNormalU16;181 PFNIEMAIMPLSHIFTDBLU32 pfnNormalU32;182 PFNIEMAIMPLSHIFTDBLU64 pfnNormalU64;183 } IEMOPSHIFTDBLSIZES;184 /** Pointer to a double precision shift function table. */185 typedef IEMOPSHIFTDBLSIZES const *PCIEMOPSHIFTDBLSIZES;186 187 188 /**189 116 * Selector descriptor table entry as fetched by iemMemFetchSelDesc. 190 117 */ … … 1086 1013 1087 1014 /** 1015 * Fetches the next signed word from the opcode stream. 1016 * 1017 * @returns Strict VBox status code. 1018 * @param pIemCpu The IEM state. 1019 * @param pi16 Where to return the signed word. 1020 */ 1021 DECLINLINE(VBOXSTRICTRC) iemOpcodeGetNextS16(PIEMCPU pIemCpu, int16_t *pi16) 1022 { 1023 return iemOpcodeGetNextU16(pIemCpu, (uint16_t *)pi16); 1024 } 1025 1026 /** 1027 * Fetches the next signed word from the opcode stream, returning automatically 1028 * on failure. 1029 * 1030 * @param pi16 Where to return the signed word. 1031 * @remark Implicitly references pIemCpu. 1032 */ 1033 #define IEM_OPCODE_GET_NEXT_S16(a_pi16) \ 1034 do \ 1035 { \ 1036 VBOXSTRICTRC rcStrict2 = iemOpcodeGetNextS16(pIemCpu, (a_pi16)); \ 1037 if (rcStrict2 != VINF_SUCCESS) \ 1038 return rcStrict2; \ 1039 } while (0) 1040 1041 1042 /** 1088 1043 * Fetches the next opcode dword. 1089 1044 * … … 1116 1071 { \ 1117 1072 VBOXSTRICTRC rcStrict2 = iemOpcodeGetNextU32((a_pIemCpu), (a_pu32)); \ 1073 if (rcStrict2 != VINF_SUCCESS) \ 1074 return rcStrict2; \ 1075 } while (0) 1076 1077 1078 /** 1079 * Fetches the next signed double word from the opcode stream. 1080 * 1081 * @returns Strict VBox status code. 1082 * @param pIemCpu The IEM state. 1083 * @param pi32 Where to return the signed double word. 1084 */ 1085 DECLINLINE(VBOXSTRICTRC) iemOpcodeGetNextS32(PIEMCPU pIemCpu, int32_t *pi32) 1086 { 1087 return iemOpcodeGetNextU32(pIemCpu, (uint32_t *)pi32); 1088 } 1089 1090 /** 1091 * Fetches the next signed double word from the opcode stream, returning 1092 * automatically on failure. 1093 * 1094 * @param pi32 Where to return the signed double word. 1095 * @remark Implicitly references pIemCpu. 1096 */ 1097 #define IEM_OPCODE_GET_NEXT_S32(a_pi32) \ 1098 do \ 1099 { \ 1100 VBOXSTRICTRC rcStrict2 = iemOpcodeGetNextS32(pIemCpu, (a_pi32)); \ 1118 1101 if (rcStrict2 != VINF_SUCCESS) \ 1119 1102 return rcStrict2; \ -
trunk/src/VBox/VMM/VMMAll/IEMAllInstructions.cpp.h
r36860 r37002 15 15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. 16 16 */ 17 18 19 /******************************************************************************* 20 * Global Variables * 21 *******************************************************************************/ 22 extern const PFNIEMOP g_apfnOneByteMap[256]; /* not static since we need to forward declare it. */ 17 23 18 24 … … 1444 1450 if (pIemCpu->enmEffOpSize == IEMMODE_16BIT) 1445 1451 { 1446 uint16_t u16Imm; IEM_OPCODE_GET_NEXT_U16(pIemCpu, &u16Imm);1452 int16_t i16Imm; IEM_OPCODE_GET_NEXT_S16(&i16Imm); 1447 1453 IEMOP_HLP_NO_LOCK_PREFIX(); 1448 1454 1449 1455 IEM_MC_BEGIN(0, 0); 1450 1456 IEM_MC_IF_EFL_BIT_SET(X86_EFL_OF) { 1451 IEM_MC_REL_JMP_S16( (int16_t)u16Imm);1457 IEM_MC_REL_JMP_S16(i16Imm); 1452 1458 } IEM_MC_ELSE() { 1453 1459 IEM_MC_ADVANCE_RIP(); … … 1457 1463 else 1458 1464 { 1459 uint32_t u32Imm; IEM_OPCODE_GET_NEXT_U32(pIemCpu, &u32Imm);1465 int32_t i32Imm; IEM_OPCODE_GET_NEXT_S32(&i32Imm); 1460 1466 IEMOP_HLP_NO_LOCK_PREFIX(); 1461 1467 1462 1468 IEM_MC_BEGIN(0, 0); 1463 1469 IEM_MC_IF_EFL_BIT_SET(X86_EFL_OF) { 1464 IEM_MC_REL_JMP_S32( (int32_t)u32Imm);1470 IEM_MC_REL_JMP_S32(i32Imm); 1465 1471 } IEM_MC_ELSE() { 1466 1472 IEM_MC_ADVANCE_RIP(); … … 1479 1485 if (pIemCpu->enmEffOpSize == IEMMODE_16BIT) 1480 1486 { 1481 uint16_t u16Imm; IEM_OPCODE_GET_NEXT_U16(pIemCpu, &u16Imm);1487 int16_t i16Imm; IEM_OPCODE_GET_NEXT_S16(&i16Imm); 1482 1488 IEMOP_HLP_NO_LOCK_PREFIX(); 1483 1489 … … 1486 1492 IEM_MC_ADVANCE_RIP(); 1487 1493 } IEM_MC_ELSE() { 1488 IEM_MC_REL_JMP_S16( (int16_t)u16Imm);1494 IEM_MC_REL_JMP_S16(i16Imm); 1489 1495 } IEM_MC_ENDIF(); 1490 1496 IEM_MC_END(); … … 1492 1498 else 1493 1499 { 1494 uint32_t u32Imm; IEM_OPCODE_GET_NEXT_U32(pIemCpu, &u32Imm);1500 int32_t i32Imm; IEM_OPCODE_GET_NEXT_S32(&i32Imm); 1495 1501 IEMOP_HLP_NO_LOCK_PREFIX(); 1496 1502 … … 1499 1505 IEM_MC_ADVANCE_RIP(); 1500 1506 } IEM_MC_ELSE() { 1501 IEM_MC_REL_JMP_S32( (int32_t)u32Imm);1507 IEM_MC_REL_JMP_S32(i32Imm); 1502 1508 } IEM_MC_ENDIF(); 1503 1509 IEM_MC_END(); … … 1514 1520 if (pIemCpu->enmEffOpSize == IEMMODE_16BIT) 1515 1521 { 1516 uint16_t u16Imm; IEM_OPCODE_GET_NEXT_U16(pIemCpu, &u16Imm);1522 int16_t i16Imm; IEM_OPCODE_GET_NEXT_S16(&i16Imm); 1517 1523 IEMOP_HLP_NO_LOCK_PREFIX(); 1518 1524 1519 1525 IEM_MC_BEGIN(0, 0); 1520 1526 IEM_MC_IF_EFL_BIT_SET(X86_EFL_CF) { 1521 IEM_MC_REL_JMP_S16( (int16_t)u16Imm);1527 IEM_MC_REL_JMP_S16(i16Imm); 1522 1528 } IEM_MC_ELSE() { 1523 1529 IEM_MC_ADVANCE_RIP(); … … 1527 1533 else 1528 1534 { 1529 uint32_t u32Imm; IEM_OPCODE_GET_NEXT_U32(pIemCpu, &u32Imm);1535 int32_t i32Imm; IEM_OPCODE_GET_NEXT_S32(&i32Imm); 1530 1536 IEMOP_HLP_NO_LOCK_PREFIX(); 1531 1537 1532 1538 IEM_MC_BEGIN(0, 0); 1533 1539 IEM_MC_IF_EFL_BIT_SET(X86_EFL_CF) { 1534 IEM_MC_REL_JMP_S32( (int32_t)u32Imm);1540 IEM_MC_REL_JMP_S32(i32Imm); 1535 1541 } IEM_MC_ELSE() { 1536 1542 IEM_MC_ADVANCE_RIP(); … … 1549 1555 if (pIemCpu->enmEffOpSize == IEMMODE_16BIT) 1550 1556 { 1551 uint16_t u16Imm; IEM_OPCODE_GET_NEXT_U16(pIemCpu, &u16Imm);1557 int16_t i16Imm; IEM_OPCODE_GET_NEXT_S16(&i16Imm); 1552 1558 IEMOP_HLP_NO_LOCK_PREFIX(); 1553 1559 … … 1556 1562 IEM_MC_ADVANCE_RIP(); 1557 1563 } IEM_MC_ELSE() { 1558 IEM_MC_REL_JMP_S16( (int16_t)u16Imm);1564 IEM_MC_REL_JMP_S16(i16Imm); 1559 1565 } IEM_MC_ENDIF(); 1560 1566 IEM_MC_END(); … … 1562 1568 else 1563 1569 { 1564 uint32_t u32Imm; IEM_OPCODE_GET_NEXT_U32(pIemCpu, &u32Imm);1570 int32_t i32Imm; IEM_OPCODE_GET_NEXT_S32(&i32Imm); 1565 1571 IEMOP_HLP_NO_LOCK_PREFIX(); 1566 1572 … … 1569 1575 IEM_MC_ADVANCE_RIP(); 1570 1576 } IEM_MC_ELSE() { 1571 IEM_MC_REL_JMP_S32( (int32_t)u32Imm);1577 IEM_MC_REL_JMP_S32(i32Imm); 1572 1578 } IEM_MC_ENDIF(); 1573 1579 IEM_MC_END(); … … 1584 1590 if (pIemCpu->enmEffOpSize == IEMMODE_16BIT) 1585 1591 { 1586 uint16_t u16Imm; IEM_OPCODE_GET_NEXT_U16(pIemCpu, &u16Imm);1592 int16_t i16Imm; IEM_OPCODE_GET_NEXT_S16(&i16Imm); 1587 1593 IEMOP_HLP_NO_LOCK_PREFIX(); 1588 1594 1589 1595 IEM_MC_BEGIN(0, 0); 1590 1596 IEM_MC_IF_EFL_BIT_SET(X86_EFL_ZF) { 1591 IEM_MC_REL_JMP_S16( (int16_t)u16Imm);1597 IEM_MC_REL_JMP_S16(i16Imm); 1592 1598 } IEM_MC_ELSE() { 1593 1599 IEM_MC_ADVANCE_RIP(); … … 1597 1603 else 1598 1604 { 1599 uint32_t u32Imm; IEM_OPCODE_GET_NEXT_U32(pIemCpu, &u32Imm);1605 int32_t i32Imm; IEM_OPCODE_GET_NEXT_S32(&i32Imm); 1600 1606 IEMOP_HLP_NO_LOCK_PREFIX(); 1601 1607 1602 1608 IEM_MC_BEGIN(0, 0); 1603 1609 IEM_MC_IF_EFL_BIT_SET(X86_EFL_ZF) { 1604 IEM_MC_REL_JMP_S32( (int32_t)u32Imm);1610 IEM_MC_REL_JMP_S32(i32Imm); 1605 1611 } IEM_MC_ELSE() { 1606 1612 IEM_MC_ADVANCE_RIP(); … … 1619 1625 if (pIemCpu->enmEffOpSize == IEMMODE_16BIT) 1620 1626 { 1621 uint16_t u16Imm; IEM_OPCODE_GET_NEXT_U16(pIemCpu, &u16Imm);1627 int16_t i16Imm; IEM_OPCODE_GET_NEXT_S16(&i16Imm); 1622 1628 IEMOP_HLP_NO_LOCK_PREFIX(); 1623 1629 … … 1626 1632 IEM_MC_ADVANCE_RIP(); 1627 1633 } IEM_MC_ELSE() { 1628 IEM_MC_REL_JMP_S16( (int16_t)u16Imm);1634 IEM_MC_REL_JMP_S16(i16Imm); 1629 1635 } IEM_MC_ENDIF(); 1630 1636 IEM_MC_END(); … … 1632 1638 else 1633 1639 { 1634 uint32_t u32Imm; IEM_OPCODE_GET_NEXT_U32(pIemCpu, &u32Imm);1640 int32_t i32Imm; IEM_OPCODE_GET_NEXT_S32(&i32Imm); 1635 1641 IEMOP_HLP_NO_LOCK_PREFIX(); 1636 1642 … … 1639 1645 IEM_MC_ADVANCE_RIP(); 1640 1646 } IEM_MC_ELSE() { 1641 IEM_MC_REL_JMP_S32( (int32_t)u32Imm);1647 IEM_MC_REL_JMP_S32(i32Imm); 1642 1648 } IEM_MC_ENDIF(); 1643 1649 IEM_MC_END(); … … 1654 1660 if (pIemCpu->enmEffOpSize == IEMMODE_16BIT) 1655 1661 { 1656 uint16_t u16Imm; IEM_OPCODE_GET_NEXT_U16(pIemCpu, &u16Imm);1662 int16_t i16Imm; IEM_OPCODE_GET_NEXT_S16(&i16Imm); 1657 1663 IEMOP_HLP_NO_LOCK_PREFIX(); 1658 1664 1659 1665 IEM_MC_BEGIN(0, 0); 1660 1666 IEM_MC_IF_EFL_ANY_BITS_SET(X86_EFL_CF | X86_EFL_ZF) { 1661 IEM_MC_REL_JMP_S16( (int16_t)u16Imm);1667 IEM_MC_REL_JMP_S16(i16Imm); 1662 1668 } IEM_MC_ELSE() { 1663 1669 IEM_MC_ADVANCE_RIP(); … … 1667 1673 else 1668 1674 { 1669 uint32_t u32Imm; IEM_OPCODE_GET_NEXT_U32(pIemCpu, &u32Imm);1675 int32_t i32Imm; IEM_OPCODE_GET_NEXT_S32(&i32Imm); 1670 1676 IEMOP_HLP_NO_LOCK_PREFIX(); 1671 1677 1672 1678 IEM_MC_BEGIN(0, 0); 1673 1679 IEM_MC_IF_EFL_ANY_BITS_SET(X86_EFL_CF | X86_EFL_ZF) { 1674 IEM_MC_REL_JMP_S32( (int32_t)u32Imm);1680 IEM_MC_REL_JMP_S32(i32Imm); 1675 1681 } IEM_MC_ELSE() { 1676 1682 IEM_MC_ADVANCE_RIP(); … … 1689 1695 if (pIemCpu->enmEffOpSize == IEMMODE_16BIT) 1690 1696 { 1691 uint16_t u16Imm; IEM_OPCODE_GET_NEXT_U16(pIemCpu, &u16Imm);1697 int16_t i16Imm; IEM_OPCODE_GET_NEXT_S16(&i16Imm); 1692 1698 IEMOP_HLP_NO_LOCK_PREFIX(); 1693 1699 … … 1696 1702 IEM_MC_ADVANCE_RIP(); 1697 1703 } IEM_MC_ELSE() { 1698 IEM_MC_REL_JMP_S16( (int16_t)u16Imm);1704 IEM_MC_REL_JMP_S16(i16Imm); 1699 1705 } IEM_MC_ENDIF(); 1700 1706 IEM_MC_END(); … … 1702 1708 else 1703 1709 { 1704 uint32_t u32Imm; IEM_OPCODE_GET_NEXT_U32(pIemCpu, &u32Imm);1710 int32_t i32Imm; IEM_OPCODE_GET_NEXT_S32(&i32Imm); 1705 1711 IEMOP_HLP_NO_LOCK_PREFIX(); 1706 1712 … … 1709 1715 IEM_MC_ADVANCE_RIP(); 1710 1716 } IEM_MC_ELSE() { 1711 IEM_MC_REL_JMP_S32( (int32_t)u32Imm);1717 IEM_MC_REL_JMP_S32(i32Imm); 1712 1718 } IEM_MC_ENDIF(); 1713 1719 IEM_MC_END(); … … 1724 1730 if (pIemCpu->enmEffOpSize == IEMMODE_16BIT) 1725 1731 { 1726 uint16_t u16Imm; IEM_OPCODE_GET_NEXT_U16(pIemCpu, &u16Imm);1732 int16_t i16Imm; IEM_OPCODE_GET_NEXT_S16(&i16Imm); 1727 1733 IEMOP_HLP_NO_LOCK_PREFIX(); 1728 1734 1729 1735 IEM_MC_BEGIN(0, 0); 1730 1736 IEM_MC_IF_EFL_BIT_SET(X86_EFL_SF) { 1731 IEM_MC_REL_JMP_S16( (int16_t)u16Imm);1737 IEM_MC_REL_JMP_S16(i16Imm); 1732 1738 } IEM_MC_ELSE() { 1733 1739 IEM_MC_ADVANCE_RIP(); … … 1737 1743 else 1738 1744 { 1739 uint32_t u32Imm; IEM_OPCODE_GET_NEXT_U32(pIemCpu, &u32Imm);1745 int32_t i32Imm; IEM_OPCODE_GET_NEXT_S32(&i32Imm); 1740 1746 IEMOP_HLP_NO_LOCK_PREFIX(); 1741 1747 1742 1748 IEM_MC_BEGIN(0, 0); 1743 1749 IEM_MC_IF_EFL_BIT_SET(X86_EFL_SF) { 1744 IEM_MC_REL_JMP_S32( (int32_t)u32Imm);1750 IEM_MC_REL_JMP_S32(i32Imm); 1745 1751 } IEM_MC_ELSE() { 1746 1752 IEM_MC_ADVANCE_RIP(); … … 1759 1765 if (pIemCpu->enmEffOpSize == IEMMODE_16BIT) 1760 1766 { 1761 uint16_t u16Imm; IEM_OPCODE_GET_NEXT_U16(pIemCpu, &u16Imm);1767 int16_t i16Imm; IEM_OPCODE_GET_NEXT_S16(&i16Imm); 1762 1768 IEMOP_HLP_NO_LOCK_PREFIX(); 1763 1769 … … 1766 1772 IEM_MC_ADVANCE_RIP(); 1767 1773 } IEM_MC_ELSE() { 1768 IEM_MC_REL_JMP_S16( (int16_t)u16Imm);1774 IEM_MC_REL_JMP_S16(i16Imm); 1769 1775 } IEM_MC_ENDIF(); 1770 1776 IEM_MC_END(); … … 1772 1778 else 1773 1779 { 1774 uint32_t u32Imm; IEM_OPCODE_GET_NEXT_U32(pIemCpu, &u32Imm);1780 int32_t i32Imm; IEM_OPCODE_GET_NEXT_S32(&i32Imm); 1775 1781 IEMOP_HLP_NO_LOCK_PREFIX(); 1776 1782 … … 1779 1785 IEM_MC_ADVANCE_RIP(); 1780 1786 } IEM_MC_ELSE() { 1781 IEM_MC_REL_JMP_S32( (int32_t)u32Imm);1787 IEM_MC_REL_JMP_S32(i32Imm); 1782 1788 } IEM_MC_ENDIF(); 1783 1789 IEM_MC_END(); … … 1794 1800 if (pIemCpu->enmEffOpSize == IEMMODE_16BIT) 1795 1801 { 1796 uint16_t u16Imm; IEM_OPCODE_GET_NEXT_U16(pIemCpu, &u16Imm);1802 int16_t i16Imm; IEM_OPCODE_GET_NEXT_S16(&i16Imm); 1797 1803 IEMOP_HLP_NO_LOCK_PREFIX(); 1798 1804 1799 1805 IEM_MC_BEGIN(0, 0); 1800 1806 IEM_MC_IF_EFL_BIT_SET(X86_EFL_PF) { 1801 IEM_MC_REL_JMP_S16( (int16_t)u16Imm);1807 IEM_MC_REL_JMP_S16(i16Imm); 1802 1808 } IEM_MC_ELSE() { 1803 1809 IEM_MC_ADVANCE_RIP(); … … 1807 1813 else 1808 1814 { 1809 uint32_t u32Imm; IEM_OPCODE_GET_NEXT_U32(pIemCpu, &u32Imm);1815 int32_t i32Imm; IEM_OPCODE_GET_NEXT_S32(&i32Imm); 1810 1816 IEMOP_HLP_NO_LOCK_PREFIX(); 1811 1817 1812 1818 IEM_MC_BEGIN(0, 0); 1813 1819 IEM_MC_IF_EFL_BIT_SET(X86_EFL_PF) { 1814 IEM_MC_REL_JMP_S32( (int32_t)u32Imm);1820 IEM_MC_REL_JMP_S32(i32Imm); 1815 1821 } IEM_MC_ELSE() { 1816 1822 IEM_MC_ADVANCE_RIP(); … … 1829 1835 if (pIemCpu->enmEffOpSize == IEMMODE_16BIT) 1830 1836 { 1831 uint16_t u16Imm; IEM_OPCODE_GET_NEXT_U16(pIemCpu, &u16Imm);1837 int16_t i16Imm; IEM_OPCODE_GET_NEXT_S16(&i16Imm); 1832 1838 IEMOP_HLP_NO_LOCK_PREFIX(); 1833 1839 … … 1836 1842 IEM_MC_ADVANCE_RIP(); 1837 1843 } IEM_MC_ELSE() { 1838 IEM_MC_REL_JMP_S16( (int16_t)u16Imm);1844 IEM_MC_REL_JMP_S16(i16Imm); 1839 1845 } IEM_MC_ENDIF(); 1840 1846 IEM_MC_END(); … … 1842 1848 else 1843 1849 { 1844 uint32_t u32Imm; IEM_OPCODE_GET_NEXT_U32(pIemCpu, &u32Imm);1850 int32_t i32Imm; IEM_OPCODE_GET_NEXT_S32(&i32Imm); 1845 1851 IEMOP_HLP_NO_LOCK_PREFIX(); 1846 1852 … … 1849 1855 IEM_MC_ADVANCE_RIP(); 1850 1856 } IEM_MC_ELSE() { 1851 IEM_MC_REL_JMP_S32( (int32_t)u32Imm);1857 IEM_MC_REL_JMP_S32(i32Imm); 1852 1858 } IEM_MC_ENDIF(); 1853 1859 IEM_MC_END(); … … 1864 1870 if (pIemCpu->enmEffOpSize == IEMMODE_16BIT) 1865 1871 { 1866 uint16_t u16Imm; IEM_OPCODE_GET_NEXT_U16(pIemCpu, &u16Imm);1872 int16_t i16Imm; IEM_OPCODE_GET_NEXT_S16(&i16Imm); 1867 1873 IEMOP_HLP_NO_LOCK_PREFIX(); 1868 1874 1869 1875 IEM_MC_BEGIN(0, 0); 1870 1876 IEM_MC_IF_EFL_BITS_NE(X86_EFL_SF, X86_EFL_OF) { 1871 IEM_MC_REL_JMP_S16( (int16_t)u16Imm);1877 IEM_MC_REL_JMP_S16(i16Imm); 1872 1878 } IEM_MC_ELSE() { 1873 1879 IEM_MC_ADVANCE_RIP(); … … 1877 1883 else 1878 1884 { 1879 uint32_t u32Imm; IEM_OPCODE_GET_NEXT_U32(pIemCpu, &u32Imm);1885 int32_t i32Imm; IEM_OPCODE_GET_NEXT_S32(&i32Imm); 1880 1886 IEMOP_HLP_NO_LOCK_PREFIX(); 1881 1887 1882 1888 IEM_MC_BEGIN(0, 0); 1883 1889 IEM_MC_IF_EFL_BITS_NE(X86_EFL_SF, X86_EFL_OF) { 1884 IEM_MC_REL_JMP_S32( (int32_t)u32Imm);1890 IEM_MC_REL_JMP_S32(i32Imm); 1885 1891 } IEM_MC_ELSE() { 1886 1892 IEM_MC_ADVANCE_RIP(); … … 1899 1905 if (pIemCpu->enmEffOpSize == IEMMODE_16BIT) 1900 1906 { 1901 uint16_t u16Imm; IEM_OPCODE_GET_NEXT_U16(pIemCpu, &u16Imm);1907 int16_t i16Imm; IEM_OPCODE_GET_NEXT_S16(&i16Imm); 1902 1908 IEMOP_HLP_NO_LOCK_PREFIX(); 1903 1909 … … 1906 1912 IEM_MC_ADVANCE_RIP(); 1907 1913 } IEM_MC_ELSE() { 1908 IEM_MC_REL_JMP_S16( (int16_t)u16Imm);1914 IEM_MC_REL_JMP_S16(i16Imm); 1909 1915 } IEM_MC_ENDIF(); 1910 1916 IEM_MC_END(); … … 1912 1918 else 1913 1919 { 1914 uint32_t u32Imm; IEM_OPCODE_GET_NEXT_U32(pIemCpu, &u32Imm);1920 int32_t i32Imm; IEM_OPCODE_GET_NEXT_S32(&i32Imm); 1915 1921 IEMOP_HLP_NO_LOCK_PREFIX(); 1916 1922 … … 1919 1925 IEM_MC_ADVANCE_RIP(); 1920 1926 } IEM_MC_ELSE() { 1921 IEM_MC_REL_JMP_S32( (int32_t)u32Imm);1927 IEM_MC_REL_JMP_S32(i32Imm); 1922 1928 } IEM_MC_ENDIF(); 1923 1929 IEM_MC_END(); … … 1934 1940 if (pIemCpu->enmEffOpSize == IEMMODE_16BIT) 1935 1941 { 1936 uint16_t u16Imm; IEM_OPCODE_GET_NEXT_U16(pIemCpu, &u16Imm);1942 int16_t i16Imm; IEM_OPCODE_GET_NEXT_S16(&i16Imm); 1937 1943 IEMOP_HLP_NO_LOCK_PREFIX(); 1938 1944 1939 1945 IEM_MC_BEGIN(0, 0); 1940 1946 IEM_MC_IF_EFL_BIT_SET_OR_BITS_NE(X86_EFL_ZF, X86_EFL_SF, X86_EFL_OF) { 1941 IEM_MC_REL_JMP_S16( (int16_t)u16Imm);1947 IEM_MC_REL_JMP_S16(i16Imm); 1942 1948 } IEM_MC_ELSE() { 1943 1949 IEM_MC_ADVANCE_RIP(); … … 1947 1953 else 1948 1954 { 1949 uint32_t u32Imm; IEM_OPCODE_GET_NEXT_U32(pIemCpu, &u32Imm);1955 int32_t i32Imm; IEM_OPCODE_GET_NEXT_S32(&i32Imm); 1950 1956 IEMOP_HLP_NO_LOCK_PREFIX(); 1951 1957 1952 1958 IEM_MC_BEGIN(0, 0); 1953 1959 IEM_MC_IF_EFL_BIT_SET_OR_BITS_NE(X86_EFL_ZF, X86_EFL_SF, X86_EFL_OF) { 1954 IEM_MC_REL_JMP_S32( (int32_t)u32Imm);1960 IEM_MC_REL_JMP_S32(i32Imm); 1955 1961 } IEM_MC_ELSE() { 1956 1962 IEM_MC_ADVANCE_RIP(); … … 1969 1975 if (pIemCpu->enmEffOpSize == IEMMODE_16BIT) 1970 1976 { 1971 uint16_t u16Imm; IEM_OPCODE_GET_NEXT_U16(pIemCpu, &u16Imm);1977 int16_t i16Imm; IEM_OPCODE_GET_NEXT_S16(&i16Imm); 1972 1978 IEMOP_HLP_NO_LOCK_PREFIX(); 1973 1979 … … 1976 1982 IEM_MC_ADVANCE_RIP(); 1977 1983 } IEM_MC_ELSE() { 1978 IEM_MC_REL_JMP_S16( (int16_t)u16Imm);1984 IEM_MC_REL_JMP_S16(i16Imm); 1979 1985 } IEM_MC_ENDIF(); 1980 1986 IEM_MC_END(); … … 1982 1988 else 1983 1989 { 1984 uint32_t u32Imm; IEM_OPCODE_GET_NEXT_U32(pIemCpu, &u32Imm);1990 int32_t i32Imm; IEM_OPCODE_GET_NEXT_S32(&i32Imm); 1985 1991 IEMOP_HLP_NO_LOCK_PREFIX(); 1986 1992 … … 1989 1995 IEM_MC_ADVANCE_RIP(); 1990 1996 } IEM_MC_ELSE() { 1991 IEM_MC_REL_JMP_S32( (int32_t)u32Imm);1997 IEM_MC_REL_JMP_S32(i32Imm); 1992 1998 } IEM_MC_ENDIF(); 1993 1999 IEM_MC_END(); … … 7278 7284 IEMOP_HLP_DEFAULT_64BIT_OP_SIZE(); /* The common code does this differently. */ 7279 7285 7286 #ifndef TST_IEM_CHECK_MC 7280 7287 /* Calc effective address with modified ESP. */ 7281 7288 uint8_t const offOpcodeSaved = pIemCpu->offOpcode; … … 7340 7347 } 7341 7348 return rcStrict; 7349 7350 #else 7351 return VERR_NOT_IMPLEMENTED; 7352 #endif 7342 7353 } 7343 7354 … … 10093 10104 case IEMMODE_16BIT: 10094 10105 { 10095 uint16_t u16Imm; IEM_OPCODE_GET_NEXT_U16(pIemCpu, &u16Imm);10106 int16_t i16Imm; IEM_OPCODE_GET_NEXT_S16(&i16Imm); 10096 10107 IEM_MC_BEGIN(0, 0); 10097 IEM_MC_REL_JMP_S16( (int16_t)u16Imm);10108 IEM_MC_REL_JMP_S16(i16Imm); 10098 10109 IEM_MC_END(); 10099 10110 return VINF_SUCCESS; … … 10103 10114 case IEMMODE_32BIT: 10104 10115 { 10105 uint32_t u32Imm; IEM_OPCODE_GET_NEXT_U32(pIemCpu, &u32Imm);10116 int32_t i32Imm; IEM_OPCODE_GET_NEXT_S32(&i32Imm); 10106 10117 IEM_MC_BEGIN(0, 0); 10107 IEM_MC_REL_JMP_S32( (int32_t)u32Imm);10118 IEM_MC_REL_JMP_S32(i32Imm); 10108 10119 IEM_MC_END(); 10109 10120 return VINF_SUCCESS; … … 10140 10151 { 10141 10152 IEMOP_MNEMONIC("jmp Jb"); 10142 uint8_t u8Imm; IEM_OPCODE_GET_NEXT_BYTE(pIemCpu, &u8Imm);10153 int8_t i8Imm; IEM_OPCODE_GET_NEXT_S8(pIemCpu, &i8Imm); 10143 10154 IEMOP_HLP_NO_LOCK_PREFIX(); 10144 10155 IEMOP_HLP_DEFAULT_64BIT_OP_SIZE(); 10145 10156 10146 10157 IEM_MC_BEGIN(0, 0); 10147 IEM_MC_REL_JMP_S8( (int8_t)u8Imm);10158 IEM_MC_REL_JMP_S8(i8Imm); 10148 10159 IEM_MC_END(); 10149 10160 return VINF_SUCCESS; -
trunk/src/VBox/VMM/include/IEMInternal.h
r36857 r37002 643 643 644 644 645 /** @name Function tables. 646 * @{ 647 */ 648 649 /** 650 * Function table for a binary operator providing implementation based on 651 * operand size. 652 */ 653 typedef struct IEMOPBINSIZES 654 { 655 PFNIEMAIMPLBINU8 pfnNormalU8, pfnLockedU8; 656 PFNIEMAIMPLBINU16 pfnNormalU16, pfnLockedU16; 657 PFNIEMAIMPLBINU32 pfnNormalU32, pfnLockedU32; 658 PFNIEMAIMPLBINU64 pfnNormalU64, pfnLockedU64; 659 } IEMOPBINSIZES; 660 /** Pointer to a binary operator function table. */ 661 typedef IEMOPBINSIZES const *PCIEMOPBINSIZES; 662 663 664 /** 665 * Function table for a unary operator providing implementation based on 666 * operand size. 667 */ 668 typedef struct IEMOPUNARYSIZES 669 { 670 PFNIEMAIMPLUNARYU8 pfnNormalU8, pfnLockedU8; 671 PFNIEMAIMPLUNARYU16 pfnNormalU16, pfnLockedU16; 672 PFNIEMAIMPLUNARYU32 pfnNormalU32, pfnLockedU32; 673 PFNIEMAIMPLUNARYU64 pfnNormalU64, pfnLockedU64; 674 } IEMOPUNARYSIZES; 675 /** Pointer to a unary operator function table. */ 676 typedef IEMOPUNARYSIZES const *PCIEMOPUNARYSIZES; 677 678 679 /** 680 * Function table for a shift operator providing implementation based on 681 * operand size. 682 */ 683 typedef struct IEMOPSHIFTSIZES 684 { 685 PFNIEMAIMPLSHIFTU8 pfnNormalU8; 686 PFNIEMAIMPLSHIFTU16 pfnNormalU16; 687 PFNIEMAIMPLSHIFTU32 pfnNormalU32; 688 PFNIEMAIMPLSHIFTU64 pfnNormalU64; 689 } IEMOPSHIFTSIZES; 690 /** Pointer to a shift operator function table. */ 691 typedef IEMOPSHIFTSIZES const *PCIEMOPSHIFTSIZES; 692 693 694 /** 695 * Function table for a multiplication or division operation. 696 */ 697 typedef struct IEMOPMULDIVSIZES 698 { 699 PFNIEMAIMPLMULDIVU8 pfnU8; 700 PFNIEMAIMPLMULDIVU16 pfnU16; 701 PFNIEMAIMPLMULDIVU32 pfnU32; 702 PFNIEMAIMPLMULDIVU64 pfnU64; 703 } IEMOPMULDIVSIZES; 704 /** Pointer to a multiplication or division operation function table. */ 705 typedef IEMOPMULDIVSIZES const *PCIEMOPMULDIVSIZES; 706 707 708 /** 709 * Function table for a double precision shift operator providing implementation 710 * based on operand size. 711 */ 712 typedef struct IEMOPSHIFTDBLSIZES 713 { 714 PFNIEMAIMPLSHIFTDBLU16 pfnNormalU16; 715 PFNIEMAIMPLSHIFTDBLU32 pfnNormalU32; 716 PFNIEMAIMPLSHIFTDBLU64 pfnNormalU64; 717 } IEMOPSHIFTDBLSIZES; 718 /** Pointer to a double precision shift function table. */ 719 typedef IEMOPSHIFTDBLSIZES const *PCIEMOPSHIFTDBLSIZES; 720 721 722 /** @} */ 723 724 645 725 /** @name C instruction implementations for anything slightly complicated. 646 726 * @{ */ -
trunk/src/VBox/VMM/testcase/Makefile.kmk
r36864 r37002 37 37 PROGRAMS += \ 38 38 tstCFGM \ 39 tstCompiler \ 39 40 tstCompressionBenchmark \ 41 tstIEMCheckMc \ 42 tstMMHyperHeap \ 40 43 tstSSM \ 41 tstMMHyperHeap \42 tstVMREQ \43 tstCompiler \44 44 tstVMMR0CallHost-1 \ 45 tstVMMR0CallHost-2 45 tstVMMR0CallHost-2 \ 46 tstVMREQ 46 47 ifn1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), solaris.x86 solaris.amd64 win.amd64 ) ## TODO: Fix the code. 47 48 PROGRAMS += tstX86-1 … … 190 191 tstGlobalConfig_SOURCES = tstGlobalConfig.cpp 191 192 tstGlobalConfig_LIBS = $(LIB_RUNTIME) 193 194 tstIEMCheckMc_TEMPLATE = VBOXR3TSTEXE 195 tstIEMCheckMc_SOURCES = tstIEMCheckMc.cpp 196 tstIEMCheckMc_LIBS = $(LIB_RUNTIME) 192 197 193 198 tstMMHyperHeap_TEMPLATE = VBOXR3TSTEXE
Note:
See TracChangeset
for help on using the changeset viewer.