trunk/src/emu/cpu/i386/i386ops.h
| r244994 | r244995 | |
| 329 | 329 | { 0x32, OP_2BYTE|OP_PENTIUM, &i386_device::pentium_rdmsr, &i386_device::pentium_rdmsr, false}, |
| 330 | 330 | { 0x38, OP_2BYTE|OP_PENTIUM, &i386_device::i386_decode_three_byte38, &i386_device::i386_decode_three_byte38,false}, |
| 331 | 331 | { 0x3A, OP_2BYTE|OP_PENTIUM, &i386_device::i386_decode_three_byte3a, &i386_device::i386_decode_three_byte3a,false}, |
| 332 | { 0x3A, OP_2BYTE|OP_CYRIX, &i386_device::i386_cyrix_special, &i386_device::i386_cyrix_special, false}, |
| 333 | { 0x3B, OP_2BYTE|OP_CYRIX, &i386_device::i386_cyrix_special, &i386_device::i386_cyrix_special, false}, |
| 334 | { 0x3C, OP_2BYTE|OP_CYRIX, &i386_device::i386_cyrix_special, &i386_device::i386_cyrix_special, false}, |
| 335 | { 0x3D, OP_2BYTE|OP_CYRIX, &i386_device::i386_cyrix_special, &i386_device::i386_cyrix_special, false}, |
| 332 | 336 | { 0x40, OP_2BYTE|OP_PENTIUM, &i386_device::pentium_cmovo_r16_rm16, &i386_device::pentium_cmovo_r32_rm32, false}, |
| 333 | 337 | { 0x41, OP_2BYTE|OP_PENTIUM, &i386_device::pentium_cmovno_r16_rm16, &i386_device::pentium_cmovno_r32_rm32, false}, |
| 334 | 338 | { 0x42, OP_2BYTE|OP_PENTIUM, &i386_device::pentium_cmovb_r16_rm16, &i386_device::pentium_cmovb_r32_rm32, false}, |
| r244994 | r244995 | |
| 384 | 388 | { 0x75, OP_2BYTE|OP_MMX, &i386_device::mmx_pcmpeqw_r64_rm64, &i386_device::mmx_pcmpeqw_r64_rm64, false}, |
| 385 | 389 | { 0x76, OP_2BYTE|OP_MMX, &i386_device::mmx_pcmpeqd_r64_rm64, &i386_device::mmx_pcmpeqd_r64_rm64, false}, |
| 386 | 390 | { 0x77, OP_2BYTE|OP_MMX, &i386_device::mmx_emms, &i386_device::mmx_emms, false}, |
| 391 | { 0x78, OP_2BYTE|OP_CYRIX, &i386_device::i386_cyrix_svdc, &i386_device::i386_cyrix_svdc, false}, |
| 392 | { 0x79, OP_2BYTE|OP_CYRIX, &i386_device::i386_cyrix_rsdc, &i386_device::i386_cyrix_rsdc, false}, |
| 393 | { 0x7a, OP_2BYTE|OP_CYRIX, &i386_device::i386_cyrix_svldt, &i386_device::i386_cyrix_svldt, false}, |
| 394 | { 0x7b, OP_2BYTE|OP_CYRIX, &i386_device::i386_cyrix_rsldt, &i386_device::i386_cyrix_rsldt, false}, |
| 395 | { 0x7c, OP_2BYTE|OP_CYRIX, &i386_device::i386_cyrix_svts, &i386_device::i386_cyrix_svts, false}, |
| 396 | { 0x7d, OP_2BYTE|OP_CYRIX, &i386_device::i386_cyrix_rsts, &i386_device::i386_cyrix_rsts, false}, |
| 387 | 397 | { 0x7e, OP_2BYTE|OP_MMX, &i386_device::mmx_movd_rm32_r64, &i386_device::mmx_movd_rm32_r64, false}, |
| 388 | 398 | { 0x7f, OP_2BYTE|OP_MMX, &i386_device::mmx_movq_rm64_r64, &i386_device::mmx_movq_rm64_r64, false}, |
| 389 | 399 | { 0x80, OP_2BYTE|OP_I386, &i386_device::i386_jo_rel16, &i386_device::i386_jo_rel32, false}, |
trunk/src/emu/cpu/i386/pentops.inc
| r244994 | r244995 | |
| 1062 | 1062 | } |
| 1063 | 1063 | } |
| 1064 | 1064 | |
| 1065 | void i386_device::i386_cyrix_special() // Opcode 0x0f 3a-3d |
| 1066 | { |
| 1067 | /* |
| 1068 | 0f 3a BB0_RESET (set BB0 pointer = base) |
| 1069 | 0f 3b BB1_RESET (set BB1 pointer = base) |
| 1070 | 0f 3c CPU_WRITE (write special CPU memory-mapped register, [ebx] = eax) |
| 1071 | 0f 3d CPU_READ (read special CPU memory-mapped register, eax, = [ebx]) |
| 1072 | */ |
| 1073 | |
| 1074 | CYCLES(1); |
| 1075 | } |
| 1076 | |
| 1065 | 1077 | void i386_device::i386_cyrix_unknown() // Opcode 0x0f 74 |
| 1066 | 1078 | { |
| 1067 | 1079 | logerror("Unemulated 0x0f 0x74 opcode called\n"); |
| r244994 | r244995 | |
| 1970 | 1982 | CYCLES(1); // TODO: correct cycle count |
| 1971 | 1983 | } |
| 1972 | 1984 | |
| 1985 | void i386_device::i386_cyrix_svdc() // Opcode 0f 78 |
| 1986 | { |
| 1987 | UINT8 modrm = FETCH(); |
| 1988 | |
| 1989 | if( modrm < 0xc0 ) { |
| 1990 | UINT32 ea = GetEA(modrm,0); |
| 1991 | int index = (modrm >> 3) & 7; |
| 1992 | int limit; |
| 1993 | switch (index) |
| 1994 | { |
| 1995 | case 0: |
| 1996 | { |
| 1997 | index = ES; |
| 1998 | break; |
| 1999 | } |
| 2000 | |
| 2001 | case 2: |
| 2002 | { |
| 2003 | index = SS; |
| 2004 | break; |
| 2005 | } |
| 2006 | |
| 2007 | case 3: |
| 2008 | { |
| 2009 | index = DS; |
| 2010 | break; |
| 2011 | } |
| 2012 | |
| 2013 | case 4: |
| 2014 | { |
| 2015 | index = FS; |
| 2016 | break; |
| 2017 | } |
| 2018 | |
| 2019 | case 5: |
| 2020 | { |
| 2021 | index = GS; |
| 2022 | break; |
| 2023 | } |
| 2024 | |
| 2025 | default: |
| 2026 | { |
| 2027 | i386_trap(6, 0, 0); |
| 2028 | } |
| 2029 | } |
| 2030 | |
| 2031 | limit = m_sreg[index].limit; |
| 2032 | |
| 2033 | if (m_sreg[index].flags & 0x8000) //G bit |
| 2034 | { |
| 2035 | limit >>= 12; |
| 2036 | } |
| 2037 | |
| 2038 | WRITE16(ea + 0, limit); |
| 2039 | WRITE32(ea + 2, m_sreg[index].base); |
| 2040 | WRITE16(ea + 5, m_sreg[index].flags); //replace top 8 bits of base |
| 2041 | WRITE8(ea + 7, m_sreg[index].base >> 24); |
| 2042 | WRITE16(ea + 8, m_sreg[index].selector); |
| 2043 | } else { |
| 2044 | i386_trap(6, 0, 0); |
| 2045 | } |
| 2046 | CYCLES(1); // TODO: correct cycle count |
| 2047 | } |
| 2048 | |
| 2049 | void i386_device::i386_cyrix_rsdc() // Opcode 0f 79 |
| 2050 | { |
| 2051 | UINT8 modrm = FETCH(); |
| 2052 | |
| 2053 | if( modrm < 0xc0 ) { |
| 2054 | UINT32 ea = GetEA(modrm,0); |
| 2055 | int index = (modrm >> 3) & 7; |
| 2056 | UINT16 flags; |
| 2057 | UINT32 base; |
| 2058 | UINT32 limit; |
| 2059 | switch (index) |
| 2060 | { |
| 2061 | case 0: |
| 2062 | { |
| 2063 | index = ES; |
| 2064 | break; |
| 2065 | } |
| 2066 | |
| 2067 | case 2: |
| 2068 | { |
| 2069 | index = SS; |
| 2070 | break; |
| 2071 | } |
| 2072 | |
| 2073 | case 3: |
| 2074 | { |
| 2075 | index = DS; |
| 2076 | break; |
| 2077 | } |
| 2078 | |
| 2079 | case 4: |
| 2080 | { |
| 2081 | index = FS; |
| 2082 | break; |
| 2083 | } |
| 2084 | |
| 2085 | case 5: |
| 2086 | { |
| 2087 | index = GS; |
| 2088 | break; |
| 2089 | } |
| 2090 | |
| 2091 | default: |
| 2092 | { |
| 2093 | i386_trap(6, 0, 0); |
| 2094 | } |
| 2095 | } |
| 2096 | |
| 2097 | base = (READ32(ea + 2) & 0x00ffffff) | (READ8(ea + 7) << 24); |
| 2098 | flags = READ16(ea + 5); |
| 2099 | limit = READ16(ea + 0) | ((flags & 3) << 16); |
| 2100 | |
| 2101 | if (flags & 0x8000) //G bit |
| 2102 | { |
| 2103 | limit = (limit << 12) | 0xfff; |
| 2104 | } |
| 2105 | |
| 2106 | m_sreg[index].selector = READ16(ea + 8); |
| 2107 | m_sreg[index].flags = flags; |
| 2108 | m_sreg[index].base = base; |
| 2109 | m_sreg[index].limit = limit; |
| 2110 | } else { |
| 2111 | i386_trap(6, 0, 0); |
| 2112 | } |
| 2113 | CYCLES(1); // TODO: correct cycle count |
| 2114 | } |
| 2115 | |
| 2116 | void i386_device::i386_cyrix_svldt() // Opcode 0f 7a |
| 2117 | { |
| 2118 | if ( PROTECTED_MODE && !V8086_MODE ) |
| 2119 | { |
| 2120 | UINT8 modrm = FETCH(); |
| 2121 | |
| 2122 | if( !(modrm & 0xf8) ) { |
| 2123 | UINT32 ea = GetEA(modrm,0); |
| 2124 | UINT32 limit = m_ldtr.limit; |
| 2125 | |
| 2126 | if (m_ldtr.flags & 0x8000) //G bit |
| 2127 | { |
| 2128 | limit >>= 12; |
| 2129 | } |
| 2130 | |
| 2131 | WRITE16(ea + 0, limit); |
| 2132 | WRITE32(ea + 2, m_ldtr.base); |
| 2133 | WRITE16(ea + 5, m_ldtr.flags); //replace top 8 bits of base |
| 2134 | WRITE8(ea + 7, m_ldtr.base >> 24); |
| 2135 | WRITE16(ea + 8, m_ldtr.segment); |
| 2136 | } else { |
| 2137 | i386_trap(6, 0, 0); |
| 2138 | } |
| 2139 | } else { |
| 2140 | i386_trap(6, 0, 0); |
| 2141 | } |
| 2142 | CYCLES(1); // TODO: correct cycle count |
| 2143 | } |
| 2144 | |
| 2145 | void i386_device::i386_cyrix_rsldt() // Opcode 0f 7b |
| 2146 | { |
| 2147 | if ( PROTECTED_MODE && !V8086_MODE ) |
| 2148 | { |
| 2149 | if(m_CPL) |
| 2150 | FAULT(FAULT_GP,0) |
| 2151 | |
| 2152 | UINT8 modrm = FETCH(); |
| 2153 | |
| 2154 | if( !(modrm & 0xf8) ) { |
| 2155 | UINT32 ea = GetEA(modrm,0); |
| 2156 | UINT16 flags = READ16(ea + 5); |
| 2157 | UINT32 base = (READ32(ea + 2) | 0x00ffffff) | (READ8(ea + 7) << 24); |
| 2158 | UINT32 limit = READ16(ea + 0) | ((flags & 3) << 16); |
| 2159 | I386_SREG seg; |
| 2160 | |
| 2161 | if (flags & 0x8000) //G bit |
| 2162 | { |
| 2163 | limit = (limit << 12) | 0xfff; |
| 2164 | } |
| 2165 | |
| 2166 | memset(&seg, 0, sizeof(seg)); |
| 2167 | seg.selector = READ16(ea + 8); |
| 2168 | i386_load_protected_mode_segment(&seg,NULL); |
| 2169 | m_ldtr.limit = limit; |
| 2170 | m_ldtr.base = base; |
| 2171 | m_ldtr.flags = flags; |
| 2172 | } else { |
| 2173 | i386_trap(6, 0, 0); |
| 2174 | } |
| 2175 | } else { |
| 2176 | i386_trap(6, 0, 0); |
| 2177 | } |
| 2178 | CYCLES(1); // TODO: correct cycle count |
| 2179 | } |
| 2180 | |
| 2181 | void i386_device::i386_cyrix_svts() // Opcode 0f 7c |
| 2182 | { |
| 2183 | if ( PROTECTED_MODE ) |
| 2184 | { |
| 2185 | UINT8 modrm = FETCH(); |
| 2186 | |
| 2187 | if( !(modrm & 0xf8) ) { |
| 2188 | UINT32 ea = GetEA(modrm,0); |
| 2189 | UINT32 limit = m_task.limit; |
| 2190 | |
| 2191 | if (m_task.flags & 0x8000) //G bit |
| 2192 | { |
| 2193 | limit >>= 12; |
| 2194 | } |
| 2195 | |
| 2196 | WRITE16(ea + 0, limit); |
| 2197 | WRITE32(ea + 2, m_task.base); |
| 2198 | WRITE16(ea + 5, m_task.flags); //replace top 8 bits of base |
| 2199 | WRITE8(ea + 7, m_task.base >> 24); |
| 2200 | WRITE16(ea + 8, m_task.segment); |
| 2201 | } else { |
| 2202 | i386_trap(6, 0, 0); |
| 2203 | } |
| 2204 | } else { |
| 2205 | i386_trap(6, 0, 0); |
| 2206 | } |
| 2207 | } |
| 2208 | |
| 2209 | void i386_device::i386_cyrix_rsts() // Opcode 0f 7d |
| 2210 | { |
| 2211 | if ( PROTECTED_MODE ) |
| 2212 | { |
| 2213 | if(m_CPL) |
| 2214 | FAULT(FAULT_GP,0) |
| 2215 | |
| 2216 | UINT8 modrm = FETCH(); |
| 2217 | |
| 2218 | if( !(modrm & 0xf8) ) { |
| 2219 | UINT32 ea = GetEA(modrm,0); |
| 2220 | UINT16 flags = READ16(ea + 5); |
| 2221 | UINT32 base = (READ32(ea + 2) | 0x00ffffff) | (READ8(ea + 7) << 24); |
| 2222 | UINT32 limit = READ16(ea + 0) | ((flags & 3) << 16); |
| 2223 | |
| 2224 | if (flags & 0x8000) //G bit |
| 2225 | { |
| 2226 | limit = (limit << 12) | 0xfff; |
| 2227 | } |
| 2228 | m_task.segment = READ16(ea + 8); |
| 2229 | m_task.limit = limit; |
| 2230 | m_task.base = base; |
| 2231 | m_task.flags = flags; |
| 2232 | } else { |
| 2233 | i386_trap(6, 0, 0); |
| 2234 | } |
| 2235 | } else { |
| 2236 | i386_trap(6, 0, 0); |
| 2237 | } |
| 2238 | CYCLES(1); // TODO: correct cycle count |
| 2239 | } |
| 2240 | |
| 1973 | 2241 | void i386_device::mmx_movd_r64_rm32() // Opcode 0f 6e |
| 1974 | 2242 | { |
| 1975 | 2243 | MMXPROLOG(); |