From 68c0285a322a6a1fde6e2c1fa794b5263bdce146 Mon Sep 17 00:00:00 2001 From: yz70s Date: Fri, 1 Nov 2024 10:53:10 +0100 Subject: i386: make the sse opcodes generate the #NM exception used to save\restore the fpu state --- src/devices/cpu/i386/i386.h | 1 + src/devices/cpu/i386/pentops.hxx | 223 ++++++++++++++++++++++++++++++++++++--- 2 files changed, 209 insertions(+), 15 deletions(-) diff --git a/src/devices/cpu/i386/i386.h b/src/devices/cpu/i386/i386.h index 4a3ad0cfbd0..6a230365ff0 100644 --- a/src/devices/cpu/i386/i386.h +++ b/src/devices/cpu/i386/i386.h @@ -1062,6 +1062,7 @@ protected: void i486_bswap_edi(); void i486_mov_cr_r32(); inline bool MMXPROLOG(); + inline bool SSEPROLOG(); inline void READMMX(uint32_t ea,MMX_REG &r); inline void WRITEMMX(uint32_t ea,MMX_REG &r); inline void READXMM(uint32_t ea,XMM_REG &r); diff --git a/src/devices/cpu/i386/pentops.hxx b/src/devices/cpu/i386/pentops.hxx index 420c2c52df3..5cb212633f2 100644 --- a/src/devices/cpu/i386/pentops.hxx +++ b/src/devices/cpu/i386/pentops.hxx @@ -17,6 +17,16 @@ bool i386_device::MMXPROLOG() return false; } +bool i386_device::SSEPROLOG() +{ + if (m_cr[0] & CR0_TS) + { + i386_trap(FAULT_NM, 0, 0); + return true; + } + return false; +} + void i386_device::READMMX(uint32_t ea,MMX_REG &r) { r.q=READ64(ea); @@ -1053,6 +1063,7 @@ void i386_device::sse_maskmovdqu_r128_r128() // Opcode 66 0f f7 { int s,m,n; uint8_t modm = FETCH(); + if(SSEPROLOG()) return; uint32_t ea = GetEA(7, 0); // ds:di/edi/rdi register s=(modm >> 3) & 7; m=modm & 7; @@ -1189,6 +1200,7 @@ void i386_device::sse_group_660f71() // Opcode 66 0f 71 { uint8_t modm = FETCH(); uint8_t imm8 = FETCH(); + if(SSEPROLOG()) return; if (modm >= 0xc0) { switch ((modm & 0x38) >> 3) { @@ -1240,6 +1252,7 @@ void i386_device::sse_group_660f72() // Opcode 66 0f 72 { uint8_t modm = FETCH(); uint8_t imm8 = FETCH(); + if(SSEPROLOG()) return; if (modm >= 0xc0) { switch ((modm & 0x38) >> 3) { @@ -1286,6 +1299,7 @@ void i386_device::sse_group_660f73() // Opcode 66 0f 73 uint64_t t0; uint8_t modm = FETCH(); uint8_t imm8 = FETCH(); + if(SSEPROLOG()) return; if (modm >= 0xc0) { switch ((modm & 0x38) >> 3) { @@ -2336,6 +2350,7 @@ void i386_device::mmx_pshufw_r64_rm64_i8() // Opcode 0f 70 void i386_device::sse_punpcklbw_r128_rm128() // Opcode 66 0f 60 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if (modrm >= 0xc0) { XMM_REG xd,xs; int s, d; @@ -2377,6 +2392,7 @@ void i386_device::sse_punpcklbw_r128_rm128() // Opcode 66 0f 60 void i386_device::sse_punpcklwd_r128_rm128() { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if (modrm >= 0xc0) { XMM_REG xd, xs; int s, d; @@ -2406,6 +2422,7 @@ void i386_device::sse_punpcklwd_r128_rm128() void i386_device::sse_punpckldq_r128_rm128() { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if (modrm >= 0xc0) { XMM_REG xd, xs; int s, d; @@ -2435,6 +2452,7 @@ void i386_device::sse_punpckldq_r128_rm128() void i386_device::sse_punpcklqdq_r128_rm128() { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if (modrm >= 0xc0) { XMM_REG xd, xs; int s, d; @@ -2889,6 +2907,7 @@ void i386_device::sse_group_0fae() // Opcode 0f ae void i386_device::sse_cvttps2dq_r128_rm128() // Opcode f3 0f 5b { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).i[0]=(int32_t)XMM(modrm & 0x7).f[0]; XMM((modrm >> 3) & 0x7).i[1]=(int32_t)XMM(modrm & 0x7).f[1]; @@ -2909,6 +2928,7 @@ void i386_device::sse_cvttps2dq_r128_rm128() // Opcode f3 0f 5b void i386_device::sse_cvtss2sd_r128_r128m32() // Opcode f3 0f 5a { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f64[0] = XMM(modrm & 0x7).f[0]; } else { @@ -2924,6 +2944,7 @@ void i386_device::sse_cvttss2si_r32_r128m32() // Opcode f3 0f 2c { int32_t src; uint8_t modrm = FETCH(); // get mordm byte + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { // if bits 7-6 are 11 the source is a xmm register (low doubleword) src = (int32_t)XMM(modrm & 0x7).f[0^NATIVE_ENDIAN_VALUE_LE_BE(0,1)]; } else { // otherwise is a memory address @@ -2940,6 +2961,7 @@ void i386_device::sse_cvtss2si_r32_r128m32() // Opcode f3 0f 2d { int32_t src; uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { src = (int32_t)XMM(modrm & 0x7).f[0]; } else { @@ -2955,6 +2977,7 @@ void i386_device::sse_cvtss2si_r32_r128m32() // Opcode f3 0f 2d void i386_device::sse_cvtsi2ss_r128_rm32() // Opcode f3 0f 2a { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0] = (int32_t)LOAD_RM32(modrm); } else { @@ -3018,6 +3041,7 @@ void i386_device::sse_cvtps2pi_r64_r128m64() // Opcode 0f 2d void i386_device::sse_cvtps2pd_r128_r128m64() // Opcode 0f 5a { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f64[0] = (double)XMM(modrm & 0x7).f[0]; XMM((modrm >> 3) & 0x7).f64[1] = (double)XMM(modrm & 0x7).f[1]; @@ -3034,6 +3058,7 @@ void i386_device::sse_cvtps2pd_r128_r128m64() // Opcode 0f 5a void i386_device::sse_cvtdq2ps_r128_rm128() // Opcode 0f 5b { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0] = (float)XMM(modrm & 0x7).i[0]; XMM((modrm >> 3) & 0x7).f[1] = (float)XMM(modrm & 0x7).i[1]; @@ -3054,6 +3079,7 @@ void i386_device::sse_cvtdq2ps_r128_rm128() // Opcode 0f 5b void i386_device::sse_cvtdq2pd_r128_r128m64() // Opcode f3 0f e6 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f64[0] = (double)XMM(modrm & 0x7).i[0]; XMM((modrm >> 3) & 0x7).f64[1] = (double)XMM(modrm & 0x7).i[1]; @@ -3070,6 +3096,7 @@ void i386_device::sse_cvtdq2pd_r128_r128m64() // Opcode f3 0f e6 void i386_device::sse_movss_r128_rm128() // Opcode f3 0f 10 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).d[0] = XMM(modrm & 0x7).d[0]; } else { @@ -3082,6 +3109,7 @@ void i386_device::sse_movss_r128_rm128() // Opcode f3 0f 10 void i386_device::sse_movss_rm128_r128() // Opcode f3 0f 11 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM(modrm & 0x7).d[0] = XMM((modrm >> 3) & 0x7).d[0]; } else { @@ -3094,6 +3122,7 @@ void i386_device::sse_movss_rm128_r128() // Opcode f3 0f 11 void i386_device::sse_movsldup_r128_rm128() // Opcode f3 0f 12 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).d[0] = XMM(modrm & 0x7).d[0]; XMM((modrm >> 3) & 0x7).d[1] = XMM(modrm & 0x7).d[0]; @@ -3114,6 +3143,7 @@ void i386_device::sse_movsldup_r128_rm128() // Opcode f3 0f 12 void i386_device::sse_movshdup_r128_rm128() // Opcode f3 0f 16 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).d[0] = XMM(modrm & 0x7).d[1]; XMM((modrm >> 3) & 0x7).d[1] = XMM(modrm & 0x7).d[1]; @@ -3134,6 +3164,7 @@ void i386_device::sse_movshdup_r128_rm128() // Opcode f3 0f 16 void i386_device::sse_movaps_r128_rm128() // Opcode 0f 28 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7) = XMM(modrm & 0x7); } else { @@ -3146,6 +3177,7 @@ void i386_device::sse_movaps_r128_rm128() // Opcode 0f 28 void i386_device::sse_movaps_rm128_r128() // Opcode 0f 29 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM(modrm & 0x7) = XMM((modrm >> 3) & 0x7); } else { @@ -3158,6 +3190,7 @@ void i386_device::sse_movaps_rm128_r128() // Opcode 0f 29 void i386_device::sse_movups_r128_rm128() // Opcode 0f 10 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7) = XMM(modrm & 0x7); } else { @@ -3170,6 +3203,7 @@ void i386_device::sse_movups_r128_rm128() // Opcode 0f 10 void i386_device::sse_movupd_r128_rm128() // Opcode 66 0f 10 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7) = XMM(modrm & 0x7); } else { @@ -3182,6 +3216,7 @@ void i386_device::sse_movupd_r128_rm128() // Opcode 66 0f 10 void i386_device::sse_movups_rm128_r128() // Opcode 0f 11 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM(modrm & 0x7) = XMM((modrm >> 3) & 0x7); } else { @@ -3194,6 +3229,7 @@ void i386_device::sse_movups_rm128_r128() // Opcode 0f 11 void i386_device::sse_movupd_rm128_r128() // Opcode 66 0f 11 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM(modrm & 0x7) = XMM((modrm >> 3) & 0x7); } else { @@ -3206,6 +3242,7 @@ void i386_device::sse_movupd_rm128_r128() // Opcode 66 0f 11 void i386_device::sse_movlps_r128_m64() // Opcode 0f 12 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { // MOVHLPS opcode XMM((modrm >> 3) & 0x7).q[0] = XMM(modrm & 0x7).q[1]; @@ -3221,6 +3258,7 @@ void i386_device::sse_movlps_r128_m64() // Opcode 0f 12 void i386_device::sse_movlpd_r128_m64() // Opcode 66 0f 12 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { CYCLES(1); // TODO: correct cycle count } else { @@ -3234,6 +3272,7 @@ void i386_device::sse_movlpd_r128_m64() // Opcode 66 0f 12 void i386_device::sse_movlps_m64_r128() // Opcode 0f 13 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { // unsupported by cpu CYCLES(1); // TODO: correct cycle count @@ -3247,6 +3286,7 @@ void i386_device::sse_movlps_m64_r128() // Opcode 0f 13 void i386_device::sse_movlpd_m64_r128() // Opcode 66 0f 13 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { // unsupported by cpu CYCLES(1); // TODO: correct cycle count @@ -3260,6 +3300,7 @@ void i386_device::sse_movlpd_m64_r128() // Opcode 66 0f 13 void i386_device::sse_movhps_r128_m64() // Opcode 0f 16 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { // MOVLHPS opcode XMM((modrm >> 3) & 0x7).q[1] = XMM(modrm & 0x7).q[0]; @@ -3275,6 +3316,7 @@ void i386_device::sse_movhps_r128_m64() // Opcode 0f 16 void i386_device::sse_movhpd_r128_m64() // Opcode 66 0f 16 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { // unsupported by cpu CYCLES(1); // TODO: correct cycle count @@ -3289,6 +3331,7 @@ void i386_device::sse_movhpd_r128_m64() // Opcode 66 0f 16 void i386_device::sse_movhps_m64_r128() // Opcode 0f 17 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { // unsupported by cpu CYCLES(1); // TODO: correct cycle count @@ -3302,6 +3345,7 @@ void i386_device::sse_movhps_m64_r128() // Opcode 0f 17 void i386_device::sse_movhpd_m64_r128() // Opcode 66 0f 17 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { // unsupported by cpu CYCLES(1); // TODO: correct cycle count @@ -3315,6 +3359,7 @@ void i386_device::sse_movhpd_m64_r128() // Opcode 66 0f 17 void i386_device::sse_movntps_m128_r128() // Opcode 0f 2b { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { // unsupported by cpu CYCLES(1); // TODO: correct cycle count @@ -3329,6 +3374,7 @@ void i386_device::sse_movntps_m128_r128() // Opcode 0f 2b void i386_device::sse_movmskps_r16_r128() // Opcode 0f 50 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { int b; b=(XMM(modrm & 0x7).d[0] >> 31) & 1; @@ -3343,6 +3389,7 @@ void i386_device::sse_movmskps_r16_r128() // Opcode 0f 50 void i386_device::sse_movmskps_r32_r128() // Opcode 0f 50 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { int b; b=(XMM(modrm & 0x7).d[0] >> 31) & 1; @@ -3357,6 +3404,7 @@ void i386_device::sse_movmskps_r32_r128() // Opcode 0f 50 void i386_device::sse_movmskpd_r32_r128() // Opcode 66 0f 50 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { int b; b=(XMM(modrm & 0x7).q[0] >> 63) & 1; @@ -3368,8 +3416,8 @@ void i386_device::sse_movmskpd_r32_r128() // Opcode 66 0f 50 void i386_device::sse_movq2dq_r128_r64() // Opcode f3 0f d6 { - if(MMXPROLOG()) return; uint8_t modrm = FETCH(); + if(MMXPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).q[0] = MMX(modrm & 7).q; XMM((modrm >> 3) & 0x7).q[1] = 0; @@ -3379,8 +3427,8 @@ void i386_device::sse_movq2dq_r128_r64() // Opcode f3 0f d6 void i386_device::sse_movdqu_r128_rm128() // Opcode f3 0f 6f { - if(MMXPROLOG()) return; uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).q[0] = XMM(modrm & 0x7).q[0]; XMM((modrm >> 3) & 0x7).q[1] = XMM(modrm & 0x7).q[1]; @@ -3393,8 +3441,8 @@ void i386_device::sse_movdqu_r128_rm128() // Opcode f3 0f 6f void i386_device::sse_movdqu_rm128_r128() // Opcode f3 0f 7f { - if(MMXPROLOG()) return; uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM(modrm & 0x7).q[0] = XMM((modrm >> 3) & 0x7).q[0]; XMM(modrm & 0x7).q[1] = XMM((modrm >> 3) & 0x7).q[1]; @@ -3408,6 +3456,7 @@ void i386_device::sse_movdqu_rm128_r128() // Opcode f3 0f 7f void i386_device::sse_movd_m128_rm32() // Opcode 66 0f 6e { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if (modrm >= 0xc0) { XMM((modrm >> 3) & 0x7).d[0] = LOAD_RM32(modrm); } @@ -3423,6 +3472,7 @@ void i386_device::sse_movd_m128_rm32() // Opcode 66 0f 6e void i386_device::sse_movdqa_m128_rm128() // Opcode 66 0f 6f { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if (modrm >= 0xc0) { XMM((modrm >> 3) & 0x7).q[0] = XMM(modrm & 0x7).q[0]; XMM((modrm >> 3) & 0x7).q[1] = XMM(modrm & 0x7).q[1]; @@ -3436,8 +3486,8 @@ void i386_device::sse_movdqa_m128_rm128() // Opcode 66 0f 6f void i386_device::sse_movq_r128_r128m64() // Opcode f3 0f 7e { - if(MMXPROLOG()) return; uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).q[0] = XMM(modrm & 0x7).q[0]; XMM((modrm >> 3) & 0x7).q[1] = 0; @@ -3452,6 +3502,7 @@ void i386_device::sse_movq_r128_r128m64() // Opcode f3 0f 7e void i386_device::sse_movd_rm32_r128() // Opcode 66 0f 7e { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if (modrm >= 0xc0) { STORE_RM32(modrm, XMM((modrm >> 3) & 0x7).d[0]); } @@ -3465,6 +3516,7 @@ void i386_device::sse_movd_rm32_r128() // Opcode 66 0f 7e void i386_device::sse_movdqa_rm128_r128() // Opcode 66 0f 7f { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if (modrm >= 0xc0) { XMM(modrm & 0x7).q[0] = XMM((modrm >> 3) & 0x7).q[0]; XMM(modrm & 0x7).q[1] = XMM((modrm >> 3) & 0x7).q[1]; @@ -3478,7 +3530,7 @@ void i386_device::sse_movdqa_rm128_r128() // Opcode 66 0f 7f void i386_device::sse_pmovmskb_r16_r64() // Opcode 0f d7 { - //if(MMXPROLOG()) return; + if(MMXPROLOG()) return; uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { int b; @@ -3497,8 +3549,8 @@ void i386_device::sse_pmovmskb_r16_r64() // Opcode 0f d7 void i386_device::sse_pmovmskb_r32_r64() // Opcode 0f d7 { - //if(MMXPROLOG()) return; uint8_t modrm = FETCH(); + if(MMXPROLOG()) return; if( modrm >= 0xc0 ) { int b; b=(MMX(modrm & 0x7).b[0] >> 7) & 1; @@ -3517,6 +3569,7 @@ void i386_device::sse_pmovmskb_r32_r64() // Opcode 0f d7 void i386_device::sse_pmovmskb_r32_r128() // Opcode 66 0f d7 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { uint32_t b; b=(XMM(modrm & 0x7).b[0] >> 7) & 1; @@ -3543,6 +3596,7 @@ void i386_device::sse_pmovmskb_r32_r128() // Opcode 66 0f d7 void i386_device::sse_xorps() // Opcode 0f 57 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).d[0] = XMM((modrm >> 3) & 0x7).d[0] ^ XMM(modrm & 0x7).d[0]; XMM((modrm >> 3) & 0x7).d[1] = XMM((modrm >> 3) & 0x7).d[1] ^ XMM(modrm & 0x7).d[1]; @@ -3563,6 +3617,7 @@ void i386_device::sse_xorps() // Opcode 0f 57 void i386_device::sse_xorpd_r128_rm128() // Opcode 66 0f 57 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).q[0] = XMM((modrm >> 3) & 0x7).q[0] ^ XMM(modrm & 0x7).q[0]; XMM((modrm >> 3) & 0x7).q[1] = XMM((modrm >> 3) & 0x7).q[1] ^ XMM(modrm & 0x7).q[1]; @@ -3579,6 +3634,7 @@ void i386_device::sse_xorpd_r128_rm128() // Opcode 66 0f 57 void i386_device::sse_addps() // Opcode 0f 58 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0] = XMM((modrm >> 3) & 0x7).f[0] + XMM(modrm & 0x7).f[0]; XMM((modrm >> 3) & 0x7).f[1] = XMM((modrm >> 3) & 0x7).f[1] + XMM(modrm & 0x7).f[1]; @@ -3599,6 +3655,7 @@ void i386_device::sse_addps() // Opcode 0f 58 void i386_device::sse_sqrtps_r128_rm128() // Opcode 0f 51 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0] = sqrt(XMM(modrm & 0x7).f[0]); XMM((modrm >> 3) & 0x7).f[1] = sqrt(XMM(modrm & 0x7).f[1]); @@ -3619,6 +3676,7 @@ void i386_device::sse_sqrtps_r128_rm128() // Opcode 0f 51 void i386_device::sse_rsqrtps_r128_rm128() // Opcode 0f 52 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0] = 1.0 / sqrt(XMM(modrm & 0x7).f[0]); XMM((modrm >> 3) & 0x7).f[1] = 1.0 / sqrt(XMM(modrm & 0x7).f[1]); @@ -3639,6 +3697,7 @@ void i386_device::sse_rsqrtps_r128_rm128() // Opcode 0f 52 void i386_device::sse_rcpps_r128_rm128() // Opcode 0f 53 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0] = 1.0f / XMM(modrm & 0x7).f[0]; XMM((modrm >> 3) & 0x7).f[1] = 1.0f / XMM(modrm & 0x7).f[1]; @@ -3659,6 +3718,7 @@ void i386_device::sse_rcpps_r128_rm128() // Opcode 0f 53 void i386_device::sse_andps_r128_rm128() // Opcode 0f 54 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).q[0] = XMM((modrm >> 3) & 0x7).q[0] & XMM(modrm & 0x7).q[0]; XMM((modrm >> 3) & 0x7).q[1] = XMM((modrm >> 3) & 0x7).q[1] & XMM(modrm & 0x7).q[1]; @@ -3675,6 +3735,7 @@ void i386_device::sse_andps_r128_rm128() // Opcode 0f 54 void i386_device::sse_andpd_r128_rm128() // Opcode 66 0f 54 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).q[0] = XMM((modrm >> 3) & 0x7).q[0] & XMM(modrm & 0x7).q[0]; XMM((modrm >> 3) & 0x7).q[1] = XMM((modrm >> 3) & 0x7).q[1] & XMM(modrm & 0x7).q[1]; @@ -3691,6 +3752,7 @@ void i386_device::sse_andpd_r128_rm128() // Opcode 66 0f 54 void i386_device::sse_andnps_r128_rm128() // Opcode 0f 55 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).q[0] = ~(XMM((modrm >> 3) & 0x7).q[0]) & XMM(modrm & 0x7).q[0]; XMM((modrm >> 3) & 0x7).q[1] = ~(XMM((modrm >> 3) & 0x7).q[1]) & XMM(modrm & 0x7).q[1]; @@ -3707,6 +3769,7 @@ void i386_device::sse_andnps_r128_rm128() // Opcode 0f 55 void i386_device::sse_andnpd_r128_rm128() // Opcode 66 0f 55 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).q[0] = ~(XMM((modrm >> 3) & 0x7).q[0]) & XMM(modrm & 0x7).q[0]; XMM((modrm >> 3) & 0x7).q[1] = ~(XMM((modrm >> 3) & 0x7).q[1]) & XMM(modrm & 0x7).q[1]; @@ -3723,6 +3786,7 @@ void i386_device::sse_andnpd_r128_rm128() // Opcode 66 0f 55 void i386_device::sse_orps_r128_rm128() // Opcode 0f 56 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).q[0] = XMM((modrm >> 3) & 0x7).q[0] | XMM(modrm & 0x7).q[0]; XMM((modrm >> 3) & 0x7).q[1] = XMM((modrm >> 3) & 0x7).q[1] | XMM(modrm & 0x7).q[1]; @@ -3739,6 +3803,7 @@ void i386_device::sse_orps_r128_rm128() // Opcode 0f 56 void i386_device::sse_orpd_r128_rm128() // Opcode 66 0f 56 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).q[0] = XMM((modrm >> 3) & 0x7).q[0] | XMM(modrm & 0x7).q[0]; XMM((modrm >> 3) & 0x7).q[1] = XMM((modrm >> 3) & 0x7).q[1] | XMM(modrm & 0x7).q[1]; @@ -3755,6 +3820,7 @@ void i386_device::sse_orpd_r128_rm128() // Opcode 66 0f 56 void i386_device::sse_mulps() // Opcode 0f 59 ???? { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0] = XMM((modrm >> 3) & 0x7).f[0] * XMM(modrm & 0x7).f[0]; XMM((modrm >> 3) & 0x7).f[1] = XMM((modrm >> 3) & 0x7).f[1] * XMM(modrm & 0x7).f[1]; @@ -3775,6 +3841,7 @@ void i386_device::sse_mulps() // Opcode 0f 59 ???? void i386_device::sse_subps() // Opcode 0f 5c { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0] = XMM((modrm >> 3) & 0x7).f[0] - XMM(modrm & 0x7).f[0]; XMM((modrm >> 3) & 0x7).f[1] = XMM((modrm >> 3) & 0x7).f[1] - XMM(modrm & 0x7).f[1]; @@ -3821,6 +3888,7 @@ static inline double sse_min_double(double src1, double src2) void i386_device::sse_minps() // Opcode 0f 5d { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0] = sse_min_single(XMM((modrm >> 3) & 0x7).f[0], XMM(modrm & 0x7).f[0]); XMM((modrm >> 3) & 0x7).f[1] = sse_min_single(XMM((modrm >> 3) & 0x7).f[1], XMM(modrm & 0x7).f[1]); @@ -3841,6 +3909,7 @@ void i386_device::sse_minps() // Opcode 0f 5d void i386_device::sse_divps() // Opcode 0f 5e { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0] = XMM((modrm >> 3) & 0x7).f[0] / XMM(modrm & 0x7).f[0]; XMM((modrm >> 3) & 0x7).f[1] = XMM((modrm >> 3) & 0x7).f[1] / XMM(modrm & 0x7).f[1]; @@ -3887,6 +3956,7 @@ static inline double sse_max_double(double src1, double src2) void i386_device::sse_maxps() // Opcode 0f 5f { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0] = sse_max_single(XMM((modrm >> 3) & 0x7).f[0], XMM(modrm & 0x7).f[0]); XMM((modrm >> 3) & 0x7).f[1] = sse_max_single(XMM((modrm >> 3) & 0x7).f[1], XMM(modrm & 0x7).f[1]); @@ -3907,6 +3977,7 @@ void i386_device::sse_maxps() // Opcode 0f 5f void i386_device::sse_maxss_r128_r128m32() // Opcode f3 0f 5f { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0] = sse_max_single(XMM((modrm >> 3) & 0x7).f[0], XMM(modrm & 0x7).f[0]); } else { @@ -3921,6 +3992,7 @@ void i386_device::sse_maxss_r128_r128m32() // Opcode f3 0f 5f void i386_device::sse_addss() // Opcode f3 0f 58 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0] = XMM((modrm >> 3) & 0x7).f[0] + XMM(modrm & 0x7).f[0]; } else { @@ -3935,6 +4007,7 @@ void i386_device::sse_addss() // Opcode f3 0f 58 void i386_device::sse_subss() // Opcode f3 0f 5c { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0] = XMM((modrm >> 3) & 0x7).f[0] - XMM(modrm & 0x7).f[0]; } else { @@ -3949,6 +4022,7 @@ void i386_device::sse_subss() // Opcode f3 0f 5c void i386_device::sse_mulss() // Opcode f3 0f 5e { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0] = XMM((modrm >> 3) & 0x7).f[0] * XMM(modrm & 0x7).f[0]; } else { @@ -3963,6 +4037,7 @@ void i386_device::sse_mulss() // Opcode f3 0f 5e void i386_device::sse_divss() // Opcode 0f 59 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0] = XMM((modrm >> 3) & 0x7).f[0] / XMM(modrm & 0x7).f[0]; } else { @@ -3977,6 +4052,7 @@ void i386_device::sse_divss() // Opcode 0f 59 void i386_device::sse_rcpss_r128_r128m32() // Opcode f3 0f 53 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0] = 1.0f / XMM(modrm & 0x7).f[0]; } else { @@ -3991,6 +4067,7 @@ void i386_device::sse_rcpss_r128_r128m32() // Opcode f3 0f 53 void i386_device::sse_sqrtss_r128_r128m32() // Opcode f3 0f 51 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0] = sqrt(XMM(modrm & 0x7).f[0]); } else { @@ -4005,6 +4082,7 @@ void i386_device::sse_sqrtss_r128_r128m32() // Opcode f3 0f 51 void i386_device::sse_rsqrtss_r128_r128m32() // Opcode f3 0f 52 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0] = 1.0 / sqrt(XMM(modrm & 0x7).f[0]); } else { @@ -4019,6 +4097,7 @@ void i386_device::sse_rsqrtss_r128_r128m32() // Opcode f3 0f 52 void i386_device::sse_minss_r128_r128m32() // Opcode f3 0f 5d { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0] = XMM((modrm >> 3) & 0x7).f[0] < XMM(modrm & 0x7).f[0] ? XMM((modrm >> 3) & 0x7).f[0] : XMM(modrm & 0x7).f[0]; } else { @@ -4034,6 +4113,7 @@ void i386_device::sse_comiss_r128_r128m32() // Opcode 0f 2f { float32 a,b; uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { a = XMM((modrm >> 3) & 0x7).d[0]; b = XMM(modrm & 0x7).d[0]; @@ -4071,6 +4151,7 @@ void i386_device::sse_comisd_r128_r128m64() // Opcode 66 0f 2f { float64 a,b; uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { a = XMM((modrm >> 3) & 0x7).q[0]; b = XMM(modrm & 0x7).q[0]; @@ -4108,6 +4189,7 @@ void i386_device::sse_ucomiss_r128_r128m32() // Opcode 0f 2e { float32 a,b; uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { a = XMM((modrm >> 3) & 0x7).d[0]; b = XMM(modrm & 0x7).d[0]; @@ -4145,6 +4227,7 @@ void i386_device::sse_ucomisd_r128_r128m64() // Opcode 66 0f 2e { float64 a,b; uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { a = XMM((modrm >> 3) & 0x7).q[0]; b = XMM(modrm & 0x7).q[0]; @@ -4182,6 +4265,7 @@ void i386_device::sse_shufps() // Opcode 0f c6 { uint8_t modrm = FETCH(); uint8_t sel = FETCH(); + if(SSEPROLOG()) return; int m1,m2,m3,m4; int s,d; m1=sel & 3; @@ -4219,6 +4303,7 @@ void i386_device::sse_shufpd_r128_rm128_i8() // Opcode 66 0f c6 { uint8_t modrm = FETCH(); uint8_t sel = FETCH(); + if(SSEPROLOG()) return; int m1,m2; int s,d; m1=sel & 1; @@ -4246,6 +4331,7 @@ void i386_device::sse_shufpd_r128_rm128_i8() // Opcode 66 0f c6 void i386_device::sse_unpcklps_r128_rm128() // Opcode 0f 14 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; int s,d; uint32_t t1, t2, t3, t4; s=modrm & 0x7; @@ -4274,6 +4360,7 @@ void i386_device::sse_unpcklps_r128_rm128() // Opcode 0f 14 void i386_device::sse_unpcklpd_r128_rm128() // Opcode 66 0f 14 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; int s,d; s=modrm & 0x7; d=(modrm >> 3) & 0x7; @@ -4293,6 +4380,7 @@ void i386_device::sse_unpcklpd_r128_rm128() // Opcode 66 0f 14 void i386_device::sse_unpckhps_r128_rm128() // Opcode 0f 15 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; int s,d; uint32_t t1, t2, t3, t4; s=modrm & 0x7; @@ -4323,6 +4411,7 @@ void i386_device::sse_unpckhps_r128_rm128() // Opcode 0f 15 void i386_device::sse_unpckhpd_r128_rm128() // Opcode 66 0f 15 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; int s,d; s=modrm & 0x7; d=(modrm >> 3) & 0x7; @@ -4522,6 +4611,7 @@ void i386_device::sse_predicate_compare_double_scalar(uint8_t imm8, XMM_REG d, X void i386_device::sse_cmpps_r128_rm128_i8() // Opcode 0f c2 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { int s,d; uint8_t imm8 = FETCH(); @@ -4543,6 +4633,7 @@ void i386_device::sse_cmpps_r128_rm128_i8() // Opcode 0f c2 void i386_device::sse_cmppd_r128_rm128_i8() // Opcode 66 0f c2 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { int s,d; uint8_t imm8 = FETCH(); @@ -4564,6 +4655,7 @@ void i386_device::sse_cmppd_r128_rm128_i8() // Opcode 66 0f c2 void i386_device::sse_cmpss_r128_r128m32_i8() // Opcode f3 0f c2 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { int s,d; uint8_t imm8 = FETCH(); @@ -4588,8 +4680,10 @@ void i386_device::sse_pinsrw_r64_r16m16_i8() // Opcode 0f c4, 16bit register if( modrm >= 0xc0 ) { uint8_t imm8 = FETCH(); uint16_t v = LOAD_RM16(modrm); - if (m_xmm_operand_size) + if (m_xmm_operand_size) { + if(SSEPROLOG()) return; XMM((modrm >> 3) & 0x7).w[imm8 & 7] = v; + } else { if(MMXPROLOG()) return; MMX((modrm >> 3) & 0x7).w[imm8 & 3] = v; @@ -4598,8 +4692,10 @@ void i386_device::sse_pinsrw_r64_r16m16_i8() // Opcode 0f c4, 16bit register uint32_t ea = GetEA(modrm, 0); uint8_t imm8 = FETCH(); uint16_t v = READ16(ea); - if (m_xmm_operand_size) + if (m_xmm_operand_size) { + if(SSEPROLOG()) return; XMM((modrm >> 3) & 0x7).w[imm8 & 7] = v; + } else { if(MMXPROLOG()) return; MMX((modrm >> 3) & 0x7).w[imm8 & 3] = v; @@ -4628,6 +4724,7 @@ void i386_device::sse_pinsrw_r64_r32m16_i8() // Opcode 0f c4, 32bit register void i386_device::sse_pinsrw_r128_r32m16_i8() // Opcode 66 0f c4 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if (modrm >= 0xc0) { uint8_t imm8 = FETCH(); uint16_t v = (uint16_t)LOAD_RM32(modrm); @@ -4644,16 +4741,18 @@ void i386_device::sse_pinsrw_r128_r32m16_i8() // Opcode 66 0f c4 void i386_device::sse_pextrw_r16_r64_i8() // Opcode 0f c5 { - //if(MMXPROLOG()) return; uint8_t modrm = FETCH(); if( modrm >= 0xc0 ) { uint8_t imm8 = FETCH(); - if (m_xmm_operand_size) + if (m_xmm_operand_size) { + if(SSEPROLOG()) return; STORE_REG16(modrm, XMM(modrm & 0x7).w[imm8 & 7]); - else + } + else { + if(MMXPROLOG()) return; STORE_REG16(modrm, MMX(modrm & 0x7).w[imm8 & 3]); + } } else { - //uint8_t imm8 = FETCH(); report_invalid_modrm("pextrw_r16_r64_i8", modrm); } CYCLES(1); // TODO: correct cycle count @@ -4661,13 +4760,12 @@ void i386_device::sse_pextrw_r16_r64_i8() // Opcode 0f c5 void i386_device::sse_pextrw_r32_r64_i8() // Opcode 0f c5 { - //if(MMXPROLOG()) return; uint8_t modrm = FETCH(); + if(MMXPROLOG()) return; if( modrm >= 0xc0 ) { uint8_t imm8 = FETCH(); STORE_REG32(modrm, MMX(modrm & 0x7).w[imm8 & 3]); } else { - //uint8_t imm8 = FETCH(); report_invalid_modrm("pextrw_r32_r64_i8", modrm); } CYCLES(1); // TODO: correct cycle count @@ -4676,12 +4774,12 @@ void i386_device::sse_pextrw_r32_r64_i8() // Opcode 0f c5 void i386_device::sse_pextrw_reg_r128_i8() // Opcode 66 0f c5 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if (modrm >= 0xc0) { uint8_t imm8 = FETCH(); STORE_REG32(modrm, XMM(modrm & 0x7).w[imm8 & 7]); } else { - //uint8_t imm8 = FETCH(); report_invalid_modrm("sse_pextrw_reg_r128_i8", modrm); } CYCLES(1); // TODO: correct cycle count @@ -4708,6 +4806,7 @@ void i386_device::sse_pminub_r64_rm64() // Opcode 0f da void i386_device::sse_pminub_r128_rm128() // Opcode 66 0f da { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { for (int n=0;n < 16;n++) XMM((modrm >> 3) & 0x7).b[n] = XMM((modrm >> 3) & 0x7).b[n] < XMM(modrm & 0x7).b[n] ? XMM((modrm >> 3) & 0x7).b[n] : XMM(modrm & 0x7).b[n]; @@ -4850,6 +4949,7 @@ void i386_device::sse_pmuludq_r64_rm64() // Opcode 0f f4 void i386_device::sse_pmuludq_r128_rm128() // Opcode 66 0f f4 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).q[0] = (uint64_t)XMM((modrm >> 3) & 0x7).d[0] * (uint64_t)XMM(modrm & 0x7).d[0]; XMM((modrm >> 3) & 0x7).q[1] = (uint64_t)XMM((modrm >> 3) & 0x7).d[2] * (uint64_t)XMM(modrm & 0x7).d[2]; @@ -4904,6 +5004,7 @@ void i386_device::sse_psubq_r64_rm64() // Opcode 0f fb void i386_device::sse_psubq_r128_rm128() // Opcode 66 0f fb { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).q[0]=XMM((modrm >> 3) & 0x7).q[0] - XMM(modrm & 7).q[0]; XMM((modrm >> 3) & 0x7).q[1]=XMM((modrm >> 3) & 0x7).q[1] - XMM(modrm & 7).q[1]; @@ -4920,6 +5021,7 @@ void i386_device::sse_psubq_r128_rm128() // Opcode 66 0f fb void i386_device::sse_pshufd_r128_rm128_i8() // Opcode 66 0f 70 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM_REG t; int s,d; @@ -4949,6 +5051,7 @@ void i386_device::sse_pshufd_r128_rm128_i8() // Opcode 66 0f 70 void i386_device::sse_pshuflw_r128_rm128_i8() // Opcode f2 0f 70 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM_REG t; int s,d; @@ -4979,6 +5082,7 @@ void i386_device::sse_pshuflw_r128_rm128_i8() // Opcode f2 0f 70 void i386_device::sse_pshufhw_r128_rm128_i8() // Opcode f3 0f 70 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM_REG t; int s,d; @@ -5009,6 +5113,7 @@ void i386_device::sse_pshufhw_r128_rm128_i8() // Opcode f3 0f 70 void i386_device::sse_packsswb_r128_rm128() // Opcode 66 0f 63 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if (modrm >= 0xc0) { XMM_REG t; int s, d; @@ -5037,6 +5142,7 @@ void i386_device::sse_packsswb_r128_rm128() // Opcode 66 0f 63 void i386_device::sse_packssdw_r128_rm128() // Opcode 66 0f 6b { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if (modrm >= 0xc0) { XMM_REG t; int s, d; @@ -5073,6 +5179,7 @@ void i386_device::sse_packssdw_r128_rm128() // Opcode 66 0f 6b void i386_device::sse_pcmpgtb_r128_rm128() // Opcode 66 0f 64 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { int s,d; s=modrm & 0x7; @@ -5093,6 +5200,7 @@ void i386_device::sse_pcmpgtb_r128_rm128() // Opcode 66 0f 64 void i386_device::sse_pcmpgtw_r128_rm128() // Opcode 66 0f 65 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { int s,d; s=modrm & 0x7; @@ -5113,6 +5221,7 @@ void i386_device::sse_pcmpgtw_r128_rm128() // Opcode 66 0f 65 void i386_device::sse_pcmpgtd_r128_rm128() // Opcode 66 0f 66 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { int s,d; s=modrm & 0x7; @@ -5133,6 +5242,7 @@ void i386_device::sse_pcmpgtd_r128_rm128() // Opcode 66 0f 66 void i386_device::sse_packuswb_r128_rm128() // Opcode 66 0f 67 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM_REG t; int s,d; @@ -5160,6 +5270,7 @@ void i386_device::sse_packuswb_r128_rm128() // Opcode 66 0f 67 void i386_device::sse_punpckhbw_r128_rm128() // Opcode 66 0f 68 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM_REG t; int s,d; @@ -5186,6 +5297,7 @@ void i386_device::sse_punpckhbw_r128_rm128() // Opcode 66 0f 68 void i386_device::sse_punpckhwd_r128_rm128() // Opcode 66 0f 69 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM_REG t; int s,d; @@ -5212,6 +5324,7 @@ void i386_device::sse_punpckhwd_r128_rm128() // Opcode 66 0f 69 void i386_device::sse_unpckhdq_r128_rm128() // Opcode 66 0f 6a { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM_REG t; int s,d; @@ -5238,6 +5351,7 @@ void i386_device::sse_unpckhdq_r128_rm128() // Opcode 66 0f 6a void i386_device::sse_punpckhqdq_r128_rm128() // Opcode 66 0f 6d { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM_REG t; int s,d; @@ -5260,6 +5374,7 @@ void i386_device::sse_punpckhqdq_r128_rm128() // Opcode 66 0f 6d void i386_device::sse_pcmpeqb_r128_rm128() // Opcode 66 0f 74 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { int s,d; s=modrm & 0x7; @@ -5280,6 +5395,7 @@ void i386_device::sse_pcmpeqb_r128_rm128() // Opcode 66 0f 74 void i386_device::sse_pcmpeqw_r128_rm128() // Opcode 66 0f 75 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { int s,d; s=modrm & 0x7; @@ -5300,6 +5416,7 @@ void i386_device::sse_pcmpeqw_r128_rm128() // Opcode 66 0f 75 void i386_device::sse_pcmpeqd_r128_rm128() // Opcode 66 0f 76 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { int s,d; s=modrm & 0x7; @@ -5320,6 +5437,7 @@ void i386_device::sse_pcmpeqd_r128_rm128() // Opcode 66 0f 76 void i386_device::sse_paddq_r128_rm128() // Opcode 66 0f d4 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { int s,d; s=modrm & 0x7; @@ -5340,6 +5458,7 @@ void i386_device::sse_paddq_r128_rm128() // Opcode 66 0f d4 void i386_device::sse_pmullw_r128_rm128() // Opcode 66 0f d5 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { int s,d; s=modrm & 0x7; @@ -5361,6 +5480,7 @@ void i386_device::sse_pmullw_r128_rm128() // Opcode 66 0f d5 void i386_device::sse_paddb_r128_rm128() // Opcode 66 0f fc { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { for (int n=0;n < 16;n++) XMM((modrm >> 3) & 0x7).b[n]=XMM((modrm >> 3) & 0x7).b[n] + XMM(modrm & 7).b[n]; @@ -5377,6 +5497,7 @@ void i386_device::sse_paddb_r128_rm128() // Opcode 66 0f fc void i386_device::sse_paddw_r128_rm128() // Opcode 66 0f fd { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { for (int n=0;n < 8;n++) XMM((modrm >> 3) & 0x7).w[n]=XMM((modrm >> 3) & 0x7).w[n] + XMM(modrm & 7).w[n]; @@ -5393,6 +5514,7 @@ void i386_device::sse_paddw_r128_rm128() // Opcode 66 0f fd void i386_device::sse_paddd_r128_rm128() // Opcode 66 0f fe { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { for (int n=0;n < 4;n++) XMM((modrm >> 3) & 0x7).d[n]=XMM((modrm >> 3) & 0x7).d[n] + XMM(modrm & 7).d[n]; @@ -5409,6 +5531,7 @@ void i386_device::sse_paddd_r128_rm128() // Opcode 66 0f fe void i386_device::sse_psubusb_r128_rm128() // Opcode 66 0f d8 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { for (int n=0;n < 16;n++) XMM((modrm >> 3) & 0x7).b[n]=XMM((modrm >> 3) & 0x7).b[n] < XMM(modrm & 7).b[n] ? 0 : XMM((modrm >> 3) & 0x7).b[n]-XMM(modrm & 7).b[n]; @@ -5425,6 +5548,7 @@ void i386_device::sse_psubusb_r128_rm128() // Opcode 66 0f d8 void i386_device::sse_psubusw_r128_rm128() // Opcode 66 0f d9 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { for (int n=0;n < 8;n++) XMM((modrm >> 3) & 0x7).w[n]=XMM((modrm >> 3) & 0x7).w[n] < XMM(modrm & 7).w[n] ? 0 : XMM((modrm >> 3) & 0x7).w[n]-XMM(modrm & 7).w[n]; @@ -5441,6 +5565,7 @@ void i386_device::sse_psubusw_r128_rm128() // Opcode 66 0f d9 void i386_device::sse_pand_r128_rm128() // Opcode 66 0f db { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).q[0]=XMM((modrm >> 3) & 0x7).q[0] & XMM(modrm & 7).q[0]; XMM((modrm >> 3) & 0x7).q[1]=XMM((modrm >> 3) & 0x7).q[1] & XMM(modrm & 7).q[1]; @@ -5457,6 +5582,7 @@ void i386_device::sse_pand_r128_rm128() // Opcode 66 0f db void i386_device::sse_pandn_r128_rm128() // Opcode 66 0f df { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).q[0]=(~XMM((modrm >> 3) & 0x7).q[0]) & XMM(modrm & 7).q[0]; XMM((modrm >> 3) & 0x7).q[1]=(~XMM((modrm >> 3) & 0x7).q[1]) & XMM(modrm & 7).q[1]; @@ -5473,6 +5599,7 @@ void i386_device::sse_pandn_r128_rm128() // Opcode 66 0f df void i386_device::sse_paddusb_r128_rm128() // Opcode 66 0f dc { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { for (int n=0;n < 16;n++) XMM((modrm >> 3) & 0x7).b[n]=XMM((modrm >> 3) & 0x7).b[n] > (0xff-XMM(modrm & 7).b[n]) ? 0xff : XMM((modrm >> 3) & 0x7).b[n]+XMM(modrm & 7).b[n]; @@ -5489,6 +5616,7 @@ void i386_device::sse_paddusb_r128_rm128() // Opcode 66 0f dc void i386_device::sse_paddusw_r128_rm128() // Opcode 66 0f dd { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { for (int n=0;n < 8;n++) XMM((modrm >> 3) & 0x7).w[n]=XMM((modrm >> 3) & 0x7).w[n] > (0xffff-XMM(modrm & 7).w[n]) ? 0xffff : XMM((modrm >> 3) & 0x7).w[n]+XMM(modrm & 7).w[n]; @@ -5505,6 +5633,7 @@ void i386_device::sse_paddusw_r128_rm128() // Opcode 66 0f dd void i386_device::sse_pmaxub_r128_rm128() // Opcode 66 0f de { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { for (int n=0;n < 16;n++) XMM((modrm >> 3) & 0x7).b[n] = XMM((modrm >> 3) & 0x7).b[n] > XMM(modrm & 0x7).b[n] ? XMM((modrm >> 3) & 0x7).b[n] : XMM(modrm & 0x7).b[n]; @@ -5521,6 +5650,7 @@ void i386_device::sse_pmaxub_r128_rm128() // Opcode 66 0f de void i386_device::sse_pmulhuw_r128_rm128() // Opcode 66 0f e4 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { for (int n=0;n < 8;n++) XMM((modrm >> 3) & 0x7).w[n]=((uint32_t)XMM((modrm >> 3) & 0x7).w[n]*(uint32_t)XMM(modrm & 7).w[n]) >> 16; @@ -5537,6 +5667,7 @@ void i386_device::sse_pmulhuw_r128_rm128() // Opcode 66 0f e4 void i386_device::sse_pmulhw_r128_rm128() // Opcode 66 0f e5 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { for (int n=0;n < 8;n++) XMM((modrm >> 3) & 0x7).w[n]=(uint32_t)((int32_t)XMM((modrm >> 3) & 0x7).s[n]*(int32_t)XMM(modrm & 7).s[n]) >> 16; @@ -5553,6 +5684,7 @@ void i386_device::sse_pmulhw_r128_rm128() // Opcode 66 0f e5 void i386_device::sse_psubsb_r128_rm128() // Opcode 66 0f e8 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { for (int n=0;n < 16;n++) XMM((modrm >> 3) & 0x7).c[n]=SaturatedSignedWordToSignedByte((int16_t)XMM((modrm >> 3) & 0x7).c[n] - (int16_t)XMM(modrm & 7).c[n]); @@ -5569,6 +5701,7 @@ void i386_device::sse_psubsb_r128_rm128() // Opcode 66 0f e8 void i386_device::sse_psubsw_r128_rm128() // Opcode 66 0f e9 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { for (int n=0;n < 8;n++) XMM((modrm >> 3) & 0x7).s[n]=SaturatedSignedDwordToSignedWord((int32_t)XMM((modrm >> 3) & 0x7).s[n] - (int32_t)XMM(modrm & 7).s[n]); @@ -5585,6 +5718,7 @@ void i386_device::sse_psubsw_r128_rm128() // Opcode 66 0f e9 void i386_device::sse_pminsw_r128_rm128() // Opcode 66 0f ea { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { for (int n=0;n < 8;n++) XMM((modrm >> 3) & 0x7).s[n] = XMM((modrm >> 3) & 0x7).s[n] < XMM(modrm & 0x7).s[n] ? XMM((modrm >> 3) & 0x7).s[n] : XMM(modrm & 0x7).s[n]; @@ -5601,6 +5735,7 @@ void i386_device::sse_pminsw_r128_rm128() // Opcode 66 0f ea void i386_device::sse_pmaxsw_r128_rm128() // Opcode 66 0f ee { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { for (int n=0;n < 8;n++) XMM((modrm >> 3) & 0x7).s[n] = XMM((modrm >> 3) & 0x7).s[n] > XMM(modrm & 0x7).s[n] ? XMM((modrm >> 3) & 0x7).s[n] : XMM(modrm & 0x7).s[n]; @@ -5617,6 +5752,7 @@ void i386_device::sse_pmaxsw_r128_rm128() // Opcode 66 0f ee void i386_device::sse_paddsb_r128_rm128() // Opcode 66 0f ec { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { for (int n=0;n < 16;n++) XMM((modrm >> 3) & 0x7).c[n]=SaturatedSignedWordToSignedByte((int16_t)XMM((modrm >> 3) & 0x7).c[n] + (int16_t)XMM(modrm & 7).c[n]); @@ -5633,6 +5769,7 @@ void i386_device::sse_paddsb_r128_rm128() // Opcode 66 0f ec void i386_device::sse_paddsw_r128_rm128() // Opcode 66 0f ed { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { for (int n=0;n < 8;n++) XMM((modrm >> 3) & 0x7).s[n]=SaturatedSignedDwordToSignedWord((int32_t)XMM((modrm >> 3) & 0x7).s[n] + (int32_t)XMM(modrm & 7).s[n]); @@ -5649,6 +5786,7 @@ void i386_device::sse_paddsw_r128_rm128() // Opcode 66 0f ed void i386_device::sse_por_r128_rm128() // Opcode 66 0f eb { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).q[0]=XMM((modrm >> 3) & 0x7).q[0] | XMM(modrm & 7).q[0]; XMM((modrm >> 3) & 0x7).q[1]=XMM((modrm >> 3) & 0x7).q[1] | XMM(modrm & 7).q[1]; @@ -5665,6 +5803,7 @@ void i386_device::sse_por_r128_rm128() // Opcode 66 0f eb void i386_device::sse_pxor_r128_rm128() // Opcode 66 0f ef { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).q[0]=XMM((modrm >> 3) & 0x7).q[0] ^ XMM(modrm & 7).q[0]; XMM((modrm >> 3) & 0x7).q[1]=XMM((modrm >> 3) & 0x7).q[1] ^ XMM(modrm & 7).q[1]; @@ -5681,6 +5820,7 @@ void i386_device::sse_pxor_r128_rm128() // Opcode 66 0f ef void i386_device::sse_pmaddwd_r128_rm128() // Opcode 66 0f f5 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { int s, d; s=modrm & 0x7; @@ -5701,6 +5841,7 @@ void i386_device::sse_pmaddwd_r128_rm128() // Opcode 66 0f f5 void i386_device::sse_psubb_r128_rm128() // Opcode 66 0f f8 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { for (int n=0;n < 16;n++) XMM((modrm >> 3) & 0x7).b[n]=XMM((modrm >> 3) & 0x7).b[n] - XMM(modrm & 7).b[n]; @@ -5717,6 +5858,7 @@ void i386_device::sse_psubb_r128_rm128() // Opcode 66 0f f8 void i386_device::sse_psubw_r128_rm128() // Opcode 66 0f f9 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { for (int n=0;n < 8;n++) XMM((modrm >> 3) & 0x7).w[n]=XMM((modrm >> 3) & 0x7).w[n] - XMM(modrm & 7).w[n]; @@ -5733,6 +5875,7 @@ void i386_device::sse_psubw_r128_rm128() // Opcode 66 0f f9 void i386_device::sse_psubd_r128_rm128() // Opcode 66 0f fa { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { for (int n=0;n < 4;n++) XMM((modrm >> 3) & 0x7).d[n]=XMM((modrm >> 3) & 0x7).d[n] - XMM(modrm & 7).d[n]; @@ -5750,6 +5893,7 @@ void i386_device::sse_psadbw_r128_rm128() // Opcode 66 0f f6 { int32_t temp; uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { temp=0; for (int n=0;n < 8;n++) @@ -5778,6 +5922,7 @@ void i386_device::sse_psadbw_r128_rm128() // Opcode 66 0f f6 void i386_device::sse_pavgb_r128_rm128() // Opcode 66 0f e0 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { for (int n=0;n < 16;n++) XMM((modrm >> 3) & 0x7).b[n] = ((uint16_t)XMM((modrm >> 3) & 0x7).b[n] + (uint16_t)XMM(modrm & 0x7).b[n] + 1) >> 1; @@ -5794,6 +5939,7 @@ void i386_device::sse_pavgb_r128_rm128() // Opcode 66 0f e0 void i386_device::sse_pavgw_r128_rm128() // Opcode 66 0f e3 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { for (int n=0;n < 8;n++) XMM((modrm >> 3) & 0x7).w[n] = ((uint32_t)XMM((modrm >> 3) & 0x7).w[n] + (uint32_t)XMM(modrm & 0x7).w[n] + 1) >> 1; @@ -5810,6 +5956,7 @@ void i386_device::sse_pavgw_r128_rm128() // Opcode 66 0f e3 void i386_device::sse_psrlw_r128_rm128() // Opcode 66 0f d1 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { int count=(int)XMM(modrm & 7).q[0]; for (int n=0; n < 8;n++) @@ -5828,6 +5975,7 @@ void i386_device::sse_psrlw_r128_rm128() // Opcode 66 0f d1 void i386_device::sse_psrld_r128_rm128() // Opcode 66 0f d2 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { int count=(int)XMM(modrm & 7).q[0]; XMM((modrm >> 3) & 0x7).d[0]=XMM((modrm >> 3) & 0x7).d[0] >> count; @@ -5850,6 +5998,7 @@ void i386_device::sse_psrld_r128_rm128() // Opcode 66 0f d2 void i386_device::sse_psrlq_r128_rm128() // Opcode 66 0f d3 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { int count=(int)XMM(modrm & 7).q[0]; XMM((modrm >> 3) & 0x7).q[0]=XMM((modrm >> 3) & 0x7).q[0] >> count; @@ -5868,6 +6017,7 @@ void i386_device::sse_psrlq_r128_rm128() // Opcode 66 0f d3 void i386_device::sse_psllw_r128_rm128() // Opcode 66 0f f1 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { int count=(int)XMM(modrm & 7).q[0]; for (int n=0; n < 8;n++) @@ -5886,6 +6036,7 @@ void i386_device::sse_psllw_r128_rm128() // Opcode 66 0f f1 void i386_device::sse_pslld_r128_rm128() // Opcode 66 0f f2 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { int count=(int)XMM(modrm & 7).q[0]; XMM((modrm >> 3) & 0x7).d[0]=XMM((modrm >> 3) & 0x7).d[0] << count; @@ -5908,6 +6059,7 @@ void i386_device::sse_pslld_r128_rm128() // Opcode 66 0f f2 void i386_device::sse_psllq_r128_rm128() // Opcode 66 0f f3 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { int count=(int)XMM(modrm & 7).q[0]; XMM((modrm >> 3) & 0x7).q[0]=XMM((modrm >> 3) & 0x7).q[0] << count; @@ -5926,6 +6078,7 @@ void i386_device::sse_psllq_r128_rm128() // Opcode 66 0f f3 void i386_device::sse_psraw_r128_rm128() // Opcode 66 0f e1 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { int count=(int)XMM(modrm & 7).q[0]; for (int n=0; n < 8;n++) @@ -5944,6 +6097,7 @@ void i386_device::sse_psraw_r128_rm128() // Opcode 66 0f e1 void i386_device::sse_psrad_r128_rm128() // Opcode 66 0f e2 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { int count=(int)XMM(modrm & 7).q[0]; XMM((modrm >> 3) & 0x7).i[0]=XMM((modrm >> 3) & 0x7).i[0] >> count; @@ -5966,6 +6120,7 @@ void i386_device::sse_psrad_r128_rm128() // Opcode 66 0f e2 void i386_device::sse_movntdq_m128_r128() // Opcode 66 0f e7 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { CYCLES(1); // unsupported } else { @@ -5979,6 +6134,7 @@ void i386_device::sse_movntdq_m128_r128() // Opcode 66 0f e7 void i386_device::sse_cvttpd2dq_r128_rm128() // Opcode 66 0f e6 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).i[0]=(int32_t)XMM((modrm >> 3) & 0x7).f64[0]; XMM((modrm >> 3) & 0x7).i[1]=(int32_t)XMM((modrm >> 3) & 0x7).f64[1]; @@ -5997,6 +6153,7 @@ void i386_device::sse_cvttpd2dq_r128_rm128() // Opcode 66 0f e6 void i386_device::sse_movq_r128m64_r128() // Opcode 66 0f d6 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM(modrm & 0x7).q[0]=XMM((modrm >> 3) & 0x7).q[0]; XMM(modrm & 0x7).q[1] = 0; @@ -6010,6 +6167,7 @@ void i386_device::sse_movq_r128m64_r128() // Opcode 66 0f d6 void i386_device::sse_addsubpd_r128_rm128() // Opcode 66 0f d0 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { int s, d; s=modrm & 0x7; @@ -6031,6 +6189,7 @@ void i386_device::sse_addsubpd_r128_rm128() // Opcode 66 0f d0 void i386_device::sse_haddpd_r128_rm128() // Opcode 66 0f 7c { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM_REG t; int s, d; @@ -6055,6 +6214,7 @@ void i386_device::sse_haddpd_r128_rm128() // Opcode 66 0f 7c void i386_device::sse_hsubpd_r128_rm128() // Opcode 66 0f 7d { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM_REG t; int s, d; @@ -6079,6 +6239,7 @@ void i386_device::sse_hsubpd_r128_rm128() // Opcode 66 0f 7d void i386_device::sse_sqrtpd_r128_rm128() // Opcode 66 0f 51 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { int s, d; s=modrm & 0x7; @@ -6106,6 +6267,7 @@ void i386_device::sse_cvtpi2pd_r128_rm64() // Opcode 66 0f 2a XMM((modrm >> 3) & 0x7).f64[1] = (double)MMX(modrm & 0x7).i[1]; } else { MMX_REG r; + if(SSEPROLOG()) return; uint32_t ea = GetEA(modrm, 0); READMMX(ea, r); XMM((modrm >> 3) & 0x7).f64[0] = (double)r.i[0]; @@ -6153,6 +6315,7 @@ void i386_device::sse_cvtpd2pi_r64_rm128() // Opcode 66 0f 2d void i386_device::sse_cvtpd2ps_r128_rm128() // Opcode 66 0f 5a { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0] = (float)XMM(modrm & 0x7).f64[0]; XMM((modrm >> 3) & 0x7).f[1] = (float)XMM(modrm & 0x7).f64[1]; @@ -6171,6 +6334,7 @@ void i386_device::sse_cvtpd2ps_r128_rm128() // Opcode 66 0f 5a void i386_device::sse_cvtps2dq_r128_rm128() // Opcode 66 0f 5b { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).i[0] = XMM(modrm & 0x7).f[0]; XMM((modrm >> 3) & 0x7).i[1] = XMM(modrm & 0x7).f[1]; @@ -6191,6 +6355,7 @@ void i386_device::sse_cvtps2dq_r128_rm128() // Opcode 66 0f 5b void i386_device::sse_addpd_r128_rm128() // Opcode 66 0f 58 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f64[0] = XMM((modrm >> 3) & 0x7).f64[0] + XMM(modrm & 0x7).f64[0]; XMM((modrm >> 3) & 0x7).f64[1] = XMM((modrm >> 3) & 0x7).f64[1] + XMM(modrm & 0x7).f64[1]; @@ -6207,6 +6372,7 @@ void i386_device::sse_addpd_r128_rm128() // Opcode 66 0f 58 void i386_device::sse_mulpd_r128_rm128() // Opcode 66 0f 59 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f64[0] = XMM((modrm >> 3) & 0x7).f64[0] * XMM(modrm & 0x7).f64[0]; XMM((modrm >> 3) & 0x7).f64[1] = XMM((modrm >> 3) & 0x7).f64[1] * XMM(modrm & 0x7).f64[1]; @@ -6223,6 +6389,7 @@ void i386_device::sse_mulpd_r128_rm128() // Opcode 66 0f 59 void i386_device::sse_subpd_r128_rm128() // Opcode 66 0f 5c { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f64[0] = XMM((modrm >> 3) & 0x7).f64[0] - XMM(modrm & 0x7).f64[0]; XMM((modrm >> 3) & 0x7).f64[1] = XMM((modrm >> 3) & 0x7).f64[1] - XMM(modrm & 0x7).f64[1]; @@ -6239,6 +6406,7 @@ void i386_device::sse_subpd_r128_rm128() // Opcode 66 0f 5c void i386_device::sse_minpd_r128_rm128() // Opcode 66 0f 5d { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f64[0] = sse_min_double(XMM((modrm >> 3) & 0x7).f64[0], XMM(modrm & 0x7).f64[0]); XMM((modrm >> 3) & 0x7).f64[1] = sse_min_double(XMM((modrm >> 3) & 0x7).f64[1], XMM(modrm & 0x7).f64[1]); @@ -6255,6 +6423,7 @@ void i386_device::sse_minpd_r128_rm128() // Opcode 66 0f 5d void i386_device::sse_divpd_r128_rm128() // Opcode 66 0f 5e { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f64[0] = XMM((modrm >> 3) & 0x7).f64[0] / XMM(modrm & 0x7).f64[0]; XMM((modrm >> 3) & 0x7).f64[1] = XMM((modrm >> 3) & 0x7).f64[1] / XMM(modrm & 0x7).f64[1]; @@ -6271,6 +6440,7 @@ void i386_device::sse_divpd_r128_rm128() // Opcode 66 0f 5e void i386_device::sse_maxpd_r128_rm128() // Opcode 66 0f 5f { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f64[0] = sse_max_double(XMM((modrm >> 3) & 0x7).f64[0], XMM(modrm & 0x7).f64[0]); XMM((modrm >> 3) & 0x7).f64[1] = sse_max_double(XMM((modrm >> 3) & 0x7).f64[1], XMM(modrm & 0x7).f64[1]); @@ -6287,6 +6457,7 @@ void i386_device::sse_maxpd_r128_rm128() // Opcode 66 0f 5f void i386_device::sse_movntpd_m128_r128() // Opcode 66 0f 2b { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { // unsupported by cpu CYCLES(1); // TODO: correct cycle count @@ -6301,6 +6472,7 @@ void i386_device::sse_movntpd_m128_r128() // Opcode 66 0f 2b void i386_device::sse_movapd_r128_rm128() // Opcode 66 0f 28 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7) = XMM(modrm & 0x7); } else { @@ -6313,6 +6485,7 @@ void i386_device::sse_movapd_r128_rm128() // Opcode 66 0f 28 void i386_device::sse_movapd_rm128_r128() // Opcode 66 0f 29 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM(modrm & 0x7) = XMM((modrm >> 3) & 0x7); } else { @@ -6325,6 +6498,7 @@ void i386_device::sse_movapd_rm128_r128() // Opcode 66 0f 29 void i386_device::sse_movsd_r128_r128m64() // Opcode f2 0f 10 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).q[0] = XMM(modrm & 0x7).q[0]; } else { @@ -6338,6 +6512,7 @@ void i386_device::sse_movsd_r128_r128m64() // Opcode f2 0f 10 void i386_device::sse_movsd_r128m64_r128() // Opcode f2 0f 11 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM(modrm & 0x7).q[0] = XMM((modrm >> 3) & 0x7).q[0]; } else { @@ -6350,6 +6525,7 @@ void i386_device::sse_movsd_r128m64_r128() // Opcode f2 0f 11 void i386_device::sse_movddup_r128_r128m64() // Opcode f2 0f 12 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).q[0] = XMM(modrm & 0x7).q[0]; XMM((modrm >> 3) & 0x7).q[1] = XMM((modrm >> 3) & 0x7).q[0]; @@ -6364,6 +6540,7 @@ void i386_device::sse_movddup_r128_r128m64() // Opcode f2 0f 12 void i386_device::sse_cvtsi2sd_r128_rm32() // Opcode f2 0f 2a { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f64[0] = (int32_t)LOAD_RM32(modrm); } else { @@ -6377,6 +6554,7 @@ void i386_device::sse_cvttsd2si_r32_r128m64() // Opcode f2 0f 2c { int32_t src; uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { src = (int32_t)XMM(modrm & 0x7).f64[0]; } else { // otherwise is a memory address @@ -6393,6 +6571,7 @@ void i386_device::sse_cvtsd2si_r32_r128m64() // Opcode f2 0f 2d { int32_t src; uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { src = (int32_t)XMM(modrm & 0x7).f64[0]; } else { // otherwise is a memory address @@ -6408,6 +6587,7 @@ void i386_device::sse_cvtsd2si_r32_r128m64() // Opcode f2 0f 2d void i386_device::sse_sqrtsd_r128_r128m64() // Opcode f2 0f 51 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { int s, d; s=modrm & 0x7; @@ -6427,6 +6607,7 @@ void i386_device::sse_sqrtsd_r128_r128m64() // Opcode f2 0f 51 void i386_device::sse_addsd_r128_r128m64() // Opcode f2 0f 58 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f64[0] = XMM((modrm >> 3) & 0x7).f64[0] + XMM(modrm & 0x7).f64[0]; } else { @@ -6441,6 +6622,7 @@ void i386_device::sse_addsd_r128_r128m64() // Opcode f2 0f 58 void i386_device::sse_mulsd_r128_r128m64() // Opcode f2 0f 59 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f64[0] = XMM((modrm >> 3) & 0x7).f64[0] * XMM(modrm & 0x7).f64[0]; } else { @@ -6455,6 +6637,7 @@ void i386_device::sse_mulsd_r128_r128m64() // Opcode f2 0f 59 void i386_device::sse_cvtsd2ss_r128_r128m64() // Opcode f2 0f 5a { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0] = XMM(modrm & 0x7).f64[0]; } else { @@ -6469,6 +6652,7 @@ void i386_device::sse_cvtsd2ss_r128_r128m64() // Opcode f2 0f 5a void i386_device::sse_subsd_r128_r128m64() // Opcode f2 0f 5c { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f64[0] = XMM((modrm >> 3) & 0x7).f64[0] - XMM(modrm & 0x7).f64[0]; } else { @@ -6483,6 +6667,7 @@ void i386_device::sse_subsd_r128_r128m64() // Opcode f2 0f 5c void i386_device::sse_minsd_r128_r128m64() // Opcode f2 0f 5d { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f64[0] = sse_min_double(XMM((modrm >> 3) & 0x7).f64[0], XMM(modrm & 0x7).f64[0]); } else { @@ -6497,6 +6682,7 @@ void i386_device::sse_minsd_r128_r128m64() // Opcode f2 0f 5d void i386_device::sse_divsd_r128_r128m64() // Opcode f2 0f 5e { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f64[0] = XMM((modrm >> 3) & 0x7).f64[0] / XMM(modrm & 0x7).f64[0]; } else { @@ -6511,6 +6697,7 @@ void i386_device::sse_divsd_r128_r128m64() // Opcode f2 0f 5e void i386_device::sse_maxsd_r128_r128m64() // Opcode f2 0f 5f { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f64[0] = sse_max_double(XMM((modrm >> 3) & 0x7).f64[0], XMM(modrm & 0x7).f64[0]); } else { @@ -6525,6 +6712,7 @@ void i386_device::sse_maxsd_r128_r128m64() // Opcode f2 0f 5f void i386_device::sse_haddps_r128_rm128() // Opcode f2 0f 7c { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { int s, d; float f1, f2, f3, f4; @@ -6558,6 +6746,7 @@ void i386_device::sse_haddps_r128_rm128() // Opcode f2 0f 7c void i386_device::sse_hsubps_r128_rm128() // Opcode f2 0f 7d { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { int s, d; float f1, f2, f3, f4; @@ -6591,6 +6780,7 @@ void i386_device::sse_hsubps_r128_rm128() // Opcode f2 0f 7d void i386_device::sse_cmpsd_r128_r128m64_i8() // Opcode f2 0f c2 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { int s,d; uint8_t imm8 = FETCH(); @@ -6612,6 +6802,7 @@ void i386_device::sse_cmpsd_r128_r128m64_i8() // Opcode f2 0f c2 void i386_device::sse_addsubps_r128_rm128() // Opcode f2 0f d0 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).f[0]=XMM((modrm >> 3) & 0x7).f[0] - XMM(modrm & 0x7).f[0]; XMM((modrm >> 3) & 0x7).f[1]=XMM((modrm >> 3) & 0x7).f[1] + XMM(modrm & 0x7).f[1]; @@ -6645,6 +6836,7 @@ void i386_device::sse_movdq2q_r64_r128() // Opcode f2 0f d6 void i386_device::sse_cvtpd2dq_r128_rm128() // Opcode f2 0f e6 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { XMM((modrm >> 3) & 0x7).i[0]=(int32_t)XMM((modrm >> 3) & 0x7).f64[0]; XMM((modrm >> 3) & 0x7).i[1]=(int32_t)XMM((modrm >> 3) & 0x7).f64[1]; @@ -6663,6 +6855,7 @@ void i386_device::sse_cvtpd2dq_r128_rm128() // Opcode f2 0f e6 void i386_device::sse_lddqu_r128_m128() // Opcode f2 0f f0 { uint8_t modrm = FETCH(); + if(SSEPROLOG()) return; if( modrm >= 0xc0 ) { // unsupported by cpu CYCLES(1); // TODO: correct cycle count -- cgit v1.2.3