Revision a699a7be target-cris/translate.c
b/target-cris/translate.c | ||
---|---|---|
1361 | 1361 |
|
1362 | 1362 |
/* Start of insn decoders. */ |
1363 | 1363 |
|
1364 |
static unsigned int dec_bccq(DisasContext *dc)
|
|
1364 |
static int dec_bccq(DisasContext *dc) |
|
1365 | 1365 |
{ |
1366 | 1366 |
int32_t offset; |
1367 | 1367 |
int sign; |
... | ... | |
1381 | 1381 |
cris_prepare_cc_branch (dc, offset, cond); |
1382 | 1382 |
return 2; |
1383 | 1383 |
} |
1384 |
static unsigned int dec_addoq(DisasContext *dc)
|
|
1384 |
static int dec_addoq(DisasContext *dc) |
|
1385 | 1385 |
{ |
1386 | 1386 |
int32_t imm; |
1387 | 1387 |
|
... | ... | |
1395 | 1395 |
|
1396 | 1396 |
return 2; |
1397 | 1397 |
} |
1398 |
static unsigned int dec_addq(DisasContext *dc)
|
|
1398 |
static int dec_addq(DisasContext *dc) |
|
1399 | 1399 |
{ |
1400 | 1400 |
LOG_DIS("addq %u, $r%u\n", dc->op1, dc->op2); |
1401 | 1401 |
|
... | ... | |
1407 | 1407 |
cpu_R[dc->op2], cpu_R[dc->op2], tcg_const_tl(dc->op1), 4); |
1408 | 1408 |
return 2; |
1409 | 1409 |
} |
1410 |
static unsigned int dec_moveq(DisasContext *dc)
|
|
1410 |
static int dec_moveq(DisasContext *dc) |
|
1411 | 1411 |
{ |
1412 | 1412 |
uint32_t imm; |
1413 | 1413 |
|
... | ... | |
1418 | 1418 |
tcg_gen_movi_tl(cpu_R[dc->op2], imm); |
1419 | 1419 |
return 2; |
1420 | 1420 |
} |
1421 |
static unsigned int dec_subq(DisasContext *dc)
|
|
1421 |
static int dec_subq(DisasContext *dc) |
|
1422 | 1422 |
{ |
1423 | 1423 |
dc->op1 = EXTRACT_FIELD(dc->ir, 0, 5); |
1424 | 1424 |
|
... | ... | |
1429 | 1429 |
cpu_R[dc->op2], cpu_R[dc->op2], tcg_const_tl(dc->op1), 4); |
1430 | 1430 |
return 2; |
1431 | 1431 |
} |
1432 |
static unsigned int dec_cmpq(DisasContext *dc)
|
|
1432 |
static int dec_cmpq(DisasContext *dc) |
|
1433 | 1433 |
{ |
1434 | 1434 |
uint32_t imm; |
1435 | 1435 |
dc->op1 = EXTRACT_FIELD(dc->ir, 0, 5); |
... | ... | |
1442 | 1442 |
cpu_R[dc->op2], cpu_R[dc->op2], tcg_const_tl(imm), 4); |
1443 | 1443 |
return 2; |
1444 | 1444 |
} |
1445 |
static unsigned int dec_andq(DisasContext *dc)
|
|
1445 |
static int dec_andq(DisasContext *dc) |
|
1446 | 1446 |
{ |
1447 | 1447 |
uint32_t imm; |
1448 | 1448 |
dc->op1 = EXTRACT_FIELD(dc->ir, 0, 5); |
... | ... | |
1455 | 1455 |
cpu_R[dc->op2], cpu_R[dc->op2], tcg_const_tl(imm), 4); |
1456 | 1456 |
return 2; |
1457 | 1457 |
} |
1458 |
static unsigned int dec_orq(DisasContext *dc)
|
|
1458 |
static int dec_orq(DisasContext *dc) |
|
1459 | 1459 |
{ |
1460 | 1460 |
uint32_t imm; |
1461 | 1461 |
dc->op1 = EXTRACT_FIELD(dc->ir, 0, 5); |
... | ... | |
1467 | 1467 |
cpu_R[dc->op2], cpu_R[dc->op2], tcg_const_tl(imm), 4); |
1468 | 1468 |
return 2; |
1469 | 1469 |
} |
1470 |
static unsigned int dec_btstq(DisasContext *dc)
|
|
1470 |
static int dec_btstq(DisasContext *dc) |
|
1471 | 1471 |
{ |
1472 | 1472 |
dc->op1 = EXTRACT_FIELD(dc->ir, 0, 4); |
1473 | 1473 |
LOG_DIS("btstq %u, $r%d\n", dc->op1, dc->op2); |
... | ... | |
1482 | 1482 |
dc->flags_uptodate = 1; |
1483 | 1483 |
return 2; |
1484 | 1484 |
} |
1485 |
static unsigned int dec_asrq(DisasContext *dc)
|
|
1485 |
static int dec_asrq(DisasContext *dc) |
|
1486 | 1486 |
{ |
1487 | 1487 |
dc->op1 = EXTRACT_FIELD(dc->ir, 0, 4); |
1488 | 1488 |
LOG_DIS("asrq %u, $r%d\n", dc->op1, dc->op2); |
... | ... | |
1494 | 1494 |
cpu_R[dc->op2], cpu_R[dc->op2], 4); |
1495 | 1495 |
return 2; |
1496 | 1496 |
} |
1497 |
static unsigned int dec_lslq(DisasContext *dc)
|
|
1497 |
static int dec_lslq(DisasContext *dc) |
|
1498 | 1498 |
{ |
1499 | 1499 |
dc->op1 = EXTRACT_FIELD(dc->ir, 0, 4); |
1500 | 1500 |
LOG_DIS("lslq %u, $r%d\n", dc->op1, dc->op2); |
... | ... | |
1508 | 1508 |
cpu_R[dc->op2], cpu_R[dc->op2], 4); |
1509 | 1509 |
return 2; |
1510 | 1510 |
} |
1511 |
static unsigned int dec_lsrq(DisasContext *dc)
|
|
1511 |
static int dec_lsrq(DisasContext *dc) |
|
1512 | 1512 |
{ |
1513 | 1513 |
dc->op1 = EXTRACT_FIELD(dc->ir, 0, 4); |
1514 | 1514 |
LOG_DIS("lsrq %u, $r%d\n", dc->op1, dc->op2); |
... | ... | |
1522 | 1522 |
return 2; |
1523 | 1523 |
} |
1524 | 1524 |
|
1525 |
static unsigned int dec_move_r(DisasContext *dc)
|
|
1525 |
static int dec_move_r(DisasContext *dc) |
|
1526 | 1526 |
{ |
1527 | 1527 |
int size = memsize_zz(dc); |
1528 | 1528 |
|
... | ... | |
1550 | 1550 |
return 2; |
1551 | 1551 |
} |
1552 | 1552 |
|
1553 |
static unsigned int dec_scc_r(DisasContext *dc)
|
|
1553 |
static int dec_scc_r(DisasContext *dc) |
|
1554 | 1554 |
{ |
1555 | 1555 |
int cond = dc->op2; |
1556 | 1556 |
|
... | ... | |
1593 | 1593 |
} |
1594 | 1594 |
} |
1595 | 1595 |
|
1596 |
static unsigned int dec_and_r(DisasContext *dc)
|
|
1596 |
static int dec_and_r(DisasContext *dc) |
|
1597 | 1597 |
{ |
1598 | 1598 |
TCGv t[2]; |
1599 | 1599 |
int size = memsize_zz(dc); |
... | ... | |
1610 | 1610 |
return 2; |
1611 | 1611 |
} |
1612 | 1612 |
|
1613 |
static unsigned int dec_lz_r(DisasContext *dc)
|
|
1613 |
static int dec_lz_r(DisasContext *dc) |
|
1614 | 1614 |
{ |
1615 | 1615 |
TCGv t0; |
1616 | 1616 |
LOG_DIS("lz $r%u, $r%u\n", |
... | ... | |
1623 | 1623 |
return 2; |
1624 | 1624 |
} |
1625 | 1625 |
|
1626 |
static unsigned int dec_lsl_r(DisasContext *dc)
|
|
1626 |
static int dec_lsl_r(DisasContext *dc) |
|
1627 | 1627 |
{ |
1628 | 1628 |
TCGv t[2]; |
1629 | 1629 |
int size = memsize_zz(dc); |
... | ... | |
1640 | 1640 |
return 2; |
1641 | 1641 |
} |
1642 | 1642 |
|
1643 |
static unsigned int dec_lsr_r(DisasContext *dc)
|
|
1643 |
static int dec_lsr_r(DisasContext *dc) |
|
1644 | 1644 |
{ |
1645 | 1645 |
TCGv t[2]; |
1646 | 1646 |
int size = memsize_zz(dc); |
... | ... | |
1657 | 1657 |
return 2; |
1658 | 1658 |
} |
1659 | 1659 |
|
1660 |
static unsigned int dec_asr_r(DisasContext *dc)
|
|
1660 |
static int dec_asr_r(DisasContext *dc) |
|
1661 | 1661 |
{ |
1662 | 1662 |
TCGv t[2]; |
1663 | 1663 |
int size = memsize_zz(dc); |
... | ... | |
1674 | 1674 |
return 2; |
1675 | 1675 |
} |
1676 | 1676 |
|
1677 |
static unsigned int dec_muls_r(DisasContext *dc)
|
|
1677 |
static int dec_muls_r(DisasContext *dc) |
|
1678 | 1678 |
{ |
1679 | 1679 |
TCGv t[2]; |
1680 | 1680 |
int size = memsize_zz(dc); |
... | ... | |
1690 | 1690 |
return 2; |
1691 | 1691 |
} |
1692 | 1692 |
|
1693 |
static unsigned int dec_mulu_r(DisasContext *dc)
|
|
1693 |
static int dec_mulu_r(DisasContext *dc) |
|
1694 | 1694 |
{ |
1695 | 1695 |
TCGv t[2]; |
1696 | 1696 |
int size = memsize_zz(dc); |
... | ... | |
1707 | 1707 |
} |
1708 | 1708 |
|
1709 | 1709 |
|
1710 |
static unsigned int dec_dstep_r(DisasContext *dc)
|
|
1710 |
static int dec_dstep_r(DisasContext *dc) |
|
1711 | 1711 |
{ |
1712 | 1712 |
LOG_DIS("dstep $r%u, $r%u\n", dc->op1, dc->op2); |
1713 | 1713 |
cris_cc_mask(dc, CC_MASK_NZ); |
... | ... | |
1716 | 1716 |
return 2; |
1717 | 1717 |
} |
1718 | 1718 |
|
1719 |
static unsigned int dec_xor_r(DisasContext *dc)
|
|
1719 |
static int dec_xor_r(DisasContext *dc) |
|
1720 | 1720 |
{ |
1721 | 1721 |
TCGv t[2]; |
1722 | 1722 |
int size = memsize_zz(dc); |
... | ... | |
1732 | 1732 |
return 2; |
1733 | 1733 |
} |
1734 | 1734 |
|
1735 |
static unsigned int dec_bound_r(DisasContext *dc)
|
|
1735 |
static int dec_bound_r(DisasContext *dc) |
|
1736 | 1736 |
{ |
1737 | 1737 |
TCGv l0; |
1738 | 1738 |
int size = memsize_zz(dc); |
... | ... | |
1746 | 1746 |
return 2; |
1747 | 1747 |
} |
1748 | 1748 |
|
1749 |
static unsigned int dec_cmp_r(DisasContext *dc)
|
|
1749 |
static int dec_cmp_r(DisasContext *dc) |
|
1750 | 1750 |
{ |
1751 | 1751 |
TCGv t[2]; |
1752 | 1752 |
int size = memsize_zz(dc); |
... | ... | |
1761 | 1761 |
return 2; |
1762 | 1762 |
} |
1763 | 1763 |
|
1764 |
static unsigned int dec_abs_r(DisasContext *dc)
|
|
1764 |
static int dec_abs_r(DisasContext *dc) |
|
1765 | 1765 |
{ |
1766 | 1766 |
TCGv t0; |
1767 | 1767 |
|
... | ... | |
1780 | 1780 |
return 2; |
1781 | 1781 |
} |
1782 | 1782 |
|
1783 |
static unsigned int dec_add_r(DisasContext *dc)
|
|
1783 |
static int dec_add_r(DisasContext *dc) |
|
1784 | 1784 |
{ |
1785 | 1785 |
TCGv t[2]; |
1786 | 1786 |
int size = memsize_zz(dc); |
... | ... | |
1795 | 1795 |
return 2; |
1796 | 1796 |
} |
1797 | 1797 |
|
1798 |
static unsigned int dec_addc_r(DisasContext *dc)
|
|
1798 |
static int dec_addc_r(DisasContext *dc) |
|
1799 | 1799 |
{ |
1800 | 1800 |
LOG_DIS("addc $r%u, $r%u\n", |
1801 | 1801 |
dc->op1, dc->op2); |
... | ... | |
1810 | 1810 |
return 2; |
1811 | 1811 |
} |
1812 | 1812 |
|
1813 |
static unsigned int dec_mcp_r(DisasContext *dc)
|
|
1813 |
static int dec_mcp_r(DisasContext *dc) |
|
1814 | 1814 |
{ |
1815 | 1815 |
LOG_DIS("mcp $p%u, $r%u\n", |
1816 | 1816 |
dc->op2, dc->op1); |
... | ... | |
1837 | 1837 |
} |
1838 | 1838 |
#endif |
1839 | 1839 |
|
1840 |
static unsigned int dec_swap_r(DisasContext *dc)
|
|
1840 |
static int dec_swap_r(DisasContext *dc) |
|
1841 | 1841 |
{ |
1842 | 1842 |
TCGv t0; |
1843 | 1843 |
#if DISAS_CRIS |
... | ... | |
1863 | 1863 |
return 2; |
1864 | 1864 |
} |
1865 | 1865 |
|
1866 |
static unsigned int dec_or_r(DisasContext *dc)
|
|
1866 |
static int dec_or_r(DisasContext *dc) |
|
1867 | 1867 |
{ |
1868 | 1868 |
TCGv t[2]; |
1869 | 1869 |
int size = memsize_zz(dc); |
... | ... | |
1877 | 1877 |
return 2; |
1878 | 1878 |
} |
1879 | 1879 |
|
1880 |
static unsigned int dec_addi_r(DisasContext *dc)
|
|
1880 |
static int dec_addi_r(DisasContext *dc) |
|
1881 | 1881 |
{ |
1882 | 1882 |
TCGv t0; |
1883 | 1883 |
LOG_DIS("addi.%c $r%u, $r%u\n", |
... | ... | |
1890 | 1890 |
return 2; |
1891 | 1891 |
} |
1892 | 1892 |
|
1893 |
static unsigned int dec_addi_acr(DisasContext *dc)
|
|
1893 |
static int dec_addi_acr(DisasContext *dc) |
|
1894 | 1894 |
{ |
1895 | 1895 |
TCGv t0; |
1896 | 1896 |
LOG_DIS("addi.%c $r%u, $r%u, $acr\n", |
... | ... | |
1903 | 1903 |
return 2; |
1904 | 1904 |
} |
1905 | 1905 |
|
1906 |
static unsigned int dec_neg_r(DisasContext *dc)
|
|
1906 |
static int dec_neg_r(DisasContext *dc) |
|
1907 | 1907 |
{ |
1908 | 1908 |
TCGv t[2]; |
1909 | 1909 |
int size = memsize_zz(dc); |
... | ... | |
1918 | 1918 |
return 2; |
1919 | 1919 |
} |
1920 | 1920 |
|
1921 |
static unsigned int dec_btst_r(DisasContext *dc)
|
|
1921 |
static int dec_btst_r(DisasContext *dc) |
|
1922 | 1922 |
{ |
1923 | 1923 |
LOG_DIS("btst $r%u, $r%u\n", |
1924 | 1924 |
dc->op1, dc->op2); |
... | ... | |
1933 | 1933 |
return 2; |
1934 | 1934 |
} |
1935 | 1935 |
|
1936 |
static unsigned int dec_sub_r(DisasContext *dc)
|
|
1936 |
static int dec_sub_r(DisasContext *dc) |
|
1937 | 1937 |
{ |
1938 | 1938 |
TCGv t[2]; |
1939 | 1939 |
int size = memsize_zz(dc); |
... | ... | |
1948 | 1948 |
} |
1949 | 1949 |
|
1950 | 1950 |
/* Zero extension. From size to dword. */ |
1951 |
static unsigned int dec_movu_r(DisasContext *dc)
|
|
1951 |
static int dec_movu_r(DisasContext *dc) |
|
1952 | 1952 |
{ |
1953 | 1953 |
TCGv t0; |
1954 | 1954 |
int size = memsize_z(dc); |
... | ... | |
1965 | 1965 |
} |
1966 | 1966 |
|
1967 | 1967 |
/* Sign extension. From size to dword. */ |
1968 |
static unsigned int dec_movs_r(DisasContext *dc)
|
|
1968 |
static int dec_movs_r(DisasContext *dc) |
|
1969 | 1969 |
{ |
1970 | 1970 |
TCGv t0; |
1971 | 1971 |
int size = memsize_z(dc); |
... | ... | |
1984 | 1984 |
} |
1985 | 1985 |
|
1986 | 1986 |
/* zero extension. From size to dword. */ |
1987 |
static unsigned int dec_addu_r(DisasContext *dc)
|
|
1987 |
static int dec_addu_r(DisasContext *dc) |
|
1988 | 1988 |
{ |
1989 | 1989 |
TCGv t0; |
1990 | 1990 |
int size = memsize_z(dc); |
... | ... | |
2003 | 2003 |
} |
2004 | 2004 |
|
2005 | 2005 |
/* Sign extension. From size to dword. */ |
2006 |
static unsigned int dec_adds_r(DisasContext *dc)
|
|
2006 |
static int dec_adds_r(DisasContext *dc) |
|
2007 | 2007 |
{ |
2008 | 2008 |
TCGv t0; |
2009 | 2009 |
int size = memsize_z(dc); |
... | ... | |
2022 | 2022 |
} |
2023 | 2023 |
|
2024 | 2024 |
/* Zero extension. From size to dword. */ |
2025 |
static unsigned int dec_subu_r(DisasContext *dc)
|
|
2025 |
static int dec_subu_r(DisasContext *dc) |
|
2026 | 2026 |
{ |
2027 | 2027 |
TCGv t0; |
2028 | 2028 |
int size = memsize_z(dc); |
... | ... | |
2041 | 2041 |
} |
2042 | 2042 |
|
2043 | 2043 |
/* Sign extension. From size to dword. */ |
2044 |
static unsigned int dec_subs_r(DisasContext *dc)
|
|
2044 |
static int dec_subs_r(DisasContext *dc) |
|
2045 | 2045 |
{ |
2046 | 2046 |
TCGv t0; |
2047 | 2047 |
int size = memsize_z(dc); |
... | ... | |
2059 | 2059 |
return 2; |
2060 | 2060 |
} |
2061 | 2061 |
|
2062 |
static unsigned int dec_setclrf(DisasContext *dc)
|
|
2062 |
static int dec_setclrf(DisasContext *dc) |
|
2063 | 2063 |
{ |
2064 | 2064 |
uint32_t flags; |
2065 | 2065 |
int set = (~dc->opcode >> 2) & 1; |
... | ... | |
2130 | 2130 |
return 2; |
2131 | 2131 |
} |
2132 | 2132 |
|
2133 |
static unsigned int dec_move_rs(DisasContext *dc)
|
|
2133 |
static int dec_move_rs(DisasContext *dc) |
|
2134 | 2134 |
{ |
2135 | 2135 |
LOG_DIS("move $r%u, $s%u\n", dc->op1, dc->op2); |
2136 | 2136 |
cris_cc_mask(dc, 0); |
2137 | 2137 |
gen_helper_movl_sreg_reg(tcg_const_tl(dc->op2), tcg_const_tl(dc->op1)); |
2138 | 2138 |
return 2; |
2139 | 2139 |
} |
2140 |
static unsigned int dec_move_sr(DisasContext *dc)
|
|
2140 |
static int dec_move_sr(DisasContext *dc) |
|
2141 | 2141 |
{ |
2142 | 2142 |
LOG_DIS("move $s%u, $r%u\n", dc->op2, dc->op1); |
2143 | 2143 |
cris_cc_mask(dc, 0); |
... | ... | |
2145 | 2145 |
return 2; |
2146 | 2146 |
} |
2147 | 2147 |
|
2148 |
static unsigned int dec_move_rp(DisasContext *dc)
|
|
2148 |
static int dec_move_rp(DisasContext *dc) |
|
2149 | 2149 |
{ |
2150 | 2150 |
TCGv t[2]; |
2151 | 2151 |
LOG_DIS("move $r%u, $p%u\n", dc->op1, dc->op2); |
... | ... | |
2175 | 2175 |
tcg_temp_free(t[0]); |
2176 | 2176 |
return 2; |
2177 | 2177 |
} |
2178 |
static unsigned int dec_move_pr(DisasContext *dc)
|
|
2178 |
static int dec_move_pr(DisasContext *dc) |
|
2179 | 2179 |
{ |
2180 | 2180 |
TCGv t0; |
2181 | 2181 |
LOG_DIS("move $p%u, $r%u\n", dc->op2, dc->op1); |
... | ... | |
2197 | 2197 |
return 2; |
2198 | 2198 |
} |
2199 | 2199 |
|
2200 |
static unsigned int dec_move_mr(DisasContext *dc)
|
|
2200 |
static int dec_move_mr(DisasContext *dc) |
|
2201 | 2201 |
{ |
2202 | 2202 |
int memsize = memsize_zz(dc); |
2203 | 2203 |
int insn_len; |
... | ... | |
2239 | 2239 |
tcg_temp_free(t[1]); |
2240 | 2240 |
} |
2241 | 2241 |
|
2242 |
static unsigned int dec_movs_m(DisasContext *dc)
|
|
2242 |
static int dec_movs_m(DisasContext *dc) |
|
2243 | 2243 |
{ |
2244 | 2244 |
TCGv t[2]; |
2245 | 2245 |
int memsize = memsize_z(dc); |
... | ... | |
2260 | 2260 |
return insn_len; |
2261 | 2261 |
} |
2262 | 2262 |
|
2263 |
static unsigned int dec_addu_m(DisasContext *dc)
|
|
2263 |
static int dec_addu_m(DisasContext *dc) |
|
2264 | 2264 |
{ |
2265 | 2265 |
TCGv t[2]; |
2266 | 2266 |
int memsize = memsize_z(dc); |
... | ... | |
2281 | 2281 |
return insn_len; |
2282 | 2282 |
} |
2283 | 2283 |
|
2284 |
static unsigned int dec_adds_m(DisasContext *dc)
|
|
2284 |
static int dec_adds_m(DisasContext *dc) |
|
2285 | 2285 |
{ |
2286 | 2286 |
TCGv t[2]; |
2287 | 2287 |
int memsize = memsize_z(dc); |
... | ... | |
2301 | 2301 |
return insn_len; |
2302 | 2302 |
} |
2303 | 2303 |
|
2304 |
static unsigned int dec_subu_m(DisasContext *dc)
|
|
2304 |
static int dec_subu_m(DisasContext *dc) |
|
2305 | 2305 |
{ |
2306 | 2306 |
TCGv t[2]; |
2307 | 2307 |
int memsize = memsize_z(dc); |
... | ... | |
2321 | 2321 |
return insn_len; |
2322 | 2322 |
} |
2323 | 2323 |
|
2324 |
static unsigned int dec_subs_m(DisasContext *dc)
|
|
2324 |
static int dec_subs_m(DisasContext *dc) |
|
2325 | 2325 |
{ |
2326 | 2326 |
TCGv t[2]; |
2327 | 2327 |
int memsize = memsize_z(dc); |
... | ... | |
2341 | 2341 |
return insn_len; |
2342 | 2342 |
} |
2343 | 2343 |
|
2344 |
static unsigned int dec_movu_m(DisasContext *dc)
|
|
2344 |
static int dec_movu_m(DisasContext *dc) |
|
2345 | 2345 |
{ |
2346 | 2346 |
TCGv t[2]; |
2347 | 2347 |
int memsize = memsize_z(dc); |
... | ... | |
2361 | 2361 |
return insn_len; |
2362 | 2362 |
} |
2363 | 2363 |
|
2364 |
static unsigned int dec_cmpu_m(DisasContext *dc)
|
|
2364 |
static int dec_cmpu_m(DisasContext *dc) |
|
2365 | 2365 |
{ |
2366 | 2366 |
TCGv t[2]; |
2367 | 2367 |
int memsize = memsize_z(dc); |
... | ... | |
2380 | 2380 |
return insn_len; |
2381 | 2381 |
} |
2382 | 2382 |
|
2383 |
static unsigned int dec_cmps_m(DisasContext *dc)
|
|
2383 |
static int dec_cmps_m(DisasContext *dc) |
|
2384 | 2384 |
{ |
2385 | 2385 |
TCGv t[2]; |
2386 | 2386 |
int memsize = memsize_z(dc); |
... | ... | |
2401 | 2401 |
return insn_len; |
2402 | 2402 |
} |
2403 | 2403 |
|
2404 |
static unsigned int dec_cmp_m(DisasContext *dc)
|
|
2404 |
static int dec_cmp_m(DisasContext *dc) |
|
2405 | 2405 |
{ |
2406 | 2406 |
TCGv t[2]; |
2407 | 2407 |
int memsize = memsize_zz(dc); |
... | ... | |
2422 | 2422 |
return insn_len; |
2423 | 2423 |
} |
2424 | 2424 |
|
2425 |
static unsigned int dec_test_m(DisasContext *dc)
|
|
2425 |
static int dec_test_m(DisasContext *dc) |
|
2426 | 2426 |
{ |
2427 | 2427 |
TCGv t[2]; |
2428 | 2428 |
int memsize = memsize_zz(dc); |
... | ... | |
2446 | 2446 |
return insn_len; |
2447 | 2447 |
} |
2448 | 2448 |
|
2449 |
static unsigned int dec_and_m(DisasContext *dc)
|
|
2449 |
static int dec_and_m(DisasContext *dc) |
|
2450 | 2450 |
{ |
2451 | 2451 |
TCGv t[2]; |
2452 | 2452 |
int memsize = memsize_zz(dc); |
... | ... | |
2465 | 2465 |
return insn_len; |
2466 | 2466 |
} |
2467 | 2467 |
|
2468 |
static unsigned int dec_add_m(DisasContext *dc)
|
|
2468 |
static int dec_add_m(DisasContext *dc) |
|
2469 | 2469 |
{ |
2470 | 2470 |
TCGv t[2]; |
2471 | 2471 |
int memsize = memsize_zz(dc); |
... | ... | |
2485 | 2485 |
return insn_len; |
2486 | 2486 |
} |
2487 | 2487 |
|
2488 |
static unsigned int dec_addo_m(DisasContext *dc)
|
|
2488 |
static int dec_addo_m(DisasContext *dc) |
|
2489 | 2489 |
{ |
2490 | 2490 |
TCGv t[2]; |
2491 | 2491 |
int memsize = memsize_zz(dc); |
... | ... | |
2504 | 2504 |
return insn_len; |
2505 | 2505 |
} |
2506 | 2506 |
|
2507 |
static unsigned int dec_bound_m(DisasContext *dc)
|
|
2507 |
static int dec_bound_m(DisasContext *dc) |
|
2508 | 2508 |
{ |
2509 | 2509 |
TCGv l[2]; |
2510 | 2510 |
int memsize = memsize_zz(dc); |
... | ... | |
2525 | 2525 |
return insn_len; |
2526 | 2526 |
} |
2527 | 2527 |
|
2528 |
static unsigned int dec_addc_mr(DisasContext *dc)
|
|
2528 |
static int dec_addc_mr(DisasContext *dc) |
|
2529 | 2529 |
{ |
2530 | 2530 |
TCGv t[2]; |
2531 | 2531 |
int insn_len = 2; |
... | ... | |
2548 | 2548 |
return insn_len; |
2549 | 2549 |
} |
2550 | 2550 |
|
2551 |
static unsigned int dec_sub_m(DisasContext *dc)
|
|
2551 |
static int dec_sub_m(DisasContext *dc) |
|
2552 | 2552 |
{ |
2553 | 2553 |
TCGv t[2]; |
2554 | 2554 |
int memsize = memsize_zz(dc); |
... | ... | |
2567 | 2567 |
return insn_len; |
2568 | 2568 |
} |
2569 | 2569 |
|
2570 |
static unsigned int dec_or_m(DisasContext *dc)
|
|
2570 |
static int dec_or_m(DisasContext *dc) |
|
2571 | 2571 |
{ |
2572 | 2572 |
TCGv t[2]; |
2573 | 2573 |
int memsize = memsize_zz(dc); |
... | ... | |
2587 | 2587 |
return insn_len; |
2588 | 2588 |
} |
2589 | 2589 |
|
2590 |
static unsigned int dec_move_mp(DisasContext *dc)
|
|
2590 |
static int dec_move_mp(DisasContext *dc) |
|
2591 | 2591 |
{ |
2592 | 2592 |
TCGv t[2]; |
2593 | 2593 |
int memsize = memsize_zz(dc); |
... | ... | |
2619 | 2619 |
return insn_len; |
2620 | 2620 |
} |
2621 | 2621 |
|
2622 |
static unsigned int dec_move_pm(DisasContext *dc)
|
|
2622 |
static int dec_move_pm(DisasContext *dc) |
|
2623 | 2623 |
{ |
2624 | 2624 |
TCGv t0; |
2625 | 2625 |
int memsize; |
... | ... | |
2645 | 2645 |
return 2; |
2646 | 2646 |
} |
2647 | 2647 |
|
2648 |
static unsigned int dec_movem_mr(DisasContext *dc)
|
|
2648 |
static int dec_movem_mr(DisasContext *dc) |
|
2649 | 2649 |
{ |
2650 | 2650 |
TCGv_i64 tmp[16]; |
2651 | 2651 |
TCGv tmp32; |
... | ... | |
2692 | 2692 |
return 2; |
2693 | 2693 |
} |
2694 | 2694 |
|
2695 |
static unsigned int dec_movem_rm(DisasContext *dc)
|
|
2695 |
static int dec_movem_rm(DisasContext *dc) |
|
2696 | 2696 |
{ |
2697 | 2697 |
TCGv tmp; |
2698 | 2698 |
TCGv addr; |
... | ... | |
2721 | 2721 |
return 2; |
2722 | 2722 |
} |
2723 | 2723 |
|
2724 |
static unsigned int dec_move_rm(DisasContext *dc)
|
|
2724 |
static int dec_move_rm(DisasContext *dc) |
|
2725 | 2725 |
{ |
2726 | 2726 |
int memsize; |
2727 | 2727 |
|
... | ... | |
2740 | 2740 |
return 2; |
2741 | 2741 |
} |
2742 | 2742 |
|
2743 |
static unsigned int dec_lapcq(DisasContext *dc)
|
|
2743 |
static int dec_lapcq(DisasContext *dc) |
|
2744 | 2744 |
{ |
2745 | 2745 |
LOG_DIS("lapcq %x, $r%u\n", |
2746 | 2746 |
dc->pc + dc->op1*2, dc->op2); |
... | ... | |
2749 | 2749 |
return 2; |
2750 | 2750 |
} |
2751 | 2751 |
|
2752 |
static unsigned int dec_lapc_im(DisasContext *dc)
|
|
2752 |
static int dec_lapc_im(DisasContext *dc) |
|
2753 | 2753 |
{ |
2754 | 2754 |
unsigned int rd; |
2755 | 2755 |
int32_t imm; |
... | ... | |
2768 | 2768 |
} |
2769 | 2769 |
|
2770 | 2770 |
/* Jump to special reg. */ |
2771 |
static unsigned int dec_jump_p(DisasContext *dc)
|
|
2771 |
static int dec_jump_p(DisasContext *dc) |
|
2772 | 2772 |
{ |
2773 | 2773 |
LOG_DIS("jump $p%u\n", dc->op2); |
2774 | 2774 |
|
... | ... | |
2783 | 2783 |
} |
2784 | 2784 |
|
2785 | 2785 |
/* Jump and save. */ |
2786 |
static unsigned int dec_jas_r(DisasContext *dc)
|
|
2786 |
static int dec_jas_r(DisasContext *dc) |
|
2787 | 2787 |
{ |
2788 | 2788 |
LOG_DIS("jas $r%u, $p%u\n", dc->op1, dc->op2); |
2789 | 2789 |
cris_cc_mask(dc, 0); |
... | ... | |
2797 | 2797 |
return 2; |
2798 | 2798 |
} |
2799 | 2799 |
|
2800 |
static unsigned int dec_jas_im(DisasContext *dc)
|
|
2800 |
static int dec_jas_im(DisasContext *dc) |
|
2801 | 2801 |
{ |
2802 | 2802 |
uint32_t imm; |
2803 | 2803 |
|
... | ... | |
2813 | 2813 |
return 6; |
2814 | 2814 |
} |
2815 | 2815 |
|
2816 |
static unsigned int dec_jasc_im(DisasContext *dc)
|
|
2816 |
static int dec_jasc_im(DisasContext *dc) |
|
2817 | 2817 |
{ |
2818 | 2818 |
uint32_t imm; |
2819 | 2819 |
|
... | ... | |
2829 | 2829 |
return 6; |
2830 | 2830 |
} |
2831 | 2831 |
|
2832 |
static unsigned int dec_jasc_r(DisasContext *dc)
|
|
2832 |
static int dec_jasc_r(DisasContext *dc) |
|
2833 | 2833 |
{ |
2834 | 2834 |
LOG_DIS("jasc_r $r%u, $p%u\n", dc->op1, dc->op2); |
2835 | 2835 |
cris_cc_mask(dc, 0); |
... | ... | |
2840 | 2840 |
return 2; |
2841 | 2841 |
} |
2842 | 2842 |
|
2843 |
static unsigned int dec_bcc_im(DisasContext *dc)
|
|
2843 |
static int dec_bcc_im(DisasContext *dc) |
|
2844 | 2844 |
{ |
2845 | 2845 |
int32_t offset; |
2846 | 2846 |
uint32_t cond = dc->op2; |
... | ... | |
2857 | 2857 |
return 4; |
2858 | 2858 |
} |
2859 | 2859 |
|
2860 |
static unsigned int dec_bas_im(DisasContext *dc)
|
|
2860 |
static int dec_bas_im(DisasContext *dc) |
|
2861 | 2861 |
{ |
2862 | 2862 |
int32_t simm; |
2863 | 2863 |
|
... | ... | |
2874 | 2874 |
return 6; |
2875 | 2875 |
} |
2876 | 2876 |
|
2877 |
static unsigned int dec_basc_im(DisasContext *dc)
|
|
2877 |
static int dec_basc_im(DisasContext *dc) |
|
2878 | 2878 |
{ |
2879 | 2879 |
int32_t simm; |
2880 | 2880 |
simm = ldl_code(dc->pc + 2); |
... | ... | |
2889 | 2889 |
return 6; |
2890 | 2890 |
} |
2891 | 2891 |
|
2892 |
static unsigned int dec_rfe_etc(DisasContext *dc)
|
|
2892 |
static int dec_rfe_etc(DisasContext *dc) |
|
2893 | 2893 |
{ |
2894 | 2894 |
cris_cc_mask(dc, 0); |
2895 | 2895 |
|
... | ... | |
2936 | 2936 |
return 2; |
2937 | 2937 |
} |
2938 | 2938 |
|
2939 |
static unsigned int dec_ftag_fidx_d_m(DisasContext *dc)
|
|
2939 |
static int dec_ftag_fidx_d_m(DisasContext *dc) |
|
2940 | 2940 |
{ |
2941 | 2941 |
return 2; |
2942 | 2942 |
} |
2943 | 2943 |
|
2944 |
static unsigned int dec_ftag_fidx_i_m(DisasContext *dc)
|
|
2944 |
static int dec_ftag_fidx_i_m(DisasContext *dc) |
|
2945 | 2945 |
{ |
2946 | 2946 |
return 2; |
2947 | 2947 |
} |
2948 | 2948 |
|
2949 |
static unsigned int dec_null(DisasContext *dc)
|
|
2949 |
static int dec_null(DisasContext *dc) |
|
2950 | 2950 |
{ |
2951 | 2951 |
printf ("unknown insn pc=%x opc=%x op1=%x op2=%x\n", |
2952 | 2952 |
dc->pc, dc->opcode, dc->op1, dc->op2); |
... | ... | |
2960 | 2960 |
uint32_t bits; |
2961 | 2961 |
uint32_t mask; |
2962 | 2962 |
}; |
2963 |
unsigned int (*dec)(DisasContext *dc);
|
|
2963 |
int (*dec)(DisasContext *dc); |
|
2964 | 2964 |
} decinfo[] = { |
2965 | 2965 |
/* Order matters here. */ |
2966 | 2966 |
{DEC_MOVEQ, dec_moveq}, |
... | ... | |
3068 | 3068 |
|
3069 | 3069 |
static unsigned int crisv32_decoder(DisasContext *dc) |
3070 | 3070 |
{ |
3071 |
unsigned int insn_len = 2;
|
|
3071 |
int insn_len = 2; |
|
3072 | 3072 |
int i; |
3073 | 3073 |
|
3074 | 3074 |
if (unlikely(qemu_loglevel_mask(CPU_LOG_TB_OP))) |
Also available in: Unified diff