1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355
|
;;; Intel IA-64 CPU description. -*- Scheme -*-
;;; Copyright (C) 2000 Red Hat, Inc.
;;; This file is part of CGEN.
;;; See file COPYING.CGEN for details.
(include "simplify.inc")
;;; Architecture and cpu family definitions.
(define-arch
(name ia64)
(comment "Intel IA-64 architecture")
(insn-lsb0? #t)
(machs ia64)
(isas ia64)
)
(define-isa
(name ia64)
;; Each instruction in the 128-bit bundle is 41 bits wide.
(base-insn-bitsize 41)
;; Each bundle is 3 insns wide.
(liw-insns 3)
;; ??? How to specify "lots", as that's what the architecture's
;; stop bits means;
(parallel-insns 3)
;; Initial bit numbers to decode by.
(decode-assist (40 39 38 37))
)
(define-cpu
(name ia64)
(comment "Intel IA-64 family")
(insn-endian little)
(data-endian either)
(word-bitsize 64)
)
(eval
(begin
;; We need 64-bit host support.
(set! INT (mode:add! 'INT (mode:lookup 'DI)))
(set! UINT (mode:add! 'UINT (mode:lookup 'UDI)))
;; ??? This shouldn't be necessary, IMO.
(set! WI (mode:add! 'WI (mode:lookup 'DI)))
(set! UWI (mode:add! 'UWI (mode:lookup 'UDI)))
(set! AI (mode:add! 'AI (mode:lookup 'UDI)))
(set! IAI (mode:add! 'IAI (mode:lookup 'UDI)))
)
)
(define-mach
(name ia64)
(comment "Intel IA-64 processors")
(cpu ia64)
)
; ??? Incomplete. Pipeline and unit info wrong.
(define-model
(name ia64_itanium)
(comment "Intel Itanium processor")
(mach ia64)
(pipeline all "" () ((fetch) (decode) (execute) (writeback)))
(unit u-exec "Execution Unit" () 1 1
() () () ())
)
;;; Attributes.
;;;
;;; These are used to mark instructions so that we can decode the
;;; dependancy violation data in Intel's tables.
(define-attr
(name FORMAT)
(for insn)
(type enum)
(attrs META)
(values UNKNOWN
A1 A2 A3 A4 A5 A6 A7 A8 A9 A10
I1 I2 I3 I4 I5 I6 I7 I8 I9 I10
I11 I12 I13 I14 I15 I16 I17 I18 I19 I20
I21 I22 I23 I24 I25 I26 I27 I28 I29
M1 M2 M3 M4 M5 M6 M7 M8 M9 M10
M11 M12 M13 M14 M15 M16 M17 M18 M19 M20
M21 M22 M23 M24 M25 M26 M27 M28 M29 M30
M31 M32 M33 M34 M35 M36 M37 M38 M39 M40
M41 M42 M43 M44 M45 M46
B1 B2 B3 B4 B5 B6 B7 B8 B9
F1 F2 F3 F4 F5 F6 F7 F8 F9 F10
F11 F12 F13 F14 F15
)
(default UNKNOWN)
)
;; ??? NONE isn't a valid value, but non-FP insns obviously can't have
;; a valid value either.
(define-attr
(name FIELD-SF)
(for insn)
(type enum)
(attrs META)
(values NONE s0 s1 s2 s3)
(default NONE)
)
(define-attr
(name FIELD-LFTYPE)
(for insn)
(type enum)
(attrs META)
(values NONE fault)
(default NONE)
)
(define-attr
(name FIELD-CTYPE)
(for insn)
(type enum)
(attrs META)
(values NONE unc or and or.andcm orcm andcm and.orcm)
(default NONE)
)
;; Field AR3 references a register field.
;; Field CR3 references a register field.
;; Field ireg references a register field.
;;; ??? IA-64 specific instruction attributes:
;;;
;;; FIRST Must be at the beginning of an instruction group.
;;; SLOT2 Must be in slot 2 on a bundle.
;;; LAST Must be at the end of an instruction group.
;;; I_IN_MLI Insn is allowed in I slot of MLI.
;;; PRIV Privileged instruction.
;;; NO_PRED Insn cannot be predicated.
;;; Instruction fields.
;;;
;;; ??? This is confusing (at least to me) -- note that we specify the _top_
;;; of the field and a length.
;;;
;;; ??? There are only two fields used nearly universally. But the
;;; instruction formats are very regular in the sense that the same
;;; field specifications are re-used many times. So we just have the
;;; raw fields here first.
;; Fields used by most instructions.
(dnf f-opcode "major opcode" () 40 4)
(dnf f-qp "qualifying predicate" () 5 6)
;; Random parts used by the 109 (!) instruction formats.
(dnf f-36-6 "6 @ 36" () 36 6)
(df f-36-1s "1 @ 36, signed" () 36 1 INT #f #f)
(dnf f-36-1 "1 @ 36" () 36 1)
(dnf f-35-9 "9 @ 35" () 35 9)
(dnf f-35-6 "6 @ 35" () 35 6)
(dnf f-35-3 "3 @ 35" () 35 3)
(dnf f-35-2 "2 @ 35" () 35 2)
(dnf f-35-1 "1 @ 35" () 35 1)
(dnf f-34-2 "2 @ 34" () 34 2)
(dnf f-33-1 "1 @ 33" () 33 1)
(dnf f-32-27 "27 @ 32" () 32 27)
(dnf f-32-20 "20 @ 32" () 32 20)
(dnf f-32-13 "13 @ 32" () 32 13)
(dnf f-32-9 "9 @ 32" () 32 9)
(dnf f-32-6 "6 @ 32" () 32 6)
(dnf f-32-4 "4 @ 32" () 32 4)
(dnf f-32-2 "2 @ 32" () 32 2)
(dnf f-32-1 "1 @ 32" () 32 1)
(dnf f-31-8 "8 @ 31" () 31 8)
(dnf f-31-2 "2 @ 31" () 31 2)
(dnf f-30-4 "4 @ 30" () 30 4)
(dnf f-30-19 "19 @ 30" () 30 19)
(dnf f-29-2 "2 @ 29" () 29 2)
(dnf f-28-2 "2 @ 28" () 28 2)
(dnf f-27-8 "8 @ 27" () 27 8)
(dnf f-27-4 "4 @ 27" () 27 4)
(dnf f-27-3 "3 @ 27" () 27 3)
(dnf f-27-1 "1 @ 27" () 27 1)
(dnf f-26-21 "21 @ 26" () 26 21)
(dnf f-26-11 "11 @ 26" () 26 11)
(dnf f-26-7 "7 @ 26" () 26 7)
(dnf f-26-5 "5 @ 26" () 26 5)
(dnf f-26-1 "1 @ 26" () 26 1)
(dnf f-25-20 "20 @ 25" () 25 20)
(dnf f-25-6 "6 @ 25" () 25 6)
(dnf f-24-5 "5 @ 24" () 24 5)
(dnf f-23-4 "4 @ 23" () 23 4)
(dnf f-23-1 "1 @ 23" () 23 1)
(dnf f-22-1 "1 @ 22" () 22 1)
(dnf f-21-2 "2 @ 21" () 21 2)
(dnf f-21-1 "1 @ 21" () 21 1)
(dnf f-20-1 "1 @ 20" () 20 1)
(dnf f-19-7 "7 @ 19" () 19 7)
(dnf f-19-6 "6 @ 19" () 19 6)
(dnf f-19-4 "4 @ 19" () 19 4)
(dnf f-19-1 "1 @ 19" () 19 1)
(dnf f-18-5 "5 @ 18" () 18 5)
(dnf f-15-3 "3 @ 15" () 15 3)
(dnf f-15-1 "1 @ 15" () 15 1)
(dnf f-14-2 "2 @ 14" () 14 2)
(dnf f-13-1 "1 @ 13" () 13 1)
(dnf f-12-7 "7 @ 12" () 12 7)
(dnf f-12-1 "1 @ 12" () 12 1)
(dnf f-11-6 "6 @ 11" () 11 6)
(dnf f-11-3 "3 @ 11" () 11 3)
(dnf f-8-3 "3 @ 8" () 8 3)
;; The extra field for movl
(dnf f-81-41 "41 @ 81" () 81 41)
;; Virtual fields of the broken up constants.
(dnmf fv-sint8 "i8 for A3 A8 I27 M30"
() INT
(f-36-1s f-19-7)
(sequence () ; insert
(set (ifield f-36-1s) (srl (ifield fv-sint8) (const 7)))
(set (ifield f-19-7) (and (ifield fv-sint8) (const #x7f)))
)
(sequence () ; extract
(set (ifield fv-sint8)
(or (sll (ifield f-36-1s) (const 7))
(ifield f-19-7)))
)
)
(dnmf fv-sint9a "i9 for M3 M8 M15"
() INT
(f-36-1s f-27-1 f-19-7)
(sequence () ; insert
(set (ifield f-36-1s) (srl (ifield fv-sint9a) (const 8)))
(set (ifield f-27-1)
(and (srl (ifield fv-sint9a) (const 7)) (const 1)))
(set (ifield f-19-7) (and (ifield fv-sint9a) (const #x7f)))
)
(sequence () ; extract
(set (ifield fv-sint9a)
(or (sll (ifield f-36-1s) (const 8))
(or (sll (ifield f-27-1) (const 7))
(ifield f-19-7))))
)
)
(dnmf fv-sint9b "i9 for M5 M10"
() INT
(f-36-1s f-27-1 f-12-7)
(sequence () ; insert
(set (ifield f-36-1s) (srl (ifield fv-sint9b) (const 8)))
(set (ifield f-27-1)
(and (srl (ifield fv-sint9b) (const 7)) (const 1)))
(set (ifield f-12-7) (and (ifield fv-sint9b) (const #x7f)))
)
(sequence () ; extract
(set (ifield fv-sint9b)
(or (sll (ifield f-36-1s) (const 8))
(or (sll (ifield f-27-1) (const 7))
(ifield f-12-7))))
)
)
(dnmf fv-sint14 "i14 for A4"
() INT
(f-36-1s f-32-6 f-19-7)
(sequence () ; insert
(set (ifield f-36-1s) (srl (ifield fv-sint14) (const 13)))
(set (ifield f-32-6)
(and (srl (ifield fv-sint14) (const 7)) (const #x3f)))
(set (ifield f-19-7) (and (ifield fv-sint14) (const #x7f)))
)
(sequence () ; extract
(set (ifield fv-sint14)
(or (sll (ifield f-36-1s) (const 13))
(or (sll (ifield f-32-6) (const 7))
(ifield f-19-7))))
)
)
(dnmf fv-sint17 "mask17 for I23"
() INT
(f-36-1s f-31-8 f-12-7)
(sequence () ; insert
(set (ifield f-36-1s) (srl (ifield fv-sint17) (const 16)))
(set (ifield f-31-8)
(and (srl (ifield fv-sint17) (const 8)) (const #xff)))
(set (ifield f-12-7)
(and (srl (ifield fv-sint17) (const 1)) (const #x7f)))
)
(sequence () ; extract
(set (ifield fv-sint17)
(or (sll (ifield f-36-1s) (const 16))
(or (sll (ifield f-31-8) (const 8))
(ifield f-12-7))))
)
)
(dnmf fv-sint22 "i22 for A5"
() INT
(f-36-1s f-35-9 f-26-5 f-19-7)
(sequence () ; insert
(set (ifield f-36-1s) (srl (ifield fv-sint22) (const 21)))
(set (ifield f-26-5)
(and (srl (ifield fv-sint22) (const 16)) (const #x1f)))
(set (ifield f-35-9)
(and (srl (ifield fv-sint22) (const 7)) (const #x1ff)))
(set (ifield f-19-7) (and (ifield fv-sint22) (const #x7f)))
)
(sequence () ; extract
(set (ifield fv-sint22)
(or (or (sll (ifield f-36-1s) (const 21))
(sll (ifield f-26-5) (const 16)))
(or (sll (ifield f-35-9) (const 7))
(ifield f-19-7))))
)
)
(dnmf fv-sint44 "i44 for I24"
() INT
(f-36-1s f-32-27)
(sequence () ; insert
(set (ifield f-36-1s) (srl (ifield fv-sint44) (const 43)))
(set (ifield f-19-7)
(and (srl (ifield fv-sint44) (const 16))
(const #x7ffffff)))
)
(sequence () ; extract
(set (ifield fv-sint44)
(or (sll (ifield f-36-1s) (const 43))
(sll (ifield f-32-27) (const 16))))
)
)
(dnmf fv-sint64 "i64 for I18"
() INT
(f-81-41 f-36-1s f-35-9 f-26-5 f-21-1 f-19-7)
(sequence () ; insert
(set (ifield f-36-1s) (srl (ifield fv-sint64) (const 63)))
(set (ifield f-81-41)
(and (srl (ifield fv-sint64) (const 22))
(const #x1fffffffff)))
(set (ifield f-21-1)
(and (srl (ifield fv-sint64) (const 21)) (const 1)))
(set (ifield f-26-5)
(and (srl (ifield fv-sint64) (const 16)) (const #x1f)))
(set (ifield f-35-9)
(and (srl (ifield fv-sint64) (const 7)) (const #x1ff)))
(set (ifield f-19-7) (and (ifield fv-sint64) (const #x7f)))
)
(sequence () ; extract
(set (ifield fv-sint64)
(or (or (or (sll (ifield f-36-1s) (const 63))
(sll (ifield f-81-41) (const 22)))
(or (sll (ifield f-21-1) (const 21))
(sll (ifield f-26-5) (const 16))))
(or (sll (ifield f-35-9) (const 7))
(ifield f-19-7))))
)
)
(dnmf fv-uint21 "u21 for I19 M37 F15"
() UINT
(f-36-1 f-25-20)
(sequence () ; insert
(set (ifield f-36-1) (srl (ifield fv-uint21) (const 20)))
(set (ifield f-25-20) (and (ifield fv-uint21) (const #xfffff)))
)
(sequence () ; extract
(set (ifield fv-uint21)
(or (sll (ifield f-36-1) (const 20))
(ifield f-25-20)))
)
)
(dnmf fv-uint24 "u24 for M44"
() UINT
(f-36-1 f-32-2 f-26-21)
(sequence () ; insert
(set (ifield f-36-1) (srl (ifield fv-uint24) (const 23)))
(set (ifield f-32-1)
(and (srl (ifield fv-uint24) (const 21)) (const 3)))
(set (ifield f-26-21)
(and (ifield fv-uint24) (const #x1fffff)))
)
(sequence () ; extract
(set (ifield fv-uint24)
(or (sll (ifield f-36-1) (const 23))
(or (sll (ifield f-32-2) (const 21))
(ifield f-26-21))))
)
)
(dnmf fv-tgt25a "target25 for I20 M20 M21"
(PCREL-ADDR) INT
(f-36-1s f-32-13 f-12-7)
(sequence () ; insert
;; ??? Wherefore right shift.
(set (ifield f-36-1s) (srl (ifield fv-tgt25a) (const 20)))
(set (ifield f-32-13)
(and (srl (ifield fv-tgt25a) (const 7)) (const #x1fff)))
(set (ifield f-12-7) (and (ifield fv-tgt25a) (const #x7f)))
)
(sequence () ; extract
;; ??? Where will pc be added.
;; ??? Wherefore left shift.
(set (ifield fv-tgt25a)
(or (sll (ifield f-36-1s) (const 20))
(or (sll (ifield f-32-13) (const 7))
(ifield f-12-7))))
)
)
(dnmf fv-tgt25b "target25 for F14"
(PCREL-ADDR) INT
(f-36-1s f-25-20)
(sequence () ; insert
;; ??? Wherefore right shift.
(set (ifield f-36-1s) (srl (ifield fv-tgt25b) (const 20)))
(set (ifield f-25-20) (and (ifield fv-tgt25b) (const #xfffff)))
)
(sequence () ; extract
;; ??? Where will pc be added.
;; ??? Wherefore left shift.
(set (ifield fv-tgt25b)
(or (sll (ifield f-36-1) (const 20))
(ifield f-25-20)))
)
)
(dnmf fv-tgt25c "target25 for M22 M23 B1 B2 B3 B6"
(PCREL-ADDR) INT
(f-36-1s f-32-20)
(sequence () ; insert
;; ??? Wherefore right shift.
(set (ifield f-36-1s) (srl (ifield fv-tgt25c) (const 20)))
(set (ifield f-32-20) (and (ifield fv-tgt25c) (const #xfffff)))
)
(sequence () ; extract
;; ??? Where will pc be added.
;; ??? Wherefore left shift.
(set (ifield fv-tgt25c)
(or (sll (ifield f-36-1s) (const 20))
(ifield f-32-20)))
)
)
(dnmf fv-tag13a "tag13 for I21"
(PCREL-ADDR) INT
(f-32-9)
(sequence () ; insert
;; ??? Wherefore right shift.
(set (ifield f-32-9) (and (ifield fv-tag13a (const #x1ff))))
)
(sequence () ; extract
;; ??? Where will pc be added.
;; ??? Wherefore left shift.
(set (ifield fv-tag13a)
(sub (xor (ifield f-32-9) (const #x100)) (const #x100)))
)
)
(dnmf fv-tag13b "tag13 for B6 B7"
(PCREL-ADDR) INT
(f-34-2 f-12-7)
(sequence () ; insert
;; ??? Wherefore right shift.
(set (ifield f-34-2)
(and (sll (ifield fv-tag13b) (const 7)) (const 3)))
(set (ifield f-12-7) (and (ifield fv-tag13b) (const #x7f)))
)
(sequence () ; extract
;; ??? Where will pc be added.
;; ??? Wherefore left shift.
(set (ifield fv-tag13a)
(or (sll (sub (xor (ifield f-34-2) (const 2))
(const 2))
(const 7))
(ifield f-12-7)))
)
)
(dnmf fv-uint9 "u9 for F5"
() UINT
(f-34-2 f-26-7)
(sequence () ; insert
(set (ifield f-26-7) (srl (ifield fv-uint9) (const 2)))
(set (ifield f-34-2) (and (ifield fv-uint9) (const 3)))
)
(sequence () ; extract
(set (ifield fv-uint9)
(or (sll (ifield f-26-7) (const 2))
(ifield f-34-2)))
)
)
;; Fields with funny arithmetic
(df f-count2a "count2 for A2" () 28 2 UINT
((value pc) (sub WI value (const 1)))
((value pc) (add WI value (const 1)))
)
(df f-count2b "count2 for A10" () 28 2 UINT
((value pc)
(if WI (le value (const 2))
(sub WI value (const 1))
(error "invalid value for field count2b")))
((value pc) (add WI value (const 1)))
)
(df f-count2c "count2 for I1" () 31 2 UINT
((value pc)
(cond WI
((eq value (const 0)) (const 0))
((eq value (const 7)) (const 1))
((eq value (const 15)) (const 2))
((eq value (const 16)) (const 3))
(else (error "invalid value for field count2c"))))
((value pc)
(cond WI
((eq value (const 0)) (const 0))
((eq value (const 1)) (const 7))
((eq value (const 2)) (const 15))
((eq value (const 3)) (const 16))))
)
(df f-ccount5 "ccount5 for I8" () 24 5 UINT
((value pc) (sub WI (const 31) value))
((value pc) (sub WI (const 31) value))
)
(df f-len4 "len4 for I15" () 30 4 UINT
((value pc) (sub WI value (const 1)))
((value pc) (add WI value (const 1)))
)
(df f-len6 "len6 for I11 I12 I13 I14" () 32 6 UINT
((value pc) (sub WI value (const 1)))
((value pc) (add WI value (const 1)))
)
(df f-cpos6a "cpos6 for I12 I13" () 25 6 UINT
((value pc) (sub WI (const 63) value))
((value pc) (sub WI (const 63) value))
)
(df f-cpos6b "cpos6 for I14" () 19 6 UINT
((value pc) (sub WI (const 63) value))
((value pc) (sub WI (const 63) value))
)
(df f-cpos6c "cpos6 for I15" () 36 6 UINT
((value pc) (sub WI (const 63) value))
((value pc) (sub WI (const 63) value))
)
(dnmf fv-inc3 "inc3 for M17" () INT
(f-15-1 f-14-2)
(sequence () ; insert
(set (ifield f-15-1) (lt (ifield fv-inc3) (const 0)))
(set (ifield f-14-2) (abs (ifield fv-inc3)))
(set (ifield f-14-2)
(cond ((eq (ifield f-14-2) (const 1)) (const 3))
((eq (ifield f-14-2) (const 4)) (const 2))
((eq (ifield f-14-2) (const 8)) (const 1))
((eq (ifield f-14-2) (const 16)) (const 0))
(else (error "invalid value for field inc3"))))
)
(sequence () ; extract
(set (ifield fv-inc3)
(mul (add (mul (neg (ifield f-15-1)) (const 2)) (const 1))
(if (eq (ifield f-14-2) (const 3))
(const 1)
(sll (const 1) (sub (const 4)
(ifield f-14-2))))))
)
)
;;; Hardware pieces.
;;;
;;; These entries list the elements of the raw hardware. They're also
;;; used to provide tables and other elements of the assembly language.
;; The normal h-uint only provides 32 bits of integer.
(dnh h-int64 "64-bit integer" ()
(immediate (INT 64))
() () ()
)
;; ??? Intel calls this if IP, but from experience with the i960
;; simulator using the name "ip", we know that gdb reacts badly.
(dnh h-pc "program counter" (PC PROFILE) (pc) () () ())
(define-pmacro (build-decpair num) ((.dec num) num))
(define-hardware
(name h-gr)
(comment "general registers")
(attrs CACHE-ADDR)
(type register WI (128))
(indices keyword "r"
(.map build-decpair (.iota 128)))
)
;; ??? Skip GR NaTs for now, since we're not simulating.
(define-hardware
(name h-fr)
(comment "floating-point registers")
(type register XF (128))
(indices keyword "fr"
(.map build-decpair (.iota 128)))
)
(define-hardware
(name h-br)
(comment "branch registers")
(attrs CACHE-ADDR)
(type register WI (8))
(indices keyword "br"
(.map build-decpair (.iota 8)))
)
(define-hardware
(name h-ar)
(comment "application registers")
(type register WI (128))
(indices keyword "ar"
(.map build-decpair (.iota 128)))
)
(define-hardware
(name h-pr)
(comment "predicate registers")
(type register BI (64))
(indices keyword "pr"
(.map build-decpair (.iota 64)))
)
(define-hardware
(name h-cr)
(comment "control registers")
(type register WI (128))
(indices keyword "cr"
(.map build-decpair (.iota 128)))
)
;; ??? CFM, PSR, PMD, CPUID
;;; Instruction Operands.
;;;
;;; These entries provide a layer between the assembler and the raw
;;; hardware description, and are used to refer to hardware elements
;;; in the semantic code. Usually there's a bit of over-specification,
;;; but in more complicated instruction sets there isn't.
(dnop qp "qualifying predicate" () h-pr f-qp)
(dnop r1 "general register 1" () h-gr f-12-7)
(dnop r2 "general register 2" () h-gr f-19-7)
(dnop r3 "general register 3" () h-gr f-26-7)
(dnop r33 "general register 3 for A5" () h-gr f-21-2)
(dnop f1 "floating-point register 1" () h-fr f-12-7)
(dnop f2 "floating-point register 2" () h-fr f-19-7)
(dnop f3 "floating-point register 3" () h-fr f-26-7)
(dnop p1 "predicate register 1" () h-pr f-11-6)
(dnop p2 "predicate register 2" () h-pr f-32-6)
(dnop b1 "branch register 1" () h-br f-8-3)
(dnop b2 "branch register 2" () h-br f-15-3)
(dnop ar3 "application register 3" () h-ar f-26-7)
(dnop cr3 "control register 3" () h-cr f-26-7)
(dnop imm1 "imm1 for I14" () h-int64 f-36-1s)
(dnop imm8 "imm8 for A3 A8 I27 M30" () h-int64 fv-sint8)
(dnop imm9a "imm9 for M3 M8 M15" () h-int64 fv-sint9a)
(dnop imm9b "imm9 for M5 M10" () h-int64 fv-sint9b)
(dnop imm14 "imm14 for A4" () h-int64 fv-sint14)
(dnop imm17 "mask17 for I23" () h-int64 fv-sint17)
(dnop imm21 "imm21 for I19" () h-int64 fv-uint21)
(dnop imm22 "imm22 for A5" () h-int64 fv-sint22)
(dnop imm44 "imm44 for I24" () h-int64 fv-sint44)
(dnop imm64 "imm64 for I18" () h-int64 fv-sint64)
(dnop count2a "count2 for A2" () h-int64 f-count2a)
(dnop count2b "count2 for A10" () h-int64 f-count2b)
(dnop count2c "count2 for I1" () h-int64 f-count2c)
(dnop count5 "count5 for I6" () h-int64 f-18-5)
(dnop count6 "count6 for I10" () h-int64 f-32-6)
(dnop ccount5 "ccount5 for I8" () h-int64 f-ccount5)
(dnop len4 "len4 for I15" () h-int64 f-len4)
(dnop len6 "len6 for I11 I12 I13 I14" () h-int64 f-len6)
(dnop pos6 "pos6 for I11" () h-int64 f-19-6)
(dnop cpos6a "cpos6 for I12 I13" () h-int64 f-cpos6a)
(dnop cpos6b "cpos6 for I14" () h-int64 f-cpos6b)
(dnop cpos6c "cpos6 for I15" () h-int64 f-cpos6c)
(dnop inc3 "inc3 for M17" () h-int64 fv-inc3)
(define-operand
(name mbtype4)
(comment "mbtype4 type for I3")
(type h-int64)
(index f-23-4)
(handlers (parse "mbtype4")
(print "mbtype4"))
)
(dnop mhtype8 "mhtype8 for I4" () h-int64 f-27-8)
(dnop tgt25a "tgt25 for I20 M20 M21" () h-int64 fv-tgt25a)
(dnop tgt25b "tgt25 for F14" () h-int64 fv-tgt25b)
(dnop tgt25c "tgt25 for M22 M23 B1 B2 B3 B6" () h-int64 fv-tgt25c)
(dnop tag13a "tag13 for I21" () h-int64 fv-tag13a)
;; Completers
(define-operand
(name ldhint)
(comment "ldhint completer")
(type h-int64)
(index f-29-2)
(handlers (parse "ldhint")
(print "ldhint"))
)
(define-operand
(name sthint)
(comment "sthint completer")
(type h-int64)
(index f-29-2)
(handlers (parse "sthint")
(print "sthint"))
)
(define-operand
(name movbr_mwh)
(comment "mwh completer for mov_br")
(type h-int64)
(index f-21-2)
(handlers (parse "mwh")
(print "mwh"))
)
(define-operand
(name movbr_ih)
(comment "ih completer for mov_br")
(type h-int64)
(index f-23-1)
(handlers (parse "ih")
(print "ih"))
)
(define-operand
(name lfhint)
(comment "lfhint for lfetch")
(type h-int64)
(index f-29-2)
(handlers (parse "lfhint")
(print "lfhint"))
)
(define-operand
(name sorsolsof)
(comment "combined i,l,o,r for alloc")
(type h-int64)
(index f-30-19)
(handlers (parse "sorsolsof")
(print "sorsolsof"))
)
;; These are architecturally ignored bits, as opposed to architecturally
;; reserved bits. I.e. we should assemble them in with zeros, but we should
;; ignore them when disassembling.
(dnop ign_36_1 "ignore 1 @ 36" () h-int64 f-36-1)
(dnop ign_32_2 "ignore 2 @ 32" () h-int64 f-32-2)
(dnop ign_32_1 "ignore 1 @ 32" () h-int64 f-32-1)
(dnop ign_29_2 "ignore 2 @ 29" () h-int64 f-29-2)
(dnop ign_27_4 "ignore 4 @ 27" () h-int64 f-27-4)
(dnop ign_27_3 "ignore 3 @ 27" () h-int64 f-27-3)
(dnop ign_27_1 "ignore 1 @ 27" () h-int64 f-27-1)
(dnop ign_26_11 "ignore 11 @ 26" () h-int64 f-26-11)
(dnop ign_26_7 "ignore 7 @ 26" () h-int64 f-26-7)
(dnop ign_26_1 "ignore 1 @ 26" () h-int64 f-26-1)
(dnop ign_23_4 "ignore 4 @ 23" () h-int64 f-23-4)
(dnop ign_19_7 "ignore 7 @ 19" () h-int64 f-19-7)
(dnop ign_19_6 "ignore 6 @ 19" () h-int64 f-19-6)
(dnop ign_19_4 "ignore 4 @ 19" () h-int64 f-19-4)
(dnop ign_19_1 "ignore 1 @ 19" () h-int64 f-19-1)
(dnop ign_13_1 "ignore 1 @ 13" () h-int64 f-13-1)
(dnop ign_12_7 "ignore 7 @ 12" () h-int64 f-12-7)
;; ??? Add more as needed.
;;; "A" Format Instruction definitions.
(define-pmacro (I-A1 mnemonic maybe-p1 op x2a ve x4 x2b)
(dni (.sym mnemonic maybe-p1)
(.str "Integer ALU, reg-reg, " mnemonic maybe-p1)
((FORMAT A1))
(.str mnemonic " $r1=$r2,$r3" maybe-p1)
(+ (f-opcode op) (f-35-2 x2a) (f-33-1 ve) (f-32-4 x4) (f-28-2 x2b)
ign_36_1 r3 r2 r1 qp)
()
()
)
)
(I-A1 add "" 8 0 0 0 0)
(I-A1 add ",1" 8 0 0 0 1)
(I-A1 sub "" 8 0 0 1 1)
(I-A1 sub ",1" 8 0 0 1 0)
(I-A1 addp4 "" 8 0 0 2 0)
(I-A1 and "" 8 0 0 3 0)
(I-A1 andcm "" 8 0 0 3 1)
(I-A1 or "" 8 0 0 3 2)
(I-A1 xor "" 8 0 0 3 3)
(define-pmacro (I-A2 mnemonic op x2a ve x4)
(dni mnemonic
(.str "Shift Left and Add, " mnemonic)
((FORMAT A2))
(.str mnemonic " $r1=$r2,$count2a,$r3")
(+ (f-opcode op) (f-35-2 x2a) (f-33-1 ve) (f-32-4 x4)
ign_36_1 count2a r3 r2 r1 qp)
()
()
)
)
(I-A2 shladd 8 0 0 4)
(I-A2 shladdp4 8 0 0 6)
(define-pmacro (I-A3 mnemonic op x2a ve x4 x2b)
(dni (.sym mnemonic "i")
(.str "Integer ALU, imm8-reg, " mnemonic)
((FORMAT A3))
(.str mnemonic " $r1=$imm8,$r3")
(+ (f-opcode op) (f-35-2 x2a) (f-33-1 ve) (f-32-4 x4) (f-28-2 x2b)
r3 imm8 r1 qp)
()
()
)
)
(I-A3 sub 8 0 0 9 1)
(I-A3 and 8 0 0 11 0)
(I-A3 andcm 8 0 0 11 1)
(I-A3 or 8 0 0 11 2)
(I-A3 xor 8 0 0 11 3)
(define-pmacro (I-A4 mnemonic op x2a ve)
(dni (.str mnemonic "i")
(.str "Add imm14, " mnemonic)
((FORMAT A4))
(.str mnemonic " $r1=$imm14,$r3")
(+ (f-opcode op) (f-35-2 x2a) (f-33-1 ve)
r3 imm14 r1 qp)
()
()
)
)
(I-A4 adds 8 2 0)
(I-A4 addp4 8 3 0)
(define-pmacro (I-A5 mnemonic op)
(dni (.str mnemonic)
(.str "Add imm22, " mnemonic)
((FORMAT A5))
(.str mnemonic " $r1=$imm22,$r33")
(+ (f-opcode op) imm22 r33 r1 qp)
()
()
)
)
(I-A5 addl 9)
(define-pmacro (I-A6 mnemonic ctype-attr op x2 tb ta c)
(dni (.sym mnemonic)
(.str "Integer Compare, reg-reg, " mnemonic)
((FORMAT A6) (FIELD-CTYPE ctype-attr))
(.str mnemonic " $p1,$p2=$r2,$r3")
(+ (f-opcode op) (f-36-1 tb) (f-35-2 x2) (f-33-1 ta) (f-12-1 c)
p2 r3 r2 p1 qp)
()
()
)
)
(define-pmacro (I-A6-cmp-cond-ctype cmp cond ctype op x2 ta c)
(I-A6 (.sym cmp "." cond
(.eval (if (eq? (string-length ctype) 0) "" "."))
ctype)
(.eval (if (eq? (string-length ctype) 0) 'NONE (string->symbol ctype)))
op 0 x2 ta c)
)
(define-pmacro (I-A6-cmp cmp x2)
(begin
(I-A6-cmp-cond-ctype cmp lt "" 12 x2 0 0)
(I-A6-cmp-cond-ctype cmp ltu "" 13 x2 0 0)
(I-A6-cmp-cond-ctype cmp eq "" 14 x2 0 0)
(I-A6-cmp-cond-ctype cmp lt "unc" 12 x2 0 1)
(I-A6-cmp-cond-ctype cmp ltu "unc" 13 x2 0 1)
(I-A6-cmp-cond-ctype cmp eq "unc" 14 x2 0 1)
(I-A6-cmp-cond-ctype cmp eq "and" 12 x2 1 0)
(I-A6-cmp-cond-ctype cmp eq "or" 13 x2 1 0)
(I-A6-cmp-cond-ctype cmp eq "or.andcm" 14 x2 1 0)
(I-A6-cmp-cond-ctype cmp ne "and" 12 x2 1 1)
(I-A6-cmp-cond-ctype cmp ne "or" 13 x2 1 1)
(I-A6-cmp-cond-ctype cmp ne "or.andcm" 14 x2 1 1)
)
)
(I-A6-cmp cmp 0)
(I-A6-cmp cmp4 1)
(define-pmacro (I-A7 mnemonic ctype-attr op x2 tb ta c)
(dni (.sym mnemonic)
(.str "Integer Compare, zero-reg, " mnemonic)
((FORMAT A7) (FIELD-CTYPE ctype-attr))
(.str mnemonic " $p1,$p2=r0,$r3")
(+ (f-opcode op) (f-36-1 tb) (f-35-2 x2) (f-33-1 ta) (f-12-1 c)
p2 r3 (f-19-7 0) p1 qp)
()
()
)
)
(define-pmacro (I-A7-cmp-cond-ctype cmp cond ctype op x2 ta c)
(I-A7 (.sym cmp "." cond "." ctype) (.sym ctype) op x2 1 ta c)
)
(define-pmacro (I-A7-cmp-cond cmp cond x2 ta c)
(begin
(I-A7-cmp-cond-ctype cmp cond and 12 x2 ta c)
(I-A7-cmp-cond-ctype cmp cond or 13 x2 ta c)
(I-A7-cmp-cond-ctype cmp cond andcm 14 x2 ta c)
)
)
(define-pmacro (I-A7-cmp cmp x2)
(begin
(I-A7-cmp-cond cmp gt x2 0 0)
(I-A7-cmp-cond cmp le x2 0 1)
(I-A7-cmp-cond cmp ge x2 1 0)
(I-A7-cmp-cond cmp lt x2 1 1)
)
)
(I-A7-cmp cmp 0)
(I-A7-cmp cmp4 1)
(define-pmacro (I-A8 mnemonic ctype-attr op x2 ta c)
(dni (.sym mnemonic)
(.str "Integer Compare, imm8-reg, " mnemonic)
((FORMAT A7) (FIELD-CTYPE ctype-attr))
(.str mnemonic " $p1,$p2=$imm8,$r3")
(+ (f-opcode op) (f-35-2 x2) (f-33-1 ta) (f-12-1 c)
p2 r3 imm8 p1 qp)
()
()
)
)
(define-pmacro (I-A8-cmp-cond-ctype cmp cond ctype op x2 ta c)
(I-A8 (.sym cmp "." cond
(.eval (if (eq? (string-length ctype) 0) "" "."))
ctype)
(.eval (if (eq? (string-length ctype) 0) 'NONE (string->symbol ctype)))
op x2 ta c)
)
(define-pmacro (I-A8-cmp cmp x2)
(begin
(I-A8-cmp-cond-ctype cmp lt "" 12 x2 0 0)
(I-A8-cmp-cond-ctype cmp ltu "" 13 x2 0 0)
(I-A8-cmp-cond-ctype cmp eq "" 14 x2 0 0)
(I-A8-cmp-cond-ctype cmp lt "unc" 12 x2 0 1)
(I-A8-cmp-cond-ctype cmp ltu "unc" 13 x2 0 1)
(I-A8-cmp-cond-ctype cmp eq "unc" 14 x2 0 1)
(I-A8-cmp-cond-ctype cmp eq "and" 12 x2 1 0)
(I-A8-cmp-cond-ctype cmp eq "or" 12 x2 1 0)
(I-A8-cmp-cond-ctype cmp eq "or.andcm" 12 x2 1 0)
(I-A8-cmp-cond-ctype cmp ne "and" 12 x2 1 1)
(I-A8-cmp-cond-ctype cmp ne "or" 12 x2 1 1)
(I-A8-cmp-cond-ctype cmp ne "or.andcm" 12 x2 1 1)
)
)
(I-A8-cmp cmp 2)
(I-A8-cmp cmp4 3)
(define-pmacro (I-A9 mnemonic op x2a za zb x4 x2b)
(dni (.str mnemonic)
(.str "Multimetia ALU, " mnemonic)
((FORMAT A9))
(.str mnemonic " $r1=$r2,$r3")
(+ (f-opcode op) (f-36-1 za) (f-35-2 x2a) (f-33-1 zb) (f-32-4 x4)
(f-28-2 x2b) r3 r2 r1 qp)
()
()
)
)
(I-A9 padd1 8 1 0 0 0 0)
(I-A9 padd2 8 1 0 1 0 0)
(I-A9 padd4 8 1 1 0 0 0)
(I-A9 padd1.sss 8 1 0 0 0 1)
(I-A9 padd2.sss 8 1 0 1 0 1)
(I-A9 padd1.uuu 8 1 0 0 0 2)
(I-A9 padd2.uuu 8 1 0 1 0 2)
(I-A9 padd1.uus 8 1 0 0 0 3)
(I-A9 padd2.uus 8 1 0 1 0 3)
(I-A9 psub1 8 1 0 0 1 0)
(I-A9 psub2 8 1 0 1 1 0)
(I-A9 psub4 8 1 1 0 1 0)
(I-A9 psub1.sss 8 1 0 0 1 1)
(I-A9 psub2.sss 8 1 0 1 1 1)
(I-A9 psub1.uuu 8 1 0 0 1 2)
(I-A9 psub2.uuu 8 1 0 1 1 2)
(I-A9 psub1.uus 8 1 0 0 1 3)
(I-A9 psub2.uus 8 1 0 1 1 3)
(I-A9 pavg1 8 1 0 0 2 2)
(I-A9 pavg2 8 1 0 1 2 2)
(I-A9 pavg1.raz 8 1 0 0 2 3)
(I-A9 pavg2.raz 8 1 0 1 2 3)
(I-A9 pavgsub1 8 1 0 0 3 2)
(I-A9 pavgsub2 8 1 0 1 3 2)
(I-A9 pcmp1.eq 8 1 0 0 9 0)
(I-A9 pcmp2.eq 8 1 0 1 9 0)
(I-A9 pcmp4.eq 8 1 1 0 9 0)
(I-A9 pcmp1.gt 8 1 0 0 9 1)
(I-A9 pcmp2.gt 8 1 0 1 9 1)
(I-A9 pcmp4.gt 8 1 1 0 9 1)
(define-pmacro (I-A10 mnemonic op x2a za zb x4)
(dni mnemonic
(.str "Multimedia Shift and Add, " mnemonic)
((FORMAT A10))
(.str mnemonic " $r1=$r2,$count2b,$r3")
(+ (f-opcode op) (f-36-1 za) (f-35-2 x2a) (f-33-1 zb) (f-32-4 x4)
count2b r3 r2 r1 qp)
()
()
)
)
(I-A10 pshladd2 8 1 0 1 4)
(I-A10 pshradd2 8 1 0 1 6)
;;; "I" Format Instruction definitions.
(define-pmacro (I-I1 mnemonic op za zb ve x2a x2b)
(dni mnemonic
(.str "Multimedia Multiply and Shift, " mnemonic)
((FORMAT I1))
(.str mnemonic " $r1=$r2,$r3,$count2c")
(+ (f-opcode op) (f-36-1 za) (f-35-2 x2a) (f-33-1 zb) (f-32-1 ve)
(f-29-2 x2b) count2c ign_27_1 r3 r2 r1 qp)
()
()
)
)
(I-I1 pmpyshr2 7 0 1 0 0 3)
(I-I1 pmpyshr2.u 7 0 1 0 0 1)
(define-pmacro (I-I2 mnemonic op za zb ve x2a x2b x2c)
(dni mnemonic
(.str "Multimedia Multiply/Mix/Pack/Unpack, " mnemonic)
((FORMAT I2))
(.str mnemonic " $r1=$r2,$r3")
(+ (f-opcode op) (f-36-1 za) (f-35-2 x2a) (f-33-1 zb) (f-32-1 ve)
(f-31-2 x2c) (f-29-2 x2b) ign_27_1 r3 r2 r1 qp)
()
()
)
)
(I-I2 pmpy2.r 7 0 1 0 2 1 3)
(I-I2 pmpy2.l 7 0 1 0 2 3 3)
(I-I2 mix1.r 7 0 0 0 2 0 2)
(I-I2 mix2.r 7 0 1 0 2 0 2)
(I-I2 mix4.r 7 1 0 0 2 0 2)
(I-I2 mix1.l 7 0 0 0 2 2 2)
(I-I2 mix2.l 7 0 1 0 2 2 2)
(I-I2 mix4.l 7 1 0 0 2 2 2)
(I-I2 pack2.uss 7 0 1 0 2 0 0)
(I-I2 pack2.sss 7 0 1 0 2 2 0)
(I-I2 pack4.sss 7 1 0 0 2 2 0)
(I-I2 unpack1.h 7 0 0 0 2 0 1)
(I-I2 unpack2.h 7 0 1 0 2 0 1)
(I-I2 unpack4.h 7 1 0 0 2 0 1)
(I-I2 unpack1.l 7 0 0 0 2 2 1)
(I-I2 unpack2.l 7 0 1 0 2 2 1)
(I-I2 unpack4.l 7 1 0 0 2 2 1)
(I-I2 pmin1.u 7 0 0 0 2 1 0)
(I-I2 pmax1.u 7 0 0 0 2 1 1)
(I-I2 pmin2 7 0 1 0 2 3 0)
(I-I2 pmax2 7 0 1 0 2 3 1)
(I-I2 psad1 7 0 0 0 2 3 2)
(define-pmacro (I-I3 mnemonic op za zb ve x2a x2b x2c)
(dni mnemonic
(.str "Multimedia Mux1, " mnemonic)
((FORMAT I3))
(.str mnemonic " $r1=$r2,$mbtype4")
(+ (f-opcode op) (f-36-1 za) (f-35-2 x2a) (f-33-1 zb) (f-32-1 ve)
(f-31-2 x2c) (f-29-2 x2b) ign_27_4 mbtype4 r2 r1 qp)
()
()
)
)
(I-I3 mux1 7 0 0 0 3 2 2)
(define-pmacro (I-I4 mnemonic op za zb ve x2a x2b x2c)
(dni mnemonic
(.str "Multimedia Mux2, " mnemonic)
((FORMAT I4))
(.str mnemonic " $r1=$r2,$mhtype8")
(+ (f-opcode op) (f-36-1 za) (f-35-2 x2a) (f-33-1 zb) (f-32-1 ve)
(f-31-2 x2c) (f-29-2 x2b) mhtype8 r2 r1 qp)
()
()
)
)
(I-I4 mux2 7 0 1 0 3 2 2)
(define-pmacro (I-I5 mnemonic op za zb ve x2a x2b x2c)
(dni mnemonic
(.str "Shift Right, variable, " mnemonic)
((FORMAT I5))
(.str mnemonic " $r1=$r3,$r2")
(+ (f-opcode op) (f-36-1 za) (f-35-2 x2a) (f-33-1 zb) (f-32-1 ve)
(f-31-2 x2c) (f-29-2 x2b) ign_27_1 r3 r2 r1 qp)
()
()
)
)
(I-I5 pshr2 7 0 1 0 0 2 0)
(I-I5 pshr4 7 1 0 0 0 2 0)
(I-I5 shr 7 1 1 0 0 2 0)
(I-I5 pshr2.u 7 0 1 0 0 0 0)
(I-I5 pshr4.u 7 1 0 0 0 0 0)
(I-I5 shr.u 7 1 1 0 0 0 0)
(define-pmacro (I-I6 mnemonic op za zb ve x2a x2b x2c)
(dni (.sym mnemonic "i")
(.str "Shift Right, fixed, " mnemonic)
((FORMAT I6))
(.str mnemonic " $r1=$r3,$count5")
(+ (f-opcode op) (f-36-1 za) (f-35-2 x2a) (f-33-1 zb) (f-32-1 ve)
(f-31-2 x2c) (f-29-2 x2b) ign_27_1 r3 ign_19_1 count5 ign_13_1
r1 qp)
()
()
)
)
(I-I6 pshr2 7 0 1 0 1 3 0)
(I-I6 pshr4 7 1 0 0 1 3 0)
(I-I6 pshr2.u 7 0 1 0 1 1 0)
(I-I6 pshr4.u 7 1 0 0 1 1 0)
(define-pmacro (I-I7 mnemonic op za zb ve x2a x2b x2c)
(dni mnemonic
(.str "Shift Left, variable, " mnemonic)
((FORMAT I7))
(.str mnemonic " $r1=$r2,$r3")
(+ (f-opcode op) (f-36-1 za) (f-35-2 x2a) (f-33-1 zb) (f-32-1 ve)
(f-31-2 x2c) (f-29-2 x2b) ign_27_1 r3 r2 r1 qp)
()
()
)
)
(I-I7 pshl2 7 0 1 0 0 0 1)
(I-I7 pshl4 7 1 0 0 0 0 1)
(I-I7 shl 7 1 1 0 0 0 1)
(define-pmacro (I-I8 mnemonic op za zb ve x2a x2b x2c)
(dni (.sym mnemonic "i")
(.str "Shift Left, fixed, " mnemonic)
((FORMAT I8))
(.str mnemonic " $r1=$r2,$ccount5")
(+ (f-opcode op) (f-36-1 za) (f-35-2 x2a) (f-33-1 zb) (f-32-1 ve)
(f-31-2 x2c) (f-29-2 x2b) ign_27_3 ccount5 r2 r1 qp)
()
()
)
)
(I-I8 pshl2 7 0 1 0 0 0 1)
(I-I8 pshl4 7 1 0 0 0 0 1)
(define-pmacro (I-I9 mnemonic op za zb ve x2a x2b x2c)
(dni mnemonic
(.str "Population Count, " mnemonic)
((FORMAT I9))
(.str mnemonic " $r1=$r3")
(+ (f-opcode op) (f-36-1 za) (f-35-2 x2a) (f-33-1 zb) (f-32-1 ve)
(f-31-2 x2c) (f-29-2 x2b) ign_27_1 r3 (f-19-7 0) r1 qp)
()
()
)
)
(I-I9 popcnt 7 0 1 0 1 1 2)
(define-pmacro (I-I10 mnemonic op x2 x)
(dni mnemonic
(.str "Shift Right Pair, " mnemonic)
((FORMAT I10))
(.str mnemonic " $r1=$r2,$r3,$count6")
(+ (f-opcode op) ign_36_1 (f-35-2 x2) (f-33-1 x) count6 r3 r2 r1 qp)
()
()
)
)
(I-I10 shrp 5 3 0)
(define-pmacro (I-I11 mnemonic op x2 x y)
(dni mnemonic
(.str "Extract, " mnemonic)
((FORMAT I11))
(.str mnemonic " $r1=$r3,$pos6,$len6")
(+ (f-opcode op) ign_36_1 (f-35-2 x2) (f-33-1 x) (f-13-1 y)
r3 pos6 len6 r1 qp)
()
()
)
)
(I-I11 extr.u 5 1 0 0)
(I-I11 extr 5 1 0 1)
(define-pmacro (I-I12 mnemonic op x2 x y)
(dni mnemonic
(.str "Zero and Deposit, " mnemonic)
((FORMAT I12))
(.str mnemonic " $r1=$r2,$cpos6a,$len6")
(+ (f-opcode op) ign_36_1 (f-35-2 x2) (f-33-1 x) (f-26-1 y)
r2 cpos6a len6 r1 qp)
()
()
)
)
(I-I12 dep.z 5 1 1 0)
(define-pmacro (I-I13 mnemonic op x2 x y)
(dni (.sym mnemonic "i")
(.str "Zero and Deposit Immediate, " mnemonic)
((FORMAT I13))
(.str mnemonic " $r1=$imm8,$cpos6a,$len6")
(+ (f-opcode op) (f-35-2 x2) (f-33-1 x) (f-26-1 y)
imm8 cpos6a len6 r1 qp)
()
()
)
)
(I-I13 dep.z 5 1 1 0)
(define-pmacro (I-I14 mnemonic op x2 x)
(dni (.sym mnemonic "i")
(.str "Deposit Immediate, " mnemonic)
((FORMAT I14))
(.str mnemonic " $r1=$imm1,$r3,$cpos6b,$len6")
(+ (f-opcode op) (f-35-2 x2) (f-33-1 x) ign_13_1
imm1 r3 cpos6b len6 r1 qp)
()
()
)
)
(I-I14 dep 5 3 1)
(define-pmacro (I-I15 mnemonic op)
(dni mnemonic
(.str "Deposit, " mnemonic)
((FORMAT I15))
(.str mnemonic " $r1=$r2,$r3,$cpos6c,$len4")
(+ (f-opcode op) cpos6c len4 r2 r3 r1 qp)
()
()
)
)
(I-I15 dep 4)
(define-pmacro (I-I16 mnemonic ctype-attr op x2 ta tb y c)
(dni mnemonic
(.str "Test Bit, " mnemonic)
((FORMAT I16) (FIELD-CTYPE ctype-attr))
(.str mnemonic " $p1,$p2=$r3,$pos6")
(+ (f-opcode op) (f-36-1 tb) (f-35-2 x2) (f-33-1 ta) (f-13-1 y)
(f-12-1 c) p2 r3 pos6 p1 qp)
()
()
)
)
(define-pmacro (I-I16-ctype mnemonic ctype op x2 ta tb y c)
(I-I16 (.sym mnemonic
(.eval (if (eq? (string-length ctype) 0) "" "."))
ctype)
(.eval (if (eq? (string-length ctype) 0) 'NONE
(string->symbol ctype)))
op x2 ta tb y c)
)
(I-I16-ctype tbit.z "" 5 0 0 0 0 0)
(I-I16-ctype tbit.z "unc" 5 0 0 0 0 1)
(I-I16-ctype tbit.z "and" 5 0 0 1 0 0)
(I-I16-ctype tbit.nz "and" 5 0 0 1 0 1)
(I-I16-ctype tbit.z "or" 5 0 1 0 0 0)
(I-I16-ctype tbit.nz "or" 5 0 1 0 0 1)
(I-I16-ctype tbit.z "or.andcm" 5 0 1 1 0 0)
(I-I16-ctype tbit.nz "or.andcm" 5 0 1 1 0 1)
(define-pmacro (I-I17 mnemonic ctype-attr op x2 ta tb y c)
(dni mnemonic
(.str "Test Bit, " mnemonic)
((FORMAT I17) (FIELD-CTYPE ctype-attr))
(.str mnemonic " $p1,$p2=$r3")
(+ (f-opcode op) (f-36-1 tb) (f-35-2 x2) (f-33-1 ta) (f-13-1 y)
(f-12-1 c) p2 r3 ign_19_6 p1 qp)
()
()
)
)
(define-pmacro (I-I17-ctype mnemonic ctype op x2 ta tb y c)
(I-I17 (.sym mnemonic
(.eval (if (eq? (string-length ctype) 0) "" "."))
ctype)
(.eval (if (eq? (string-length ctype) 0) 'NONE
(string->symbol ctype)))
op x2 ta tb y c)
)
(I-I17-ctype tnat.z "" 5 0 0 0 0 0)
(I-I17-ctype tnat.z "unc" 5 0 0 0 0 1)
(I-I17-ctype tnat.z "and" 5 0 0 1 0 0)
(I-I17-ctype tnat.nz "and" 5 0 0 1 0 1)
(I-I17-ctype tnat.z "or" 5 0 1 0 0 0)
(I-I17-ctype tnat.nz "or" 5 0 1 0 0 1)
(I-I17-ctype tnat.z "or.andcm" 5 0 1 1 0 0)
(I-I17-ctype tnat.nz "or.andcm" 5 0 1 1 0 1)
(define-pmacro (I-I18 mnemonic op vc)
(dni mnemonic
(.str "Move Long Immediate, " mnemonic)
((FORMAT I18))
(.str mnemonic " $r1=$imm64")
(+ (f-opcode op) (f-20-1 vc) r1 imm64 qp)
()
()
)
)
(I-I18 movl 6 0)
(define-pmacro (I-I19 mnemonic op x3 x6)
(dni mnemonic
(.str "Break/Nop, " mnemonic)
((FORMAT I19))
(.str mnemonic " $imm21")
(+ (f-opcode op) (f-35-3 x3) (f-32-6 x6) ign_26_1 imm21 qp)
()
()
)
)
(I-I19 break.i 0 0 0)
(I-I19 nop.i 0 0 1)
(define-pmacro (I-I20 mnemonic op x3)
(dni mnemonic
(.str "Integer Speculation Check, " mnemonic)
((FORMAT I20))
(.str mnemonic " $r2,$tgt25a")
(+ (f-opcode op) (f-35-3 x3) tgt25a r2 qp)
()
()
)
)
(I-I20 chk.s.i 0 1)
(define-pmacro (I-I21 mnemonic op x3 x)
(dni (.sym mnemonic _tbr)
(.str "Move to BR, " mnemonic)
((FORMAT I21))
(.str mnemonic
"$movbr_mwh$movbr_ih $b1=$r2,$tag13a")
(+ (f-opcode op) (f-35-3 x3) movbr_ih (f-22-1 x) movbr_mwh
(f-12-1 x) (f-11-3 x3) ign_36_1 b1 r2 tag13a qp)
()
()
)
)
(I-I21 mov 0 7 0)
(I-I21 mov.ret 0 7 1)
(define-pmacro (I-I22 mnemonic op x3 x6)
(dni (.sym mnemonic _fbr)
(.str "Move from BR, " mnemonic)
((FORMAT I22))
(.str mnemonic " $r1=$b2")
(+ (f-opcode op) (f-35-3 x3) (f-32-6 x6) ign_36_1 ign_26_11
r1 b2 qp)
()
()
)
)
(I-I22 mov 0 0 #x31)
(define-pmacro (I-I23 mnemonic op x3)
(dni (.sym mnemonic _tpr)
(.str "Move to PR, reg, " mnemonic)
((FORMAT I23))
(.str mnemonic " pr=$r2,$imm17")
(+ (f-opcode op) (f-35-3 x3) ign_32_1 ign_23_4 r2 imm17 qp)
()
()
)
)
(I-I23 mov 0 3)
(define-pmacro (I-I24 mnemonic op x3)
(dni (.sym mnemonic _tpri)
(.str "Move to PR, imm, " mnemonic)
((FORMAT I24))
(.str mnemonic " pr.rot=$imm44")
(+ (f-opcode op) (f-35-3 x3) imm44 qp)
()
()
)
)
(I-I24 mov 0 2)
(define-pmacro (I-I25 mnemonic src op x3 x6)
(dni (.sym mnemonic _f src)
(.str "Move from Pred/IP, " mnemonic)
((FORMAT I25))
(.str mnemonic " $r1=" src)
(+ (f-opcode op) (f-35-3 x3) (f-32-6 x6) ign_26_7 ign_19_7 r1 qp)
()
()
)
)
(I-I25 mov ip 0 0 #x30)
(I-I25 mov pr 0 0 #x33)
(define-pmacro (I-I26 mnemonic op x3 x6)
(dni (.sym mnemonic _tar)
(.str "Move to AR, reg, " mnemonic)
((FORMAT I26))
(.str mnemonic " $ar3=$r2")
(+ (f-opcode op) (f-35-3 x3) (f-32-6 x6) ign_36_1 ign_12_7 ar3 r2 qp)
()
()
)
)
(I-I26 mov.i 0 0 #x2A)
(define-pmacro (I-I27 mnemonic op x3 x6)
(dni (.sym mnemonic _tari)
(.str "Move to AR, imm, " mnemonic)
((FORMAT I27))
(.str mnemonic " $ar3=$imm8")
(+ (f-opcode op) (f-35-3 x3) (f-32-6 x6) ign_12_7 ar3 imm8 qp)
()
()
)
)
(I-I27 mov.i 0 0 #x0A)
(define-pmacro (I-I28 mnemonic op x3 x6)
(dni (.sym mnemonic _far)
(.str "Move from AR, " mnemonic)
((FORMAT I28))
(.str mnemonic " $r1=$ar3")
(+ (f-opcode op) (f-35-3 x3) (f-32-6 x6) ign_36_1 ign_19_7 ar3 r1 qp)
()
()
)
)
(I-I28 mov.i 0 0 #x32)
(define-pmacro (I-I29 mnemonic op x3 x6)
(dni mnemonic
(.str "Sign/Zero Extend/Compute Zero Index, " mnemonic)
((FORMAT I29))
(.str mnemonic " $r1=$r3")
(+ (f-opcode op) (f-35-3 x3) (f-32-6 x6) ign_36_1 ign_19_7 r3 r1 qp)
()
()
)
)
(I-I29 zxt1 0 0 #x10)
(I-I29 zxt2 0 0 #x11)
(I-I29 zxt4 0 0 #x12)
(I-I29 sxt1 0 0 #x14)
(I-I29 sxt2 0 0 #x15)
(I-I29 sxt4 0 0 #x16)
(I-I29 czx1.l 0 0 #x18)
(I-I29 czx2.l 0 0 #x19)
(I-I29 czx1.r 0 0 #x1C)
(I-I29 czx2.r 0 0 #x1D)
;;; "M" Format Instruction definitions.
(define-pmacro (apply-ildspec macro mnemonic x6-2)
(begin
(.apply macro (.splice mnemonic x6-2))
(.apply macro (.splice (.sym mnemonic .s) (.eval (+ x6-2 #x04))))
(.apply macro (.splice (.sym mnemonic .a) (.eval (+ x6-2 #x08))))
(.apply macro (.splice (.sym mnemonic .sa) (.eval (+ x6-2 #x0C))))
(.apply macro (.splice (.sym mnemonic .bias) (.eval (+ x6-2 #x10))))
(.apply macro (.splice (.sym mnemonic .acq) (.eval (+ x6-2 #x14))))
(.apply macro (.splice (.sym mnemonic .c.clr) (.eval (+ x6-2 #x20))))
(.apply macro (.splice (.sym mnemonic .c.nc) (.eval (+ x6-2 #x24))))
(.apply macro (.splice (.sym mnemonic .c.clr.acq) (.eval (+ x6-2 #x28))))
)
)
(define-pmacro (I-M1 mnemonic op m x x6)
(dni mnemonic
(.str "Integer Load, " mnemonic)
((FORMAT M1))
(.str mnemonic "$ldhint $r1=[$r3]")
(+ (f-opcode op) (f-36-1 m) (f-35-6 x6) ldhint (f-27-1 x)
r3 r1 ign_19_7 qp)
()
()
)
)
(apply-ildspec
(.pmacro (mnemonic x6)
(I-M1 mnemonic 4 0 0 x6))
ld1 0)
(apply-ildspec
(.pmacro (mnemonic x6)
(I-M1 mnemonic 4 0 0 x6))
ld2 1)
(apply-ildspec
(.pmacro (mnemonic x6)
(I-M1 mnemonic 4 0 0 x6))
ld4 2)
(apply-ildspec
(.pmacro (mnemonic x6)
(I-M1 mnemonic 4 0 0 x6))
ld8 3)
(I-M1 ld8.fill 4 0 0 #x1B)
(define-pmacro (I-M2 mnemonic op m x x6)
(dni (.sym mnemonic .ir)
(.str "Integer Load, incr reg, " mnemonic)
((FORMAT M2))
(.str mnemonic "$ldhint $r1=[$r3],$r2")
(+ (f-opcode op) (f-36-1 m) (f-35-6 x6) ldhint (f-27-1 x)
r3 r2 r1 qp)
()
()
)
)
(apply-ildspec
(.pmacro (mnemonic x6)
(I-M2 mnemonic 4 1 0 x6))
ld1 0)
(apply-ildspec
(.pmacro (mnemonic x6)
(I-M2 mnemonic 4 1 0 x6))
ld2 1)
(apply-ildspec
(.pmacro (mnemonic x6)
(I-M2 mnemonic 4 1 0 x6))
ld4 2)
(apply-ildspec
(.pmacro (mnemonic x6)
(I-M2 mnemonic 4 1 0 x6))
ld8 3)
(I-M2 ld8.fill 4 1 0 #x1B)
(define-pmacro (I-M3 mnemonic op x6)
(dni (.sym mnemonic .ii)
(.str "Integer Load, incr imm, " mnemonic)
((FORMAT M3))
(.str mnemonic "$ldhint $r1=[$r3],$imm9a")
(+ (f-opcode op) (f-35-6 x6) ldhint r3 imm9a r1 qp)
()
()
)
)
(apply-ildspec
(.pmacro (mnemonic x6)
(I-M3 mnemonic 5 x6))
ld1 0)
(apply-ildspec
(.pmacro (mnemonic x6)
(I-M3 mnemonic 5 x6))
ld2 1)
(apply-ildspec
(.pmacro (mnemonic x6)
(I-M3 mnemonic 5 x6))
ld4 2)
(apply-ildspec
(.pmacro (mnemonic x6)
(I-M3 mnemonic 5 x6))
ld8 3)
(I-M3 ld8.fill 5 #x1B)
(define-pmacro (apply-istspec macro mnemonic x6-2)
(begin
(.apply macro (.splice mnemonic x6-2))
(.apply macro (.splice (.sym mnemonic .rel) (.eval (+ x6-2 #x04))))
)
)
(define-pmacro (I-M4 mnemonic op m x x6)
(dni mnemonic
(.str "Integer Store, " mnemonic)
((FORMAT M4))
(.str mnemonic "$sthint [$r3]=$r2")
(+ (f-opcode op) (f-36-1 m) (f-35-6 x6) (f-27-1 x)
sthint r3 r2 ign_12_7 qp)
()
()
)
)
(apply-istspec
(.pmacro (mnemonic x6)
(I-M4 mnemonic 4 0 0 x6))
st1 #x30)
(apply-istspec
(.pmacro (mnemonic x6)
(I-M4 mnemonic 4 0 0 x6))
st2 #x31)
(apply-istspec
(.pmacro (mnemonic x6)
(I-M4 mnemonic 4 0 0 x6))
st4 #x32)
(apply-istspec
(.pmacro (mnemonic x6)
(I-M4 mnemonic 4 0 0 x6))
st8 #x33)
(I-M4 st8.spill 4 0 0 #x3B)
(define-pmacro (I-M5 mnemonic op x6)
(dni (.sym mnemonic .ii)
(.str "Integer Store, incr imm, " mnemonic)
((FORMAT M5))
(.str mnemonic "$sthint [$r3]=$r2,$imm9b")
(+ (f-opcode op) (f-35-6 x6) sthint r3 imm9b r2 qp)
()
()
)
)
(apply-istspec
(.pmacro (mnemonic x6)
(I-M5 mnemonic 5 x6))
st1 #x30)
(apply-istspec
(.pmacro (mnemonic x6)
(I-M5 mnemonic 5 x6))
st2 #x31)
(apply-istspec
(.pmacro (mnemonic x6)
(I-M5 mnemonic 5 x6))
st4 #x32)
(apply-istspec
(.pmacro (mnemonic x6)
(I-M5 mnemonic 5 x6))
st8 #x33)
(I-M5 st8.spill 5 #x3B)
(define-pmacro (apply-fldspec macro mnemonic x6-2)
(begin
(.apply macro (.splice mnemonic x6-2))
(.apply macro (.splice (.sym mnemonic .s) (.eval (+ x6-2 #x04))))
(.apply macro (.splice (.sym mnemonic .a) (.eval (+ x6-2 #x08))))
(.apply macro (.splice (.sym mnemonic .sa) (.eval (+ x6-2 #x0C))))
(.apply macro (.splice (.sym mnemonic .c.clr) (.eval (+ x6-2 #x20))))
(.apply macro (.splice (.sym mnemonic .c.nc) (.eval (+ x6-2 #x24))))
)
)
(define-pmacro (I-M6 mnemonic op m x x6)
(dni mnemonic
(.str "Floating-point Load, " mnemonic)
((FORMAT M6))
(.str mnemonic "$ldhint $f1=[$r3]")
(+ (f-opcode op) (f-36-1 m) (f-35-6 x6) ldhint (f-27-1 x)
r3 f1 ign_19_7 qp)
()
()
)
)
(apply-fldspec
(.pmacro (mnemonic x6)
(I-M6 mnemonic 6 0 0 x6))
ldfs 2)
(apply-fldspec
(.pmacro (mnemonic x6)
(I-M6 mnemonic 6 0 0 x6))
ldfd 3)
(apply-fldspec
(.pmacro (mnemonic x6)
(I-M6 mnemonic 6 0 0 x6))
ldf8 1)
(apply-fldspec
(.pmacro (mnemonic x6)
(I-M6 mnemonic 6 0 0 x6))
ldfe 0)
(I-M6 ldf.fill 6 0 0 #x1B)
(define-pmacro (I-M7 mnemonic op m x x6)
(dni (.sym mnemonic .ir)
(.str "Floating-point Load, incr reg, " mnemonic)
((FORMAT M7))
(.str mnemonic "$ldhint $f1=[$r3],$r2")
(+ (f-opcode op) (f-36-1 m) (f-35-6 x6) ldhint (f-27-1 x)
r3 r2 f1 qp)
()
()
)
)
(apply-fldspec
(.pmacro (mnemonic x6)
(I-M7 mnemonic 6 1 0 x6))
ldfs 2)
(apply-fldspec
(.pmacro (mnemonic x6)
(I-M7 mnemonic 6 1 0 x6))
ldfd 3)
(apply-fldspec
(.pmacro (mnemonic x6)
(I-M7 mnemonic 6 1 0 x6))
ldf8 1)
(apply-fldspec
(.pmacro (mnemonic x6)
(I-M7 mnemonic 6 1 0 x6))
ldfe 0)
(I-M7 ldf.fill 6 1 0 #x1B)
(define-pmacro (I-M8 mnemonic op x6)
(dni (.sym mnemonic .ii)
(.str "Floating-point Load, incr imm, " mnemonic)
((FORMAT M8))
(.str mnemonic "$ldhint $f1=[$r3],$imm9a")
(+ (f-opcode op) (f-35-6 x6) ldhint r3 imm9a f1 qp)
()
()
)
)
(apply-fldspec
(.pmacro (mnemonic x6)
(I-M8 mnemonic 7 x6))
ldfs 2)
(apply-fldspec
(.pmacro (mnemonic x6)
(I-M8 mnemonic 7 x6))
ldfd 3)
(apply-fldspec
(.pmacro (mnemonic x6)
(I-M8 mnemonic 7 x6))
ldf8 1)
(apply-fldspec
(.pmacro (mnemonic x6)
(I-M8 mnemonic 7 x6))
ldfe 0)
(I-M8 ldf.fill 7 #x1B)
(define-pmacro (I-M9 mnemonic op m x x6)
(dni mnemonic
(.str "Floating-point Store, " mnemonic)
((FORMAT M9))
(.str mnemonic "$sthint [$r3]=$f2")
(+ (f-opcode op) (f-36-1 m) (f-35-6 x6) (f-27-1 x)
sthint r3 f2 ign_12_7 qp)
()
()
)
)
(I-M9 stfs 6 0 0 #x32)
(I-M9 stfd 6 0 0 #x33)
(I-M9 stf8 6 0 0 #x31)
(I-M9 stfe 6 0 0 #x30)
(I-M9 stf.spill 6 0 0 #x3B)
(define-pmacro (I-M10 mnemonic op x6)
(dni (.sym mnemonic .ii)
(.str "Floating-point Store, incr imm, " mnemonic)
((FORMAT M10))
(.str mnemonic "$sthint [$r3]=$f2,$imm9b")
(+ (f-opcode op) (f-35-6 x6) sthint r3 imm9b f2 qp)
()
()
)
)
(I-M10 stfs 7 #x32)
(I-M10 stfd 7 #x33)
(I-M10 stf8 7 #x31)
(I-M10 stfe 7 #x30)
(I-M10 stf.spill 7 #x3B)
(define-pmacro (I-M11 mnemonic op m x x6)
(dni mnemonic
(.str "Floating-point Load Pair, " mnemonic)
((FORMAT M11))
(.str mnemonic "$ldhint $f1,$f2=[$r3]")
(+ (f-opcode op) (f-36-1 m) (f-35-6 x6) ldhint (f-27-1 x)
r3 f1 f2 qp)
()
()
)
)
(apply-fldspec
(.pmacro (mnemonic x6)
(I-M11 mnemonic 6 0 1 x6))
ldfps 2)
(apply-fldspec
(.pmacro (mnemonic x6)
(I-M11 mnemonic 6 0 1 x6))
ldfpd 3)
(apply-fldspec
(.pmacro (mnemonic x6)
(I-M11 mnemonic 6 0 1 x6))
ldfp8 1)
(define-pmacro (I-M12 mnemonic n op m x x6)
(dni mnemonic
(.str "Floating-point Load Pair, incr imm, " mnemonic)
((FORMAT M12))
(.str mnemonic "$ldhint $f1,$f2=[$r3]," n)
(+ (f-opcode op) (f-36-1 m) (f-35-6 x6) ldhint (f-27-1 x)
r3 f1 f2 qp)
()
()
)
)
(apply-fldspec
(.pmacro (mnemonic x6)
(I-M12 mnemonic 8 6 1 1 x6))
ldfps 2)
(apply-fldspec
(.pmacro (mnemonic x6)
(I-M12 mnemonic 16 6 1 1 x6))
ldfpd 3)
(apply-fldspec
(.pmacro (mnemonic x6)
(I-M12 mnemonic 16 6 1 1 x6))
ldfp8 1)
(define-pmacro (apply-lftype macro mnemonic)
(begin
(.apply macro (.splice mnemonic NONE #x2C))
(.apply macro (.splice (.sym mnemonic .excl) NONE #x2D))
(.apply macro (.splice (.sym mnemonic .fault) fault #x2E))
(.apply macro (.splice (.sym mnemonic .fault.excl) fault #x2F))
)
)
(define-pmacro (I-M13 mnemonic fault-attr op m x x6)
(dni (.sym mnemonic)
(.str "Line Prefetch, " mnemonic)
((FORMAT M13) (FIELD-LFTYPE fault-attr))
(.str mnemonic "$lfhint [$r3]")
(+ (f-opcode op) (f-36-1 m) (f-35-6 x6) lfhint (f-27-1 x)
r3 ign_19_7 ign_12_7 qp)
()
()
)
)
(apply-lftype
(.pmacro (mnemonic fault-attr x6)
(I-M13 mnemonic fault-attr 6 0 0 x6))
lfetch)
(define-pmacro (I-M14 mnemonic fault-attr op m x x6)
(dni (.sym mnemonic .ir)
(.str "Line Prefetch, incr reg" mnemonic)
((FORMAT M14) (FIELD-LFTYPE fault-attr))
(.str mnemonic "$lfhint [$r3],$r2")
(+ (f-opcode op) (f-36-1 m) (f-35-6 x6) lfhint (f-27-1 x)
r3 r2 ign_12_7 qp)
()
()
)
)
(apply-lftype
(.pmacro (mnemonic fault-attr x6)
(I-M14 mnemonic fault-attr 6 0 0 x6))
lfetch)
(define-pmacro (I-M15 mnemonic fault-attr op x6)
(dni (.sym mnemonic .ii)
(.str "Line Prefetch, incr imm" mnemonic)
((FORMAT M15) (FIELD-LFTYPE fault-attr))
(.str mnemonic "$lfhint [$r3],$imm9a")
(+ (f-opcode op) (f-35-6 x6) lfhint r3 imm9a ign_12_7 qp)
()
()
)
)
(apply-lftype
(.pmacro (mnemonic fault-attr x6)
(I-M15 mnemonic fault-attr 7 x6))
lfetch)
(define-pmacro (I-M16 mnemonic extra op m x x6)
(dni mnemonic
(.str "Exchange/Compare and Exchange, " mnemonic)
((FORMAT M16))
(.str mnemonic "$ldhint $r1=[$r3],$r2" extra)
(+ (f-opcode op) (f-36-1 m) (f-35-6 x6) (f-27-1 x)
ldhint r3 r2 r1 qp)
()
()
)
)
(I-M16 cmpxchg1.acq ",ar.ccv" 4 0 1 #x00)
(I-M16 cmpxchg2.acq ",ar.ccv" 4 0 1 #x01)
(I-M16 cmpxchg4.acq ",ar.ccv" 4 0 1 #x02)
(I-M16 cmpxchg8.acq ",ar.ccv" 4 0 1 #x03)
(I-M16 cmpxchg1.rel ",ar.ccv" 4 0 1 #x04)
(I-M16 cmpxchg2.rel ",ar.ccv" 4 0 1 #x05)
(I-M16 cmpxchg4.rel ",ar.ccv" 4 0 1 #x06)
(I-M16 cmpxchg8.rel ",ar.ccv" 4 0 1 #x07)
(I-M16 xchg1.rel "" 4 0 1 #x08)
(I-M16 xchg2.rel "" 4 0 1 #x09)
(I-M16 xchg4.rel "" 4 0 1 #x0A)
(I-M16 xchg8.rel "" 4 0 1 #x0B)
(define-pmacro (I-M17 mnemonic op m x x6)
(dni mnemonic
(.str "Fetch and Add, " mnemonic)
((FORMAT M17))
(.str mnemonic "$ldhint $r1=[$r3],$inc3")
(+ (f-opcode op) (f-36-1 m) (f-35-6 x6) (f-27-1 x)
ldhint r3 ign_19_4 inc3 r1 qp)
()
()
)
)
(I-M17 fetchadd4.acq 4 0 1 #x12)
(I-M17 fetchadd8.acq 4 0 1 #x13)
(I-M17 fetchadd4.rel 4 0 1 #x16)
(I-M17 fetchadd8.rel 4 0 1 #x17)
(define-pmacro (I-M18 mnemonic op m x x6)
(dni mnemonic
(.str "Set FR, " mnemonic)
((FORMAT M18))
(.str mnemonic " $f1=$r2")
(+ (f-opcode op) (f-36-1 m) (f-35-6 x6) (f-27-1 x)
ign_26_7 ign_29_2 r2 f1 qp)
()
()
)
)
(I-M18 setf.sig 6 0 1 #x1C)
(I-M18 setf.exp 6 0 1 #x1D)
(I-M18 setf.s 6 0 1 #x1E)
(I-M18 setf.d 6 0 1 #x1F)
(define-pmacro (I-M19 mnemonic op m x x6)
(dni mnemonic
(.str "Get FR, " mnemonic)
((FORMAT M19))
(.str mnemonic " $r1=$f2")
(+ (f-opcode op) (f-36-1 m) (f-35-6 x6) (f-27-1 x)
ign_26_7 ign_29_2 f2 r1 qp)
()
()
)
)
(I-M19 getf.sig 4 0 1 #x1C)
(I-M19 getf.exp 4 0 1 #x1D)
(I-M19 getf.s 4 0 1 #x1E)
(I-M19 getf.d 4 0 1 #x1F)
(define-pmacro (I-M20 mnemonic op x3)
(dni mnemonic
(.str "Integer Speculation Check, " mnemonic)
((FORMAT M20))
(.str mnemonic " $r2,$tgt25a")
(+ (f-opcode op) (f-35-3 x3) r2 tgt25a qp)
()
()
)
)
(I-M20 chk.s.m 1 1)
(define-pmacro (I-M21 mnemonic op x3)
(dni (.sym mnemonic .f)
(.str "Floating-point Speculation Check, " mnemonic)
((FORMAT M21))
(.str mnemonic " $f2,$tgt25a")
(+ (f-opcode op) (f-35-3 x3) f2 tgt25a qp)
()
()
)
)
(I-M21 chk.s 1 3)
(define-pmacro (I-M22 mnemonic op x3)
(dni mnemonic
(.str "Integer Advanced Load Check, " mnemonic)
((FORMAT M22))
(.str mnemonic " $r1,$tgt25c")
(+ (f-opcode op) (f-35-3 x3) tgt25c r1 qp)
()
()
)
)
(I-M22 chk.a.nc 0 4)
(I-M22 chk.a.clr 0 5)
(define-pmacro (I-M23 mnemonic op x3)
(dni (.sym mnemonic .f)
(.str "Floating-point Advanced Load Check, " mnemonic)
((FORMAT M23))
(.str mnemonic " $f1,$tgt25c")
(+ (f-opcode op) (f-35-3 x3) tgt25c f1 qp)
()
()
)
)
(I-M22 chk.a.nc 0 6)
(I-M22 chk.a.clr 0 7)
(define-pmacro (I-M24 mnemonic op x3 x4 x2)
(dni mnemonic
(.str "Sync/Fence/Serialize/ALAT Control, " mnemonic)
((FORMAT M24))
(.str mnemonic)
(+ (f-opcode op) (f-35-3 x3) (f-32-2 x2) (f-30-4 x4)
ign_36_1 ign_26_7 ign_19_7 ign_12_7 qp)
()
()
)
)
(I-M24 invala 0 0 0 1)
(I-M24 fwb 0 0 0 2)
(I-M24 mf 0 0 2 2)
(I-M24 mf.a 0 0 3 2)
(I-M24 srlz.d 0 0 0 3)
(I-M24 srlz.i 0 0 1 3)
(I-M24 sync.i 0 0 3 3)
(define-pmacro (I-M25 mnemonic op x3 x4 x2)
(dni mnemonic
(.str "RSE Control, " mnemonic)
((FORMAT M25))
(.str mnemonic)
(+ (f-opcode op) (f-35-3 x3) (f-32-2 x2) (f-30-4 x4)
ign_36_1 ign_26_7 ign_19_7 ign_12_7 (f-qp 0))
()
()
)
)
(I-M25 flushrs 0 0 #xC 0)
(I-M25 loadrs 0 0 #xA 0)
(define-pmacro (I-M26 mnemonic op x3 x4 x2)
(dni mnemonic
(.str "Integer ALAT Entry Invalidate, " mnemonic)
((FORMAT M26))
(.str mnemonic " $r1")
(+ (f-opcode op) (f-35-3 x3) (f-32-2 x2) (f-30-4 x4)
ign_36_1 ign_26_7 ign_19_7 r1 qp)
()
()
)
)
(I-M26 invala.e 0 0 2 1)
(define-pmacro (I-M27 mnemonic op x3 x4 x2)
(dni (.sym mnemonic .f)
(.str "Floating-point ALAT Entry Invalidate, " mnemonic)
((FORMAT M27))
(.str mnemonic " $f1")
(+ (f-opcode op) (f-35-3 x3) (f-32-2 x2) (f-30-4 x4)
ign_36_1 ign_26_7 ign_19_7 f1 qp)
()
()
)
)
(I-M27 invala.e 0 0 3 1)
(define-pmacro (I-M28 mnemonic op x3 x6)
(dni mnemonic
(.str "Flush Cache/Purge Translation Cache Entry, " mnemonic)
((FORMAT M28))
(.str mnemonic " $r3")
(+ (f-opcode op) (f-35-3 x3) (f-32-6 x6)
ign_36_1 r3 ign_19_7 ign_12_7 qp)
()
()
)
)
(I-M28 fc 1 0 #x30)
(I-M28 ptc.e 1 0 #x34)
(define-pmacro (I-M29 mnemonic op x3 x6)
(dni (.sym mnemonic _tar)
(.str "Move to AR, reg, " mnemonic)
((FORMAT M29))
(.str mnemonic " $ar3=$r2")
(+ (f-opcode op) (f-35-3 x3) (f-32-6 x6)
ign_36_1 ar3 r2 ign_12_7 qp)
()
()
)
)
(I-M29 mov.m 1 0 #x2A)
(define-pmacro (I-M30 mnemonic op x3 x4 x2)
(dni (.sym mnemonic _tari)
(.str "Move to AR, imm," mnemonic)
((FORMAT M30))
(.str mnemonic " $ar3=$imm8")
(+ (f-opcode op) (f-35-3 x3) (f-32-2 x2) (f-30-4 x4)
ar3 imm8 ign_12_7 qp)
()
()
)
)
(I-M30 mov.m 0 0 8 2)
(define-pmacro (I-M31 mnemonic op x3 x6)
(dni (.sym mnemonic _far)
(.str "Move from AR, " mnemonic)
((FORMAT M31))
(.str mnemonic " $r1=$ar3")
(+ (f-opcode op) (f-35-3 x3) (f-32-6 x6) ign_36_1 ign_19_7 ar3 r1 qp)
()
()
)
)
(I-M31 mov.m 1 0 #x22)
(define-pmacro (I-M32 mnemonic op x3 x6)
(dni (.sym mnemonic _tcr)
(.str "Move to CR, " mnemonic)
((FORMAT M32))
(.str mnemonic " $cr3=$r2")
(+ (f-opcode op) (f-35-3 x3) (f-32-6 x6)
ign_36_1 cr3 r2 ign_12_7 qp)
()
()
)
)
(I-M32 mov 1 0 #x2C)
(define-pmacro (I-M33 mnemonic op x3 x6)
(dni (.sym mnemonic _fcr)
(.str "Move from CR, " mnemonic)
((FORMAT M33))
(.str mnemonic " $r1=$cr3")
(+ (f-opcode op) (f-35-3 x3) (f-32-6 x6)
ign_36_1 cr3 ign_19_7 r1 qp)
()
()
)
)
(I-M33 mov 1 0 #x24)
(define-pmacro (I-M34 mnemonic op x3)
(dni mnemonic
(.str "Allocate Register Stack Frame, " mnemonic)
((FORMAT M34))
(.str mnemonic " $r1=ar.pfs,$sorsolsof")
(+ (f-opcode op) (f-35-3 x3) ign_36_1 ign_32_2
sorsolsof r1 (f-qp 0))
()
()
)
)
(I-M34 alloc 1 6)
(define-pmacro (I-M35 mnemonic which op x3 x6)
(dni (.sym mnemonic _t which)
(.str "Move to PSR, " mnemonic)
((FORMAT M35))
(.str mnemonic " " which "=$r2")
(+ (f-opcode op) (f-35-3 x3) (f-32-6 x6) ign_36_1
r2 ign_26_7 ign_12_7 qp)
()
()
)
)
(I-M35 mov psr.l 1 0 #x2D)
(I-M35 mov psr.um 1 0 #x29)
(define-pmacro (I-M36 mnemonic which op x3 x6)
(dni (.sym mnemonic _f which)
(.str "Move from PSR, " mnemonic)
((FORMAT M35))
(.str mnemonic " $r1=" which)
(+ (f-opcode op) (f-35-3 x3) (f-32-6 x6) ign_36_1
ign_26_7 ign_19_7 r1 qp)
()
()
)
)
(I-M36 mov psr 1 0 #x25)
(I-M36 mov psr.um 1 0 #x21)
(define-pmacro (I-M37 mnemonic op x3 x4 x2)
(dni mnemonic
(.str "Break/Nop, " mnemonic)
((FORMAT M37))
(.str mnemonic " $imm21")
(+ (f-opcode op) (f-35-3 x3) (f-32-2 x2) (f-30-4 x4) ign_26_1 imm21 qp)
()
()
)
)
(I-M37 break.m 0 0 0 0)
(I-M37 nop.m 0 0 1 0)
|