trunk/src/emu/cpu/arcompact/arcompact_execute.c
| r242582 | r242583 | |
| 129 | 129 | #define PC_ALIGNED32 \ |
| 130 | 130 | (m_pc&0xfffffffc) |
| 131 | 131 | |
| 132 | int arcompact_device::check_condition(UINT8 condition) |
| 133 | { |
| 134 | switch (condition & 0x1f) |
| 135 | { |
| 136 | case 0x00: return 1; // AL |
| 137 | case 0x01: return CONDITION_EQ; |
| 132 | 138 | |
| 139 | case 0x02: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 140 | case 0x03: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 141 | case 0x04: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 142 | case 0x05: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 143 | case 0x06: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 144 | case 0x07: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 145 | case 0x08: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 146 | case 0x09: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 147 | case 0x0a: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 148 | case 0x0b: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 149 | case 0x0c: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 150 | case 0x0d: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 151 | case 0x0e: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 152 | case 0x0f: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 153 | case 0x10: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 154 | case 0x11: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 155 | case 0x12: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 156 | case 0x13: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 157 | case 0x14: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 158 | case 0x15: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 159 | case 0x16: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 160 | case 0x17: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 161 | case 0x18: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 162 | case 0x19: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 163 | case 0x1a: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 164 | case 0x1b: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 165 | case 0x1c: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 166 | case 0x1d: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 167 | case 0x1e: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 168 | case 0x1f: fatalerror("unhandled condition check %s", conditions[condition]); return -1; |
| 169 | } |
| 170 | |
| 171 | return -1; |
| 172 | |
| 173 | } |
| 174 | |
| 175 | |
| 133 | 176 | ARCOMPACT_RETTYPE arcompact_device::get_insruction(OPS_32) |
| 134 | 177 | { |
| 135 | 178 | UINT8 instruction = ARCOMPACT_OPERATION; |
| r242582 | r242583 | |
| 1883 | 1926 | } |
| 1884 | 1927 | |
| 1885 | 1928 | |
| 1886 | | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_20_p11_m0(OPS_32) |
| 1929 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_20_p11_m0(OPS_32) // Jcc (no link, no delay) |
| 1887 | 1930 | { |
| 1888 | 1931 | int size = 4; |
| 1889 | | // UINT32 limm = 0; |
| 1932 | UINT32 limm = 0; |
| 1890 | 1933 | int got_limm = 0; |
| 1891 | 1934 | |
| 1892 | 1935 | COMMON32_GET_creg |
| 1936 | COMMON32_GET_CONDITION; |
| 1937 | COMMON32_GET_F |
| 1893 | 1938 | |
| 1939 | UINT32 c = 0; |
| 1940 | |
| 1894 | 1941 | if (creg == LIMM_REG) |
| 1895 | 1942 | { |
| 1896 | 1943 | // opcode iiii i--- ppII IIII F--- cccc ccmq qqqq |
| 1897 | 1944 | // Jcc limm 0010 0RRR 1110 0000 0RRR 1111 100Q QQQQ [LIUMM] |
| 1898 | 1945 | if (!got_limm) |
| 1899 | 1946 | { |
| 1900 | | //GET_LIMM_32; |
| 1947 | GET_LIMM_32; |
| 1901 | 1948 | size = 8; |
| 1902 | 1949 | } |
| 1903 | 1950 | |
| 1904 | | arcompact_log("unimplemented J %08x", op); |
| 1951 | c = limm; |
| 1952 | |
| 1905 | 1953 | } |
| 1906 | 1954 | else |
| 1907 | 1955 | { |
| 1908 | 1956 | // opcode iiii i--- ppII IIII F--- cccc ccmq qqqq |
| 1909 | 1957 | // Jcc [c] 0010 0RRR 1110 0000 0RRR CCCC CC0Q QQQQ |
| 1910 | 1958 | // no conditional links to ILINK1, ILINK2? |
| 1911 | | arcompact_log("unimplemented J %08x", op); |
| 1959 | |
| 1960 | c = m_regs[creg]; |
| 1912 | 1961 | } |
| 1962 | |
| 1963 | if (!check_condition(condition)) |
| 1964 | return m_pc + (size>>0); |
| 1965 | |
| 1966 | if (!F) |
| 1967 | { |
| 1968 | // if F isn't set then the destination can't be ILINK1 or ILINK2 |
| 1969 | |
| 1970 | if ((creg == REG_ILINK1) || (creg == REG_ILINK1)) |
| 1971 | { |
| 1972 | arcompact_fatal ("fatal arcompact_handle04_20_p11_m0 J %08x (F not set but ILINK1 or ILINK2 used as dst)", op); |
| 1973 | } |
| 1974 | else |
| 1975 | { |
| 1976 | UINT32 realaddress = c; |
| 1977 | return realaddress; |
| 1978 | } |
| 1979 | } |
| 1980 | |
| 1981 | if (F) |
| 1982 | { |
| 1983 | // if F is set then the destination MUST be ILINK1 or ILINK2 |
| 1984 | |
| 1985 | if ((creg == REG_ILINK1) || (creg == REG_ILINK1)) |
| 1986 | { |
| 1987 | arcompact_log("unimplemented arcompact_handle04_20_p11_m0 J %08x (F set)", op); |
| 1988 | } |
| 1989 | else |
| 1990 | { |
| 1991 | arcompact_fatal ("fatal arcompact_handle04_20_p11_m0 J %08x (F set but not ILINK1 or ILINK2 used as dst)", op); |
| 1992 | |
| 1993 | } |
| 1994 | } |
| 1995 | |
| 1996 | |
| 1913 | 1997 | return m_pc + (size>>0); |
| 1914 | 1998 | } |
| 1915 | 1999 | |
| r242582 | r242583 | |
| 1918 | 2002 | // opcode iiii i--- ppII IIII F--- uuuu uumq qqqq |
| 1919 | 2003 | // Jcc u6 0010 0RRR 1110 0000 0RRR uuuu uu1Q QQQQ |
| 1920 | 2004 | int size = 4; |
| 1921 | | arcompact_log("unimplemented J %08x", op); |
| 2005 | arcompact_log("unimplemented arcompact_handle04_20_p11_m1 J %08x (u6)", op); |
| 1922 | 2006 | return m_pc + (size>>0); |
| 1923 | 2007 | } |
| 1924 | 2008 | |