diff --git a/bochs/.bochsrc b/bochs/.bochsrc index d35c2eb99..7ea6de784 100644 --- a/bochs/.bochsrc +++ b/bochs/.bochsrc @@ -142,6 +142,10 @@ cpu: count=1, ips=50000000, reset_on_triple_fault=1, ignore_bad_msrs=1, msrs="ms # # This defines features and functionality supported by Bochs emulated CPU: # +# SEP: +# Select SYSENTER/SYSEXIT instruction set support. +# This option exists only if Bochs compiled with BX_CPU_LEVEL >= 6. +# # SSE: # Select SSE instruction set support. # Any of SSE/SSE2/SSE3/SSSE3/SSE4_1/SSE4_2 could be selected. @@ -167,7 +171,7 @@ cpu: count=1, ips=50000000, reset_on_triple_fault=1, ignore_bad_msrs=1, msrs="ms # Determine whether to limit maximum CPUID function to 3. This mode is # required to workaround WinNT installation and boot issues. #======================================================================= -cpuid: sse=sse4_2, aes=1, movbe=1, cpuid_limit_winnt=0 +cpuid: sep=1, sse=sse4_2, aes=1, movbe=1, cpuid_limit_winnt=0 #======================================================================= # MEMORY diff --git a/bochs/CHANGES b/bochs/CHANGES index ae002ddb7..5d7b1b671 100644 --- a/bochs/CHANGES +++ b/bochs/CHANGES @@ -29,10 +29,11 @@ Detailed change log : configure option is deprecated and should not be used anymore. - Enable changing of part of CPU functionality at runtime through .bochsrc - instead of configure time. Now you could choose to emulate any of - SSE/AES/MOVBE instruction sets using new CPUID option in .bochsrc. - Configure options --enable-sse, --enable-aes, --enable-movbe are - deprecated and should not be used anymore. + Now you could enable/disable any of SSEx/AES/MOVBE/SYSENTER_SYSEXIT + instruction sets using new CPUID option in .bochsrc. + Configure options + --enable-sse, --enable-aes, --enable-movbe, --enable-sep + are deprecated and should not be used anymore. - CPU - Implemented PCLMULQDQ AES instruction diff --git a/bochs/config.cc b/bochs/config.cc index c62b56339..7000b47fa 100755 --- a/bochs/config.cc +++ b/bochs/config.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: config.cc,v 1.193 2010-02-25 22:34:56 sshwarts Exp $ +// $Id: config.cc,v 1.194 2010-02-26 11:44:49 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2002-2009 The Bochs Project @@ -392,7 +392,7 @@ void bx_init_options() "sse", "Support for SSE instruction set", "Support for SSE/SSE2/SSE3/SSSE3/SSE4_1/SSE4_2 instruction set", sse_names, - BX_CPUID_SUPPORT_NOSSE, + BX_CPUID_SUPPORT_SSE2, BX_CPUID_SUPPORT_NOSSE); new bx_param_bool_c(cpuid_param, "movbe", "Support for MOVBE instruction", @@ -402,6 +402,10 @@ void bx_init_options() "aes", "Support for AES instruction set", "Support for AES instruction set", 0); + new bx_param_bool_c(cpuid_param, + "sep", "Support for SYSENTER/SYSEXIT instructions", + "Support for SYSENTER/SYSEXIT instructions", + (BX_CPU_LEVEL >= 6 && BX_SUPPORT_MMX) || BX_SUPPORT_X86_64); #endif cpuid_param->set_options(menu->SHOW_PARENT); @@ -2604,6 +2608,12 @@ static int parse_line_formatted(const char *context, int num_params, char *param } else { PARSE_ERR(("%s: cpuid directive malformed.", context)); } + } else if (!strncmp(params[i], "sep=", 4)) { + if (params[i][4] == '0' || params[i][4] == '1') { + SIM->get_param_bool(BXPN_CPUID_SEP)->set(params[i][4] - '0'); + } else { + PARSE_ERR(("%s: cpuid directive malformed.", context)); + } #endif } else { PARSE_ERR(("%s: cpuid directive malformed.", context)); @@ -3766,8 +3776,9 @@ int bx_write_configuration(const char *rc, int overwrite) fprintf(fp, "\n"); fprintf(fp, "cpuid: cpuid_limit_winnt=%d", SIM->get_param_bool(BXPN_CPUID_LIMIT_WINNT)->get()); #if BX_CPU_LEVEL >= 6 - fprintf(fp, ", sse=%s, aes=%d, movbe=%d", + fprintf(fp, ", sse=%s, sep=%d, aes=%d, movbe=%d", SIM->get_param_enum(BXPN_CPUID_SSE)->get_selected(), + SIM->get_param_bool(BXPN_CPUID_SEP)->get(), SIM->get_param_bool(BXPN_CPUID_AES)->get(), SIM->get_param_bool(BXPN_CPUID_MOVBE)->get()); #endif diff --git a/bochs/config.h.in b/bochs/config.h.in index 55caa18a6..d9bd22bb5 100644 --- a/bochs/config.h.in +++ b/bochs/config.h.in @@ -686,7 +686,6 @@ typedef #define BX_SUPPORT_MMX 0 #define BX_SUPPORT_3DNOW 0 #define BX_SUPPORT_MISALIGNED_SSE 0 -#define BX_SUPPORT_SEP 0 #define BX_SUPPORT_MONITOR_MWAIT 0 #define BX_SUPPORT_XSAVE 0 #define BX_SUPPORT_VMX 0 @@ -738,18 +737,10 @@ typedef #error "3DNow! cannot be compiled without MMX support !" #endif -#if (BX_CPU_LEVEL<6 && BX_SUPPORT_SEP) - #error "SYSENTER/SYSEXIT only supported with CPU_LEVEL >= 6 !" -#endif - #if (BX_CPU_LEVEL<6 && BX_SUPPORT_VMX) #error "VMX only supported with CPU_LEVEL >= 6 !" #endif -#if (BX_SUPPORT_VMX && BX_SUPPORT_SEP == 0) - #error "SYSENTER/SYSEXIT is required for VMX support !" -#endif - #if (BX_SUPPORT_X86_64 == 0 && BX_SUPPORT_1G_PAGES) #error "1G only supported with x86-64 !" #endif diff --git a/bochs/configure b/bochs/configure index 978850323..0dbcb6b86 100755 --- a/bochs/configure +++ b/bochs/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Id: configure.in,v 1.424 2010/02/24 20:59:49 sshwarts Exp . +# From configure.in Id: configure.in,v 1.425 2010/02/25 22:04:30 sshwarts Exp . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.65. # @@ -977,7 +977,6 @@ enable_3dnow enable_xsave enable_alignment_check enable_misaligned_sse -enable_sep enable_xapic enable_monitor_mwait enable_x86_debugger @@ -1006,6 +1005,7 @@ enable_sse_extension enable_popcnt enable_movbe enable_aes +enable_sep enable_apic enable_ignore_bad_msr enable_pae @@ -1696,7 +1696,6 @@ Optional Features: --enable-xsave support for XSAVE/XRSTOR extensions --enable-alignment-check alignment check (#AC) support --enable-misaligned-sse misaligned SSE support - --enable-sep SYSENTER/SYSEXIT support --enable-xapic support for XAPIC extensions --enable-monitor-mwait support for MONITOR/MWAIT instructions (experimental) --enable-x86-debugger x86 debugger support @@ -1712,6 +1711,7 @@ Optional Features: --enable-popcnt support for POPCNT intruction (deprecated) --enable-movbe support for MOVBE intruction (deprecated) --enable-aes support for AES intruction set (deprecated) + --enable-sep support for SYSENTER/SYSEXIT intructions (deprecated) --enable-apic enable APIC support (deprecated) --enable-ignore-bad-msr ignore bad MSR references (deprecated) --enable-pae enables PAE support (deprecated) @@ -23025,7 +23025,6 @@ $as_echo "no" >&6; } fi -support_mmx=1 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MMX support" >&5 $as_echo_n "checking for MMX support... " >&6; } # Check whether --enable-mmx was given. @@ -23040,7 +23039,6 @@ $as_echo "yes" >&6; } $as_echo "no" >&6; } $as_echo "#define BX_SUPPORT_MMX 0" >>confdefs.h - support_mmx=0 fi else @@ -23178,40 +23176,6 @@ $as_echo "no" >&6; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SEP support" >&5 -$as_echo_n "checking for SEP support... " >&6; } -# Check whether --enable-sep was given. -if test "${enable_sep+set}" = set; then : - enableval=$enable_sep; if test "$enableval" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - $as_echo "#define BX_SUPPORT_SEP 1" >>confdefs.h - - elif test "$enableval" = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - $as_echo "#define BX_SUPPORT_SEP 0" >>confdefs.h - - fi - -else - - if test "$bx_cpu_level" -ge 6 -a "$support_mmx" = 1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - $as_echo "#define BX_SUPPORT_SEP 1" >>confdefs.h - - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - $as_echo "#define BX_SUPPORT_SEP 0" >>confdefs.h - - fi - - -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XAPIC support" >&5 $as_echo_n "checking for XAPIC support... " >&6; } # Check whether --enable-xapic was given. @@ -25161,6 +25125,22 @@ $as_echo "no" >&6; } fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SEP support (deprecated)" >&5 +$as_echo_n "checking for SEP support (deprecated)... " >&6; } +# Check whether --enable-sep was given. +if test "${enable_sep+set}" = set; then : + enableval=$enable_sep; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5 +$as_echo "$enableval" >&6; } + as_fn_error "DEPRECATED - moved to .bochsrc options" "$LINENO" 5 + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for APIC support (deprecated)" >&5 $as_echo_n "checking for APIC support (deprecated)... " >&6; } # Check whether --enable-apic was given. diff --git a/bochs/configure.in b/bochs/configure.in index 41ecde9b0..05f63c10a 100644 --- a/bochs/configure.in +++ b/bochs/configure.in @@ -2,7 +2,7 @@ dnl // Process this file with autoconf to produce a configure script. AC_PREREQ(2.50) AC_INIT(bochs.h) -AC_REVISION([[$Id: configure.in,v 1.425 2010-02-25 22:04:30 sshwarts Exp $]]) +AC_REVISION([[$Id: configure.in,v 1.426 2010-02-26 11:44:50 sshwarts Exp $]]) AC_CONFIG_HEADER(config.h) AC_CONFIG_HEADER(ltdlconf.h) @@ -1408,7 +1408,6 @@ AC_ARG_ENABLE(vmx, ] ) -support_mmx=1 AC_MSG_CHECKING(for MMX support) AC_ARG_ENABLE(mmx, [ --enable-mmx MMX support], @@ -1418,7 +1417,6 @@ AC_ARG_ENABLE(mmx, elif test "$enableval" = no; then AC_MSG_RESULT(no) AC_DEFINE(BX_SUPPORT_MMX, 0) - support_mmx=0 fi ], [ @@ -1507,28 +1505,6 @@ AC_ARG_ENABLE(misaligned-sse, ] ) -AC_MSG_CHECKING(for SEP support) -AC_ARG_ENABLE(sep, - [ --enable-sep SYSENTER/SYSEXIT support], - [if test "$enableval" = yes; then - AC_MSG_RESULT(yes) - AC_DEFINE(BX_SUPPORT_SEP, 1) - elif test "$enableval" = no; then - AC_MSG_RESULT(no) - AC_DEFINE(BX_SUPPORT_SEP, 0) - fi - ], - [ - if test "$bx_cpu_level" -ge 6 -a "$support_mmx" = 1; then - AC_MSG_RESULT(yes) - AC_DEFINE(BX_SUPPORT_SEP, 1) - else - AC_MSG_RESULT(no) - AC_DEFINE(BX_SUPPORT_SEP, 0) - fi - ] - ) - AC_MSG_CHECKING(for XAPIC support) AC_ARG_ENABLE(xapic, [ --enable-xapic support for XAPIC extensions], @@ -2721,6 +2697,16 @@ AC_ARG_ENABLE(aes, AC_MSG_RESULT(no) ]) +AC_MSG_CHECKING(for SEP support (deprecated)) +AC_ARG_ENABLE(sep, + [ --enable-sep support for SYSENTER/SYSEXIT intructions (deprecated)], + [AC_MSG_RESULT($enableval) + AC_MSG_ERROR([DEPRECATED - moved to .bochsrc options]) + ], + [ + AC_MSG_RESULT(no) + ]) + AC_MSG_CHECKING(for APIC support (deprecated)) AC_ARG_ENABLE(apic, [ --enable-apic enable APIC support (deprecated)], diff --git a/bochs/cpu/aes.cc b/bochs/cpu/aes.cc index 766bed115..4a9771846 100755 --- a/bochs/cpu/aes.cc +++ b/bochs/cpu/aes.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: aes.cc,v 1.9 2010-02-25 22:04:30 sshwarts Exp $ +// $Id: aes.cc,v 1.10 2010-02-26 11:44:50 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (c) 2008-2009 Stanislav Shwartsman @@ -26,6 +26,8 @@ #include "cpu.h" #define LOG_THIS BX_CPU_THIS_PTR +#if BX_CPU_LEVEL >= 6 + // // XMM - Byte Representation of a 128-bit AES State // @@ -285,9 +287,12 @@ BX_CPP_INLINE Bit32u AES_RotWord(Bit32u x) return (x >> 8) | (x << 24); } +#endif + /* 66 0F 38 DB */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::AESIMC_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op; @@ -305,11 +310,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::AESIMC_VdqWdq(bxInstruction_c *i) AES_InverseMixColumns(op); BX_WRITE_XMM_REG(i->nnn(), op); +#endif } /* 66 0F 38 DC */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::AESENC_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -332,11 +339,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::AESENC_VdqWdq(bxInstruction_c *i) op1.xmm64u(1) ^= op2.xmm64u(1); BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F 38 DD */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::AESENCLAST_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -358,11 +367,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::AESENCLAST_VdqWdq(bxInstruction_c *i) op1.xmm64u(1) ^= op2.xmm64u(1); BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F 38 DE */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::AESDEC_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -385,11 +396,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::AESDEC_VdqWdq(bxInstruction_c *i) op1.xmm64u(1) ^= op2.xmm64u(1); BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F 38 DF */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::AESDECLAST_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -411,11 +424,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::AESDECLAST_VdqWdq(bxInstruction_c *i) op1.xmm64u(1) ^= op2.xmm64u(1); BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F 3A DF */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::AESKEYGENASSIST_VdqWdqIb(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op, result; @@ -438,11 +453,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::AESKEYGENASSIST_VdqWdqIb(bxInstruction_c * result.xmm32u(3) = AES_RotWord(result.xmm32u(2)) ^ rcon32; BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* 66 0F 3A 44 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PCLMULQDQ_VdqWdqIb(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2, r, a; @@ -484,4 +501,5 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PCLMULQDQ_VdqWdqIb(bxInstruction_c *i) } BX_WRITE_XMM_REG(i->nnn(), r); +#endif } diff --git a/bochs/cpu/arith16.cc b/bochs/cpu/arith16.cc index bef488bb0..2c073569f 100644 --- a/bochs/cpu/arith16.cc +++ b/bochs/cpu/arith16.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: arith16.cc,v 1.73 2009-12-04 16:53:12 sshwarts Exp $ +// $Id: arith16.cc,v 1.74 2010-02-26 11:44:50 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001-2009 The Bochs Project @@ -275,7 +275,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CWD(bxInstruction_c *i) void BX_CPP_AttrRegparmN(1) BX_CPU_C::XADD_EwGwM(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 4 Bit16u op1_16, op2_16, sum_16; /* XADD dst(r/m), src(r) @@ -295,15 +294,10 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::XADD_EwGwM(bxInstruction_c *i) BX_WRITE_16BIT_REG(i->nnn(), op1_16); SET_FLAGS_OSZAPC_ADD_16(op1_16, op2_16, sum_16); -#else - BX_INFO(("XADD_EwGw: not supported on < 80486")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::XADD_EwGwR(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 4 Bit16u op1_16, op2_16, sum_16; /* XADD dst(r/m), src(r) @@ -324,10 +318,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::XADD_EwGwR(bxInstruction_c *i) BX_WRITE_16BIT_REG(i->rm(), sum_16); SET_FLAGS_OSZAPC_ADD_16(op1_16, op2_16, sum_16); -#else - BX_INFO(("XADD_EwGw: not supported on < 80486")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::ADD_EwIwM(bxInstruction_c *i) @@ -474,7 +464,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::DEC_EwM(bxInstruction_c *i) void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMPXCHG_EwGwM(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 4 Bit16u op1_16, op2_16, diff_16; bx_address eaddr = BX_CPU_CALL_METHODR(i->ResolveModrm, (i)); @@ -492,15 +481,10 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMPXCHG_EwGwM(bxInstruction_c *i) // accumulator <-- dest AX = op1_16; } -#else - BX_INFO(("CMPXCHG_EwGw: not supported for cpu-level <= 3")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMPXCHG_EwGwR(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 4 Bit16u op1_16, op2_16, diff_16; op1_16 = BX_READ_16BIT_REG(i->rm()); @@ -516,8 +500,4 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMPXCHG_EwGwR(bxInstruction_c *i) // accumulator <-- dest AX = op1_16; } -#else - BX_INFO(("CMPXCHG_EwGw: not supported for cpu-level <= 3")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } diff --git a/bochs/cpu/arith32.cc b/bochs/cpu/arith32.cc index 3496b141d..58e91f222 100644 --- a/bochs/cpu/arith32.cc +++ b/bochs/cpu/arith32.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: arith32.cc,v 1.84 2009-12-04 16:53:12 sshwarts Exp $ +// $Id: arith32.cc,v 1.85 2010-02-26 11:44:50 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001-2009 The Bochs Project @@ -315,7 +315,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMPXCHG_IBTS(bxInstruction_c *i) void BX_CPP_AttrRegparmN(1) BX_CPU_C::XADD_EdGdM(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 4 Bit32u op1_32, op2_32, sum_32; /* XADD dst(r/m), src(r) @@ -335,15 +334,10 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::XADD_EdGdM(bxInstruction_c *i) BX_WRITE_32BIT_REGZ(i->nnn(), op1_32); SET_FLAGS_OSZAPC_ADD_32(op1_32, op2_32, sum_32); -#else - BX_INFO (("XADD_EdGd not supported for cpulevel <= 3")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::XADD_EdGdR(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 4 Bit32u op1_32, op2_32, sum_32; /* XADD dst(r/m), src(r) @@ -364,10 +358,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::XADD_EdGdR(bxInstruction_c *i) BX_WRITE_32BIT_REGZ(i->rm(), sum_32); SET_FLAGS_OSZAPC_ADD_32(op1_32, op2_32, sum_32); -#else - BX_INFO (("XADD_EdGd not supported for cpulevel <= 3")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::ADD_EdIdM(bxInstruction_c *i) @@ -523,7 +513,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::DEC_EdM(bxInstruction_c *i) void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMPXCHG_EdGdM(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 4 Bit32u op1_32, op2_32, diff_32; bx_address eaddr = BX_CPU_CALL_METHODR(i->ResolveModrm, (i)); @@ -541,15 +530,10 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMPXCHG_EdGdM(bxInstruction_c *i) // accumulator <-- dest RAX = op1_32; } -#else - BX_INFO(("CMPXCHG_EdGd: not supported for cpulevel <= 3")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMPXCHG_EdGdR(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 4 Bit32u op1_32, op2_32, diff_32; op1_32 = BX_READ_32BIT_REG(i->rm()); @@ -565,15 +549,10 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMPXCHG_EdGdR(bxInstruction_c *i) // accumulator <-- dest RAX = op1_32; } -#else - BX_INFO(("CMPXCHG_EdGd: not supported for cpulevel <= 3")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMPXCHG8B(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 5 Bit64u op1_64, op2_64; bx_address eaddr = BX_CPU_CALL_METHODR(i->ResolveModrm, (i)); @@ -594,9 +573,4 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMPXCHG8B(bxInstruction_c *i) RDX = GET32H(op1_64); clear_ZF(); } - -#else - BX_INFO(("CMPXCHG8B: not supported for cpulevel <= 4")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } diff --git a/bochs/cpu/arith8.cc b/bochs/cpu/arith8.cc index 2225c5551..064093ea5 100644 --- a/bochs/cpu/arith8.cc +++ b/bochs/cpu/arith8.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: arith8.cc,v 1.62 2009-12-04 16:53:12 sshwarts Exp $ +// $Id: arith8.cc,v 1.63 2010-02-26 11:44:50 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001-2009 The Bochs Project @@ -245,7 +245,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMP_ALIb(bxInstruction_c *i) void BX_CPP_AttrRegparmN(1) BX_CPU_C::XADD_EbGbM(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 4 Bit8u op1, op2, sum; /* XADD dst(r/m8), src(r8) @@ -265,15 +264,10 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::XADD_EbGbM(bxInstruction_c *i) BX_WRITE_8BIT_REGx(i->nnn(), i->extend8bitL(), op1); SET_FLAGS_OSZAPC_ADD_8(op1, op2, sum); -#else - BX_INFO(("XADD_EbGb: not supported on < 80486")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::XADD_EbGbR(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 4 Bit8u op1, op2, sum; /* XADD dst(r/m8), src(r8) @@ -294,10 +288,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::XADD_EbGbR(bxInstruction_c *i) BX_WRITE_8BIT_REGx(i->rm(), i->extend8bitL(), sum); SET_FLAGS_OSZAPC_ADD_8(op1, op2, sum); -#else - BX_INFO(("XADD_EbGb: not supported on < 80486")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::ADD_EbIbM(bxInstruction_c *i) diff --git a/bochs/cpu/bit.cc b/bochs/cpu/bit.cc index 61dccbf32..b839ebc7c 100644 --- a/bochs/cpu/bit.cc +++ b/bochs/cpu/bit.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: bit.cc,v 1.66 2010-02-25 22:04:30 sshwarts Exp $ +// $Id: bit.cc,v 1.67 2010-02-26 11:44:50 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001-2009 The Bochs Project @@ -238,7 +238,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::SETNLE_EbR(bxInstruction_c *i) void BX_CPP_AttrRegparmN(1) BX_CPU_C::BSWAP_ERX(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 4 Bit32u val32, b0, b1, b2, b3; if (i->os32L() == 0) { @@ -253,10 +252,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::BSWAP_ERX(bxInstruction_c *i) val32 = (b0<<24) | (b1<<16) | (b2<<8) | b3; BX_WRITE_32BIT_REGZ(i->opcodeReg(), val32); -#else - BX_INFO(("BSWAP_ERX: required CPU >= 4, use --enable-cpu-level=4 option")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } #if BX_SUPPORT_X86_64 diff --git a/bochs/cpu/cpu.h b/bochs/cpu/cpu.h index d4456e1c6..0664ce5df 100644 --- a/bochs/cpu/cpu.h +++ b/bochs/cpu/cpu.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: cpu.h,v 1.640 2010-02-25 22:04:30 sshwarts Exp $ +// $Id: cpu.h,v 1.641 2010-02-26 11:44:50 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001-2009 The Bochs Project @@ -285,10 +285,10 @@ struct BxExceptionInfo { #define BX_MSR_TSC 0x010 #define BX_MSR_APICBASE 0x01b -#if BX_SUPPORT_SEP -# define BX_MSR_SYSENTER_CS 0x174 -# define BX_MSR_SYSENTER_ESP 0x175 -# define BX_MSR_SYSENTER_EIP 0x176 +#if BX_CPU_LEVEL >= 6 + #define BX_MSR_SYSENTER_CS 0x174 + #define BX_MSR_SYSENTER_ESP 0x175 + #define BX_MSR_SYSENTER_EIP 0x176 #endif #define BX_MSR_DEBUGCTLMSR 0x1d9 @@ -574,7 +574,7 @@ typedef struct Bit64u tsc_last_reset; // SYSENTER/SYSEXIT instruction msr's -#if BX_SUPPORT_SEP +#if BX_CPU_LEVEL >= 6 Bit32u sysenter_cs_msr; bx_address sysenter_esp_msr; bx_address sysenter_eip_msr; @@ -755,6 +755,9 @@ typedef struct { #if BX_SUPPORT_FPU #include "cpu/i387.h" +#endif + +#if BX_CPU_LEVEL >= 6 #include "cpu/xmm.h" #endif @@ -892,9 +895,11 @@ public: // for now... i387_t the_i387; #endif +#if BX_CPU_LEVEL >= 6 bx_xmm_reg_t xmm[BX_XMM_REGISTERS]; // need TMP XMM register ? bx_mxcsr_t mxcsr; Bit32u mxcsr_mask; +#endif #if BX_SUPPORT_MONITOR_MWAIT monitor_addr_t monitor; @@ -3330,9 +3335,11 @@ public: // for now... BX_SMF void prepareFPU2MMX(void); /* cause transition from FPU to MMX technology state */ BX_SMF void print_state_MMX(void); +#if BX_CPU_LEVEL >= 6 BX_SMF void prepareSSE(void); BX_SMF void check_exceptionsSSE(int); BX_SMF void print_state_SSE(void); +#endif #if BX_SUPPORT_XSAVE BX_SMF void prepareXSAVE(void); @@ -3424,6 +3431,7 @@ BX_CPP_INLINE void BX_CPU_C::prepareMMX(void) } #endif +#if BX_CPU_LEVEL >= 6 BX_CPP_INLINE void BX_CPU_C::prepareSSE(void) { if(BX_CPU_THIS_PTR cr0.get_EM() || !BX_CPU_THIS_PTR cr4.get_OSFXSR()) @@ -3432,6 +3440,7 @@ BX_CPP_INLINE void BX_CPU_C::prepareSSE(void) if(BX_CPU_THIS_PTR cr0.get_TS()) exception(BX_NM_EXCEPTION, 0, 0); } +#endif #if BX_SUPPORT_XSAVE BX_CPP_INLINE void BX_CPU_C::prepareXSAVE(void) diff --git a/bochs/cpu/cpuid.cc b/bochs/cpu/cpuid.cc index 056725bf3..9bc6d8c11 100755 --- a/bochs/cpu/cpuid.cc +++ b/bochs/cpu/cpuid.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: cpuid.cc,v 1.91 2010-02-25 22:44:46 sshwarts Exp $ +// $Id: cpuid.cc,v 1.92 2010-02-26 11:44:50 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (c) 2007-2009 Stanislav Shwartsman @@ -764,6 +764,7 @@ void BX_CPU_C::init_cpu_features_bitmask(void) { Bit32u features_bitmask = 0; + bx_bool sep_enabled = SIM->get_param_bool(BXPN_CPUID_SEP)->get(); bx_bool aes_enabled = SIM->get_param_bool(BXPN_CPUID_AES)->get(); bx_bool movbe_enabled = SIM->get_param_bool(BXPN_CPUID_MOVBE)->get(); unsigned sse_enabled = SIM->get_param_enum(BXPN_CPUID_SSE)->get(); @@ -812,6 +813,13 @@ void BX_CPU_C::init_cpu_features_bitmask(void) } #endif +#if BX_SUPPORT_VMX + if (! sep_enabled) { + BX_PANIC(("PANIC: VMX emulation requires SYSENTER/SYSEXIT support !")); + return; + } +#endif + #if BX_SUPPORT_FPU features_bitmask |= BX_CPU_X87; #endif @@ -857,11 +865,11 @@ void BX_CPU_C::init_cpu_features_bitmask(void) default: break; }; + + if (sep_enabled) + features_bitmask |= BX_CPU_SYSENTER_SYSEXIT; #endif -#if BX_SUPPORT_SEP - features_bitmask |= BX_CPU_SYSENTER_SYSEXIT; -#endif #if BX_SUPPORT_VMX features_bitmask |= BX_CPU_VMX; #endif diff --git a/bochs/cpu/data_xfer16.cc b/bochs/cpu/data_xfer16.cc index 93360a1bf..7db48be17 100644 --- a/bochs/cpu/data_xfer16.cc +++ b/bochs/cpu/data_xfer16.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: data_xfer16.cc,v 1.66 2009-12-04 16:53:12 sshwarts Exp $ +// $Id: data_xfer16.cc,v 1.67 2010-02-26 11:44:50 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001-2009 The Bochs Project @@ -220,176 +220,96 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::XCHG_EwGwR(bxInstruction_c *i) void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMOVO_GwEwR(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 6 if (get_OF()) BX_WRITE_16BIT_REG(i->nnn(), BX_READ_16BIT_REG(i->rm())); -#else - BX_INFO(("CMOVO_GwEw: --enable-cpu-level=6 required")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMOVNO_GwEwR(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 6 if (!get_OF()) BX_WRITE_16BIT_REG(i->nnn(), BX_READ_16BIT_REG(i->rm())); -#else - BX_INFO(("CMOVNO_GwEw: --enable-cpu-level=6 required")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMOVB_GwEwR(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 6 if (get_CF()) BX_WRITE_16BIT_REG(i->nnn(), BX_READ_16BIT_REG(i->rm())); -#else - BX_INFO(("CMOVB_GwEw: --enable-cpu-level=6 required")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMOVNB_GwEwR(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 6 if (!get_CF()) BX_WRITE_16BIT_REG(i->nnn(), BX_READ_16BIT_REG(i->rm())); -#else - BX_INFO(("CMOVNB_GwEw: --enable-cpu-level=6 required")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMOVZ_GwEwR(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 6 if (get_ZF()) BX_WRITE_16BIT_REG(i->nnn(), BX_READ_16BIT_REG(i->rm())); -#else - BX_INFO(("CMOVZ_GwEw: --enable-cpu-level=6 required")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMOVNZ_GwEwR(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 6 if (!get_ZF()) BX_WRITE_16BIT_REG(i->nnn(), BX_READ_16BIT_REG(i->rm())); -#else - BX_INFO(("CMOVNZ_GwEw: --enable-cpu-level=6 required")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMOVBE_GwEwR(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 6 if (get_CF() || get_ZF()) BX_WRITE_16BIT_REG(i->nnn(), BX_READ_16BIT_REG(i->rm())); -#else - BX_INFO(("CMOVBE_GwEw: --enable-cpu-level=6 required")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMOVNBE_GwEwR(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 6 if (! (get_CF() || get_ZF())) BX_WRITE_16BIT_REG(i->nnn(), BX_READ_16BIT_REG(i->rm())); -#else - BX_INFO(("CMOVNBE_GwEw: --enable-cpu-level=6 required")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMOVS_GwEwR(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 6 if (get_SF()) BX_WRITE_16BIT_REG(i->nnn(), BX_READ_16BIT_REG(i->rm())); -#else - BX_INFO(("CMOVS_GwEw: --enable-cpu-level=6 required")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMOVNS_GwEwR(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 6 if (!get_SF()) BX_WRITE_16BIT_REG(i->nnn(), BX_READ_16BIT_REG(i->rm())); -#else - BX_INFO(("CMOVNS_GwEw: --enable-cpu-level=6 required")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMOVP_GwEwR(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 6 if (get_PF()) BX_WRITE_16BIT_REG(i->nnn(), BX_READ_16BIT_REG(i->rm())); -#else - BX_INFO(("CMOVP_GwEw: --enable-cpu-level=6 required")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMOVNP_GwEwR(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 6 if (!get_PF()) BX_WRITE_16BIT_REG(i->nnn(), BX_READ_16BIT_REG(i->rm())); -#else - BX_INFO(("CMOVNP_GwEw: --enable-cpu-level=6 required")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMOVL_GwEwR(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 6 if (getB_SF() != getB_OF()) BX_WRITE_16BIT_REG(i->nnn(), BX_READ_16BIT_REG(i->rm())); -#else - BX_INFO(("CMOVL_GwEw: --enable-cpu-level=6 required")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMOVNL_GwEwR(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 6 if (getB_SF() == getB_OF()) BX_WRITE_16BIT_REG(i->nnn(), BX_READ_16BIT_REG(i->rm())); -#else - BX_INFO(("CMOVNL_GwEw: --enable-cpu-level=6 required")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMOVLE_GwEwR(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 6 if (get_ZF() || (getB_SF() != getB_OF())) BX_WRITE_16BIT_REG(i->nnn(), BX_READ_16BIT_REG(i->rm())); -#else - BX_INFO(("CMOVLE_GwEw: --enable-cpu-level=6 required")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMOVNLE_GwEwR(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 6 if (! get_ZF() && (getB_SF() == getB_OF())) BX_WRITE_16BIT_REG(i->nnn(), BX_READ_16BIT_REG(i->rm())); -#else - BX_INFO(("CMOVNLE_GwEw: --enable-cpu-level=6 required")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } diff --git a/bochs/cpu/data_xfer32.cc b/bochs/cpu/data_xfer32.cc index e7005e31a..934cc0d7e 100644 --- a/bochs/cpu/data_xfer32.cc +++ b/bochs/cpu/data_xfer32.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: data_xfer32.cc,v 1.65 2009-12-04 16:53:12 sshwarts Exp $ +// $Id: data_xfer32.cc,v 1.66 2010-02-26 11:44:50 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001-2009 The Bochs Project @@ -190,208 +190,128 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::XCHG_EdGdR(bxInstruction_c *i) void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMOVO_GdEdR(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 6 if (get_OF()) BX_WRITE_32BIT_REGZ(i->nnn(), BX_READ_32BIT_REG(i->rm())); BX_CLEAR_64BIT_HIGH(i->nnn()); // always clear upper part of the register -#else - BX_INFO(("CMOVO_GdEd: --enable-cpu-level=6 required")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMOVNO_GdEdR(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 6 if (!get_OF()) BX_WRITE_32BIT_REGZ(i->nnn(), BX_READ_32BIT_REG(i->rm())); BX_CLEAR_64BIT_HIGH(i->nnn()); // always clear upper part of the register -#else - BX_INFO(("CMOVNO_GdEd: --enable-cpu-level=6 required")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMOVB_GdEdR(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 6 if (get_CF()) BX_WRITE_32BIT_REGZ(i->nnn(), BX_READ_32BIT_REG(i->rm())); BX_CLEAR_64BIT_HIGH(i->nnn()); // always clear upper part of the register -#else - BX_INFO(("CMOVB_GdEd: --enable-cpu-level=6 required")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMOVNB_GdEdR(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 6 if (!get_CF()) BX_WRITE_32BIT_REGZ(i->nnn(), BX_READ_32BIT_REG(i->rm())); BX_CLEAR_64BIT_HIGH(i->nnn()); // always clear upper part of the register -#else - BX_INFO(("CMOVNB_GdEd: --enable-cpu-level=6 required")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMOVZ_GdEdR(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 6 if (get_ZF()) BX_WRITE_32BIT_REGZ(i->nnn(), BX_READ_32BIT_REG(i->rm())); BX_CLEAR_64BIT_HIGH(i->nnn()); // always clear upper part of the register -#else - BX_INFO(("CMOVZ_GdEd: --enable-cpu-level=6 required")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMOVNZ_GdEdR(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 6 if (!get_ZF()) BX_WRITE_32BIT_REGZ(i->nnn(), BX_READ_32BIT_REG(i->rm())); BX_CLEAR_64BIT_HIGH(i->nnn()); // always clear upper part of the register -#else - BX_INFO(("CMOVNZ_GdEd: --enable-cpu-level=6 required")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMOVBE_GdEdR(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 6 if (get_CF() || get_ZF()) BX_WRITE_32BIT_REGZ(i->nnn(), BX_READ_32BIT_REG(i->rm())); BX_CLEAR_64BIT_HIGH(i->nnn()); // always clear upper part of the register -#else - BX_INFO(("CMOVBE_GdEd: --enable-cpu-level=6 required")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMOVNBE_GdEdR(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 6 if (! (get_CF() || get_ZF())) BX_WRITE_32BIT_REGZ(i->nnn(), BX_READ_32BIT_REG(i->rm())); BX_CLEAR_64BIT_HIGH(i->nnn()); // always clear upper part of the register -#else - BX_INFO(("CMOVNBE_GdEd: --enable-cpu-level=6 required")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMOVS_GdEdR(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 6 if (get_SF()) BX_WRITE_32BIT_REGZ(i->nnn(), BX_READ_32BIT_REG(i->rm())); BX_CLEAR_64BIT_HIGH(i->nnn()); // always clear upper part of the register -#else - BX_INFO(("CMOVS_GdEd: --enable-cpu-level=6 required")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMOVNS_GdEdR(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 6 if (!get_SF()) BX_WRITE_32BIT_REGZ(i->nnn(), BX_READ_32BIT_REG(i->rm())); BX_CLEAR_64BIT_HIGH(i->nnn()); // always clear upper part of the register -#else - BX_INFO(("CMOVNS_GdEd: --enable-cpu-level=6 required")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMOVP_GdEdR(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 6 if (get_PF()) BX_WRITE_32BIT_REGZ(i->nnn(), BX_READ_32BIT_REG(i->rm())); BX_CLEAR_64BIT_HIGH(i->nnn()); // always clear upper part of the register -#else - BX_INFO(("CMOVP_GdEd: --enable-cpu-level=6 required")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMOVNP_GdEdR(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 6 if (!get_PF()) BX_WRITE_32BIT_REGZ(i->nnn(), BX_READ_32BIT_REG(i->rm())); BX_CLEAR_64BIT_HIGH(i->nnn()); // always clear upper part of the register -#else - BX_INFO(("CMOVNP_GdEd: --enable-cpu-level=6 required")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMOVL_GdEdR(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 6 if (getB_SF() != getB_OF()) BX_WRITE_32BIT_REGZ(i->nnn(), BX_READ_32BIT_REG(i->rm())); BX_CLEAR_64BIT_HIGH(i->nnn()); // always clear upper part of the register -#else - BX_INFO(("CMOVL_GdEd: --enable-cpu-level=6 required")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMOVNL_GdEdR(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 6 if (getB_SF() == getB_OF()) BX_WRITE_32BIT_REGZ(i->nnn(), BX_READ_32BIT_REG(i->rm())); BX_CLEAR_64BIT_HIGH(i->nnn()); // always clear upper part of the register -#else - BX_INFO(("CMOVNL_GdEd: --enable-cpu-level=6 required")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMOVLE_GdEdR(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 6 if (get_ZF() || (getB_SF() != getB_OF())) BX_WRITE_32BIT_REGZ(i->nnn(), BX_READ_32BIT_REG(i->rm())); BX_CLEAR_64BIT_HIGH(i->nnn()); // always clear upper part of the register -#else - BX_INFO(("CMOVLE_GdEd: --enable-cpu-level=6 required")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMOVNLE_GdEdR(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 6 if (! get_ZF() && (getB_SF() == getB_OF())) BX_WRITE_32BIT_REGZ(i->nnn(), BX_READ_32BIT_REG(i->rm())); BX_CLEAR_64BIT_HIGH(i->nnn()); // always clear upper part of the register -#else - BX_INFO(("CMOVNLE_GdEd: --enable-cpu-level=6 required")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } diff --git a/bochs/cpu/fetchdecode.cc b/bochs/cpu/fetchdecode.cc index bf6213c71..52817a4c3 100644 --- a/bochs/cpu/fetchdecode.cc +++ b/bochs/cpu/fetchdecode.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: fetchdecode.cc,v 1.254 2010-02-25 22:44:46 sshwarts Exp $ +// $Id: fetchdecode.cc,v 1.255 2010-02-26 11:44:50 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001-2009 The Bochs Project @@ -2906,7 +2906,8 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::BxError(bxInstruction_c *i) #endif } else { - BX_INFO(("%s: instruction not supported (signalling #UD)", get_bx_opcode_name(ia_opcode))); + BX_INFO(("%s: instruction not supported - signalling #UD (features bitmask: 0x%08x)", + get_bx_opcode_name(ia_opcode), BX_CPU_THIS_PTR cpuid_features_bitmask)); } exception(BX_UD_EXCEPTION, 0, 0); diff --git a/bochs/cpu/init.cc b/bochs/cpu/init.cc index 43aa5590c..0130f05d3 100644 --- a/bochs/cpu/init.cc +++ b/bochs/cpu/init.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: init.cc,v 1.225 2010-02-25 22:34:56 sshwarts Exp $ +// $Id: init.cc,v 1.226 2010-02-26 11:44:50 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001-2009 The Bochs Project @@ -425,12 +425,10 @@ void BX_CPU_C::register_state(void) BXRS_HEX_PARAM_FIELD(MSR, tsc_aux, msr.tsc_aux); #endif BXRS_HEX_PARAM_FIELD(MSR, tsc_last_reset, msr.tsc_last_reset); -#if BX_SUPPORT_SEP +#if BX_CPU_LEVEL >= 6 BXRS_HEX_PARAM_FIELD(MSR, sysenter_cs_msr, msr.sysenter_cs_msr); BXRS_HEX_PARAM_FIELD(MSR, sysenter_esp_msr, msr.sysenter_esp_msr); BXRS_HEX_PARAM_FIELD(MSR, sysenter_eip_msr, msr.sysenter_eip_msr); -#endif -#if BX_CPU_LEVEL >= 6 BXRS_HEX_PARAM_FIELD(MSR, mtrrphysbase0, msr.mtrrphys[0]); BXRS_HEX_PARAM_FIELD(MSR, mtrrphysmask0, msr.mtrrphys[1]); BXRS_HEX_PARAM_FIELD(MSR, mtrrphysbase1, msr.mtrrphys[2]); @@ -499,6 +497,7 @@ void BX_CPU_C::register_state(void) BXRS_DEC_PARAM_FIELD(fpu, tos, the_i387.tos); #endif +#if BX_CPU_LEVEL >= 6 if (BX_CPU_SUPPORT_FEATURE(BX_CPU_SSE)) { bx_list_c *sse = new bx_list_c(cpu, "SSE", 2*BX_XMM_REGISTERS+1); BXRS_HEX_PARAM_FIELD(sse, mxcsr, mxcsr.mxcsr); @@ -509,6 +508,7 @@ void BX_CPU_C::register_state(void) new bx_shadow_num_c(sse, name, &xmm[n].xmm64u(0), BASE_HEX); } } +#endif #if BX_SUPPORT_MONITOR_MWAIT bx_list_c *monitor_list = new bx_list_c(cpu, "MONITOR", 3); @@ -941,7 +941,7 @@ void BX_CPU_C::reset(unsigned source) } #endif -#if BX_SUPPORT_SEP +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR msr.sysenter_cs_msr = 0; BX_CPU_THIS_PTR msr.sysenter_esp_msr = 0; BX_CPU_THIS_PTR msr.sysenter_eip_msr = 0; @@ -1002,6 +1002,7 @@ void BX_CPU_C::reset(unsigned source) } #endif +#if BX_CPU_LEVEL >= 6 // Reset XMM state - unchanged on #INIT if (source == BX_RESET_HARDWARE) { for(n=0; nnnn()), op2, result; @@ -73,11 +74,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSHUFB_PqQq(bxInstruction_c *i) } BX_WRITE_MMX_REG(i->nnn(), result); +#endif } /* 0F 38 01 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PHADDW_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2, result; @@ -100,11 +103,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PHADDW_PqQq(bxInstruction_c *i) MMXUW3(result) = MMXUW2(op2) + MMXUW3(op2); BX_WRITE_MMX_REG(i->nnn(), result); +#endif } /* 0F 38 02 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PHADDD_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2, result; @@ -125,11 +130,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PHADDD_PqQq(bxInstruction_c *i) MMXUD1(result) = MMXUD0(op2) + MMXUD1(op2); BX_WRITE_MMX_REG(i->nnn(), result); +#endif } /* 0F 38 03 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PHADDSW_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2, result; @@ -153,11 +160,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PHADDSW_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), result); +#endif } /* 0F 38 04 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMADDUBSW_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2, result; @@ -184,11 +193,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMADDUBSW_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), result); +#endif } /* 0F 38 05 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PHSUBSW_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2, result; @@ -212,11 +223,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PHSUBSW_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), result); +#endif } /* 0F 38 05 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PHSUBW_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2, result; @@ -239,11 +252,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PHSUBW_PqQq(bxInstruction_c *i) MMXUW3(result) = MMXUW2(op2) - MMXUW3(op2); BX_WRITE_MMX_REG(i->nnn(), result); +#endif } /* 0F 38 06 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PHSUBD_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2, result; @@ -264,11 +279,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PHSUBD_PqQq(bxInstruction_c *i) MMXUD1(result) = MMXUD0(op2) - MMXUD1(op2); BX_WRITE_MMX_REG(i->nnn(), result); +#endif } /* 0F 38 08 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSIGNB_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2; @@ -291,11 +308,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSIGNB_PqQq(bxInstruction_c *i) } BX_WRITE_MMX_REG(i->nnn(), op1); +#endif } /* 0F 38 09 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSIGNW_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2; @@ -318,11 +337,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSIGNW_PqQq(bxInstruction_c *i) } BX_WRITE_MMX_REG(i->nnn(), op1); +#endif } /* 0F 38 0A */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSIGND_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2; @@ -347,11 +368,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSIGND_PqQq(bxInstruction_c *i) MMXSD1(op1) *= sign; BX_WRITE_MMX_REG(i->nnn(), op1); +#endif } /* 0F 38 0B */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMULHRSW_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2, result; @@ -380,11 +403,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMULHRSW_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), result); +#endif } /* 0F 38 1C */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PABSB_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op; @@ -411,11 +436,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PABSB_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), op); +#endif } /* 0F 38 1D */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PABSW_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op; @@ -438,11 +465,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PABSW_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), op); +#endif } /* 0F 38 1E */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PABSD_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op; @@ -463,11 +492,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PABSD_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), op); +#endif } /* 0F 3A 0F */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PALIGNR_PqQqIb(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2, result; @@ -497,11 +528,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PALIGNR_PqQqIb(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), result); +#endif } /* 0F 60 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PUNPCKLBW_PqQd(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2, result; @@ -529,11 +562,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PUNPCKLBW_PqQd(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), result); +#endif } /* 0F 61 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PUNPCKLWD_PqQd(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2, result; @@ -557,11 +592,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PUNPCKLWD_PqQd(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), result); +#endif } /* 0F 62 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PUNPCKLDQ_PqQd(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2; @@ -582,11 +619,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PUNPCKLDQ_PqQd(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), op1); +#endif } /* 0F 63 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PACKSSWB_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2, result; @@ -614,11 +653,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PACKSSWB_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), result); +#endif } /* 0F 64 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PCMPGTB_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2; @@ -646,11 +687,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PCMPGTB_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), op1); +#endif } /* 0F 65 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PCMPGTW_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2; @@ -674,11 +717,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PCMPGTW_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), op1); +#endif } /* 0F 66 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PCMPGTD_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2; @@ -700,11 +745,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PCMPGTD_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), op1); +#endif } /* 0F 67 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PACKUSWB_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2, result; @@ -732,11 +779,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PACKUSWB_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), result); +#endif } /* 0F 68 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PUNPCKHBW_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2, result; @@ -764,11 +813,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PUNPCKHBW_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), result); +#endif } /* 0F 69 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PUNPCKHWD_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2, result; @@ -792,11 +843,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PUNPCKHWD_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), result); +#endif } /* 0F 6A */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PUNPCKHDQ_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2, result; @@ -818,11 +871,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PUNPCKHDQ_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), result); +#endif } /* 0F 6B */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PACKSSDW_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2, result; @@ -846,11 +901,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PACKSSDW_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), result); +#endif } /* 0F 6E */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVD_PqEdR(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BX_CPU_THIS_PTR prepareFPU2MMX(); /* FPU2MMX transition */ @@ -861,10 +918,12 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVD_PqEdR(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), op); +#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVD_PqEdM(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op; @@ -877,6 +936,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVD_PqEdM(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), op); +#endif } /* 0F 6E */ @@ -898,14 +958,17 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVQ_PqEqR(bxInstruction_c *i) /* 0F 6F */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVQ_PqQqR(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BX_CPU_THIS_PTR prepareFPU2MMX(); /* FPU2MMX transition */ BX_WRITE_MMX_REG(i->nnn(), BX_READ_MMX_REG(i->rm())); +#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVQ_PqQqM(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op; @@ -917,11 +980,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVQ_PqQqM(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), op); +#endif } /* 0F 70 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSHUFW_PqQqIb(bxInstruction_c *i) { +#if BX_SUPPORT_3DNOW || BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op, result; @@ -946,11 +1011,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSHUFW_PqQqIb(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), result); +#endif } /* 0F 74 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PCMPEQB_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2; @@ -978,11 +1045,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PCMPEQB_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), op1); +#endif } /* 0F 75 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PCMPEQW_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2; @@ -1006,11 +1075,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PCMPEQW_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), op1); +#endif } /* 0F 76 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PCMPEQD_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2; @@ -1032,28 +1103,34 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PCMPEQD_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), op1); +#endif } /* 0F 77 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::EMMS(bxInstruction_c *i) { +#if BX_SUPPORT_MMX || BX_SUPPORT_3DNOW BX_CPU_THIS_PTR prepareMMX(); FPU_TAG_WORD = 0xffff; FPU_TOS = 0; /* reset FPU Top-Of-Stack */ +#endif } /* 0F 7E */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVD_EdPdR(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BX_CPU_THIS_PTR prepareFPU2MMX(); BxPackedMmxRegister op = BX_READ_MMX_REG(i->nnn()); BX_WRITE_32BIT_REGZ(i->rm(), MMXUD0(op)); +#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVD_EdPdM(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op = BX_READ_MMX_REG(i->nnn()); @@ -1064,6 +1141,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVD_EdPdM(bxInstruction_c *i) // do not cause FPU2MMX transition if memory write faults BX_CPU_THIS_PTR prepareFPU2MMX(); +#endif } #if BX_SUPPORT_X86_64 @@ -1083,14 +1161,17 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVQ_EqPqR(bxInstruction_c *i) /* 0F 7F */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVQ_QqPqR(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BX_CPU_THIS_PTR prepareFPU2MMX(); BX_WRITE_MMX_REG(i->rm(), BX_READ_MMX_REG(i->nnn())); +#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVQ_QqPqM(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op = BX_READ_MMX_REG(i->nnn()); @@ -1101,11 +1182,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVQ_QqPqM(bxInstruction_c *i) // do not cause FPU2MMX transition if memory write faults BX_CPU_THIS_PTR prepareFPU2MMX(); +#endif } /* 0F C4 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PINSRW_PqEwIb(bxInstruction_c *i) { +#if BX_SUPPORT_3DNOW || BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()); @@ -1127,11 +1210,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PINSRW_PqEwIb(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), op1); +#endif } /* 0F C5 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PEXTRW_GdPqIb(bxInstruction_c *i) { +#if BX_SUPPORT_3DNOW || BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BX_CPU_THIS_PTR prepareFPU2MMX(); /* FPU2MMX transition */ @@ -1139,11 +1224,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PEXTRW_GdPqIb(bxInstruction_c *i) Bit32u result = (Bit32u) op.mmx16u(i->Ib() & 0x3); BX_WRITE_32BIT_REGZ(i->nnn(), result); +#endif } /* 0F D1 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSRLW_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2; @@ -1173,11 +1260,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSRLW_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), op1); +#endif } /* 0F D2 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSRLD_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2; @@ -1205,11 +1294,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSRLD_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), op1); +#endif } /* 0F D3 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSRLQ_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2; @@ -1235,11 +1326,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSRLQ_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), op1); +#endif } /* 0F D4 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PADDQ_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2; @@ -1260,11 +1353,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PADDQ_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), op1); +#endif } /* 0F D5 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMULLW_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2, result; @@ -1293,11 +1388,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMULLW_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), result); +#endif } /* 0F D7 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMOVMSKB_GdPRq(bxInstruction_c *i) { +#if BX_SUPPORT_3DNOW || BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BX_CPU_THIS_PTR prepareFPU2MMX(); /* FPU2MMX transition */ @@ -1315,11 +1412,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMOVMSKB_GdPRq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_32BIT_REGZ(i->nnn(), result); +#endif } /* 0F D8 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSUBUSB_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2, result; @@ -1349,11 +1448,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSUBUSB_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), result); +#endif } /* 0F D9 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSUBUSW_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2, result; @@ -1379,11 +1480,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSUBUSW_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), result); +#endif } /* 0F DA */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMINUB_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_3DNOW || BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2; @@ -1411,11 +1514,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMINUB_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), op1); +#endif } /* 0F DB */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PAND_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2; @@ -1436,11 +1541,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PAND_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), op1); +#endif } /* 0F DC */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PADDUSB_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2, result; @@ -1468,11 +1575,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PADDUSB_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), result); +#endif } /* 0F DD */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PADDUSW_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2, result; @@ -1496,11 +1605,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PADDUSW_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), result); +#endif } /* 0F DE */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMAXUB_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_3DNOW || BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2; @@ -1528,11 +1639,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMAXUB_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), op1); +#endif } /* 0F DF */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PANDN_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2; @@ -1553,11 +1666,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PANDN_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), op1); +#endif } /* 0F E0 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PAVGB_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_3DNOW || BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2; @@ -1585,11 +1700,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PAVGB_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), op1); +#endif } /* 0F E1 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSRAW_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2, result; @@ -1630,11 +1747,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSRAW_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), result); +#endif } /* 0F E2 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSRAD_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2, result; @@ -1672,11 +1791,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSRAD_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), result); +#endif } /* 0F E3 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PAVGW_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_3DNOW || BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2; @@ -1700,11 +1821,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PAVGW_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), op1); +#endif } /* 0F E4 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMULHUW_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_3DNOW || BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2, result; @@ -1733,11 +1856,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMULHUW_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), result); +#endif } /* 0F E5 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMULHW_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2, result; @@ -1766,11 +1891,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMULHW_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), result); +#endif } /* 0F E7 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVNTQ_MqPq(bxInstruction_c *i) { +#if BX_SUPPORT_3DNOW || BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister reg = BX_READ_MMX_REG(i->nnn()); @@ -1779,11 +1906,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVNTQ_MqPq(bxInstruction_c *i) // do not cause FPU2MMX transition if memory write faults BX_CPU_THIS_PTR prepareFPU2MMX(); +#endif } /* 0F E8 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSUBSB_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2, result; @@ -1811,11 +1940,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSUBSB_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), result); +#endif } /* 0F E9 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSUBSW_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2, result; @@ -1839,11 +1970,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSUBSW_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), result); +#endif } /* 0F EA */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMINSW_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_3DNOW || BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2; @@ -1867,11 +2000,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMINSW_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), op1); +#endif } /* 0F EB */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::POR_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2; @@ -1892,11 +2027,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::POR_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), op1); +#endif } /* 0F EC */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PADDSB_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2, result; @@ -1924,11 +2061,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PADDSB_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), result); +#endif } /* 0F ED */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PADDSW_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2, result; @@ -1952,11 +2091,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PADDSW_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), result); +#endif } /* 0F EE */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMAXSW_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_3DNOW || BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2; @@ -1980,11 +2121,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMAXSW_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), op1); +#endif } /* 0F EF */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PXOR_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2; @@ -2005,11 +2148,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PXOR_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), op1); +#endif } /* 0F F1 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSLLW_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2; @@ -2039,11 +2184,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSLLW_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), op1); +#endif } /* 0F F2 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSLLD_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2; @@ -2071,11 +2218,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSLLD_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), op1); +#endif } /* 0F F3 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSLLQ_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2; @@ -2101,11 +2250,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSLLQ_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), op1); +#endif } /* 0F F4 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMULUDQ_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2, result; @@ -2126,11 +2277,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMULUDQ_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), result); +#endif } /* 0F F5 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMADDWD_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2, result; @@ -2163,11 +2316,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMADDWD_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), result); +#endif } /* 0F F6 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSADBW_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_3DNOW || BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2; @@ -2198,11 +2353,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSADBW_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), op1); +#endif } /* 0F F7 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MASKMOVQ_PqPRq(bxInstruction_c *i) { +#if BX_SUPPORT_3DNOW || BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BX_CPU_THIS_PTR prepareFPU2MMX(); /* FPU2MMX transition */ @@ -2238,11 +2395,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MASKMOVQ_PqPRq(bxInstruction_c *i) if(MMXUB7(mask) & 0x80) MMXUB7(tmp) = MMXUB7(op); write_RMW_virtual_qword(MMXUQ(tmp)); +#endif } /* 0F F8 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSUBB_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2; @@ -2270,11 +2429,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSUBB_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), op1); +#endif } /* 0F F9 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSUBW_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2; @@ -2298,11 +2459,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSUBW_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), op1); +#endif } /* 0F FA */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSUBD_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2; @@ -2324,11 +2487,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSUBD_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), op1); +#endif } /* 0F FB */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSUBQ_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2; @@ -2349,11 +2514,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSUBQ_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), op1); +#endif } /* 0F FC */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PADDB_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2; @@ -2381,11 +2548,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PADDB_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), op1); +#endif } /* 0F FD */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PADDW_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2; @@ -2409,11 +2578,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PADDW_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), op1); +#endif } /* 0F FE */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PADDD_PqQq(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BxPackedMmxRegister op1 = BX_READ_MMX_REG(i->nnn()), op2; @@ -2435,11 +2606,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PADDD_PqQq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->nnn(), op1); +#endif } /* 0F 71 GrpA 010 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSRLW_PqIb(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BX_CPU_THIS_PTR prepareFPU2MMX(); /* FPU2MMX transition */ @@ -2457,11 +2630,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSRLW_PqIb(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->rm(), op); +#endif } /* 0F 71 GrpA 100 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSRAW_PqIb(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BX_CPU_THIS_PTR prepareFPU2MMX(); /* FPU2MMX transition */ @@ -2490,11 +2665,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSRAW_PqIb(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->rm(), result); +#endif } /* 0F 71 GrpA 110 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSLLW_PqIb(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BX_CPU_THIS_PTR prepareFPU2MMX(); /* FPU2MMX transition */ @@ -2512,11 +2689,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSLLW_PqIb(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->rm(), op); +#endif } /* 0F 72 GrpA 010 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSRLD_PqIb(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BX_CPU_THIS_PTR prepareFPU2MMX(); /* FPU2MMX transition */ @@ -2532,11 +2711,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSRLD_PqIb(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->rm(), op); +#endif } /* 0F 72 GrpA 100 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSRAD_PqIb(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BX_CPU_THIS_PTR prepareFPU2MMX(); /* FPU2MMX transition */ @@ -2562,11 +2743,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSRAD_PqIb(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->rm(), result); +#endif } /* 0F 72 GrpA 110 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSLLD_PqIb(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BX_CPU_THIS_PTR prepareFPU2MMX(); /* FPU2MMX transition */ @@ -2582,11 +2765,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSLLD_PqIb(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->rm(), op); +#endif } /* 0F 73 GrpA 010 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSRLQ_PqIb(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BX_CPU_THIS_PTR prepareFPU2MMX(); /* FPU2MMX transition */ @@ -2602,11 +2787,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSRLQ_PqIb(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->rm(), op); +#endif } /* 0F 73 GrpA 110 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSLLQ_PqIb(bxInstruction_c *i) { +#if BX_SUPPORT_MMX BX_CPU_THIS_PTR prepareMMX(); BX_CPU_THIS_PTR prepareFPU2MMX(); /* FPU2MMX transition */ @@ -2622,4 +2809,5 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSLLQ_PqIb(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_MMX_REG(i->rm(), op); +#endif } diff --git a/bochs/cpu/msr.cc b/bochs/cpu/msr.cc index 87f8a9c79..ff52af6de 100755 --- a/bochs/cpu/msr.cc +++ b/bochs/cpu/msr.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: msr.cc,v 1.30 2009-11-13 15:55:46 sshwarts Exp $ +// $Id: msr.cc,v 1.31 2010-02-26 11:44:50 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (c) 2008-2009 Stanislav Shwartsman @@ -39,16 +39,34 @@ bx_bool BX_CPP_AttrRegparmN(2) BX_CPU_C::rdmsr(Bit32u index, Bit64u *msr) switch(index) { -#if BX_SUPPORT_SEP +#if BX_CPU_LEVEL >= 6 case BX_MSR_SYSENTER_CS: + if (! BX_CPU_SUPPORT_FEATURE(BX_CPU_SYSENTER_SYSEXIT)) { + // failed to find the MSR, could #GP or ignore it silently + BX_ERROR(("RDMSR MSR_SYSENTER_CS: SYSENTER/SYSEXIT feature not enabled !")); + if (! BX_CPU_THIS_PTR ignore_bad_msrs) + return 0; // will result in #GP fault due to unknown MSR + } val64 = BX_CPU_THIS_PTR msr.sysenter_cs_msr; break; case BX_MSR_SYSENTER_ESP: + if (! BX_CPU_SUPPORT_FEATURE(BX_CPU_SYSENTER_SYSEXIT)) { + // failed to find the MSR, could #GP or ignore it silently + BX_ERROR(("RDMSR MSR_SYSENTER_ESP: SYSENTER/SYSEXIT feature not enabled !")); + if (! BX_CPU_THIS_PTR ignore_bad_msrs) + return 0; // will result in #GP fault due to unknown MSR + } val64 = BX_CPU_THIS_PTR msr.sysenter_esp_msr; break; case BX_MSR_SYSENTER_EIP: + if (! BX_CPU_SUPPORT_FEATURE(BX_CPU_SYSENTER_SYSEXIT)) { + // failed to find the MSR, could #GP or ignore it silently + BX_ERROR(("RDMSR MSR_SYSENTER_EIP: SYSENTER/SYSEXIT feature not enabled !")); + if (! BX_CPU_THIS_PTR ignore_bad_msrs) + return 0; // will result in #GP fault due to unknown MSR + } val64 = BX_CPU_THIS_PTR msr.sysenter_eip_msr; break; #endif @@ -268,12 +286,24 @@ bx_bool BX_CPP_AttrRegparmN(2) BX_CPU_C::wrmsr(Bit32u index, Bit64u val_64) switch(index) { -#if BX_SUPPORT_SEP +#if BX_CPU_LEVEL >= 6 case BX_MSR_SYSENTER_CS: + if (! BX_CPU_SUPPORT_FEATURE(BX_CPU_SYSENTER_SYSEXIT)) { + // failed to find the MSR, could #GP or ignore it silently + BX_ERROR(("WRMSR MSR_SYSENTER_CS: SYSENTER/SYSEXIT feature not enabled !")); + if (! BX_CPU_THIS_PTR ignore_bad_msrs) + return 0; // will result in #GP fault due to unknown MSR + } BX_CPU_THIS_PTR msr.sysenter_cs_msr = val32_lo; break; case BX_MSR_SYSENTER_ESP: + if (! BX_CPU_SUPPORT_FEATURE(BX_CPU_SYSENTER_SYSEXIT)) { + // failed to find the MSR, could #GP or ignore it silently + BX_ERROR(("WRMSR MSR_SYSENTER_ESP: SYSENTER/SYSEXIT feature not enabled !")); + if (! BX_CPU_THIS_PTR ignore_bad_msrs) + return 0; // will result in #GP fault due to unknown MSR + } #if BX_SUPPORT_X86_64 if (! IsCanonical(val_64)) { BX_ERROR(("WRMSR: attempt to write non-canonical value to MSR_SYSENTER_ESP !")); @@ -284,6 +314,12 @@ bx_bool BX_CPP_AttrRegparmN(2) BX_CPU_C::wrmsr(Bit32u index, Bit64u val_64) break; case BX_MSR_SYSENTER_EIP: + if (! BX_CPU_SUPPORT_FEATURE(BX_CPU_SYSENTER_SYSEXIT)) { + // failed to find the MSR, could #GP or ignore it silently + BX_ERROR(("WRMSR MSR_SYSENTER_EIP: SYSENTER/SYSEXIT feature not enabled !")); + if (! BX_CPU_THIS_PTR ignore_bad_msrs) + return 0; // will result in #GP fault due to unknown MSR + } #if BX_SUPPORT_X86_64 if (! IsCanonical(val_64)) { BX_ERROR(("WRMSR: attempt to write non-canonical value to MSR_SYSENTER_EIP !")); diff --git a/bochs/cpu/paging.cc b/bochs/cpu/paging.cc index 365a73871..e9696c2b7 100644 --- a/bochs/cpu/paging.cc +++ b/bochs/cpu/paging.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: paging.cc,v 1.190 2009-12-04 16:53:12 sshwarts Exp $ +// $Id: paging.cc,v 1.191 2010-02-26 11:44:50 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001-2009 The Bochs Project @@ -737,7 +737,6 @@ void BX_CPU_C::TLB_invlpg(bx_address laddr) void BX_CPP_AttrRegparmN(1) BX_CPU_C::INVLPG(bxInstruction_c* i) { -#if BX_CPU_LEVEL >= 4 if (!real_mode() && CPL!=0) { BX_ERROR(("INVLPG: priveledge check failed, generate #GP(0)")); exception(BX_GP_EXCEPTION, 0, 0); @@ -759,10 +758,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::INVLPG(bxInstruction_c* i) BX_INSTR_TLB_CNTRL(BX_CPU_ID, BX_INSTR_INVLPG, laddr); TLB_invlpg(laddr); -#else - BX_INFO(("INVLPG: required i486, use --enable-cpu=4 option")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } // error checking order - page not present, reserved bits, protection diff --git a/bochs/cpu/proc_ctrl.cc b/bochs/cpu/proc_ctrl.cc index d27a948fa..1e8f1a1d6 100644 --- a/bochs/cpu/proc_ctrl.cc +++ b/bochs/cpu/proc_ctrl.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: proc_ctrl.cc,v 1.312 2010-02-25 22:04:30 sshwarts Exp $ +// $Id: proc_ctrl.cc,v 1.313 2010-02-26 11:44:50 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001-2009 The Bochs Project @@ -149,7 +149,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CLTS(bxInstruction_c *i) /* 0F 08 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::INVD(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 4 if (!real_mode() && CPL!=0) { BX_ERROR(("INVD: priveledge check failed, generate #GP(0)")); exception(BX_GP_EXCEPTION, 0, 0); @@ -168,16 +167,11 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::INVD(bxInstruction_c *i) BX_INSTR_CACHE_CNTRL(BX_CPU_ID, BX_INSTR_INVD); flushICaches(); -#else - BX_INFO(("INVD: required 486 support, use --enable-cpu-level=4 option")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } /* 0F 09 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::WBINVD(bxInstruction_c *i) { -#if BX_CPU_LEVEL >= 4 if (!real_mode() && CPL!=0) { BX_ERROR(("INVD/WBINVD: priveledge check failed, generate #GP(0)")); exception(BX_GP_EXCEPTION, 0, 0); @@ -189,10 +183,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::WBINVD(bxInstruction_c *i) BX_INSTR_CACHE_CNTRL(BX_CPU_ID, BX_INSTR_WBINVD); flushICaches(); -#else - BX_INFO(("WBINVD: required 486 support, use --enable-cpu-level=4 option")); - exception(BX_UD_EXCEPTION, 0, 0); -#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::CLFLUSH(bxInstruction_c *i) @@ -1514,12 +1504,8 @@ bx_bool BX_CPP_AttrRegparmN(1) BX_CPU_C::SetCR4(bx_address val) void BX_CPP_AttrRegparmN(1) BX_CPU_C::RDPMC(bxInstruction_c *i) { -/* We need to be Pentium with MMX or later */ -#if (BX_CPU_LEVEL >= 6) || (BX_SUPPORT_MMX && BX_CPU_LEVEL == 5) - bx_bool pce = BX_CPU_THIS_PTR cr4.get_PCE(); - - if ((pce==1) || (CPL==0) || real_mode()) - { +#if BX_CPU_LEVEL >= 5 + if (BX_CPU_THIS_PTR cr4.get_PCE() || CPL==0 || real_mode()) { #if BX_SUPPORT_VMX VMexit_RDPMC(i); @@ -1531,8 +1517,14 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::RDPMC(bxInstruction_c *i) * limited to 40 bits. */ - if ((ECX & 0xffffffff) >= 2) - exception(BX_GP_EXCEPTION, 0, 0); + if (BX_CPU_SUPPORT_FEATURE(BX_CPU_SSE2)) { // Pentium 4 processor (see cpuid.cc) + if ((ECX & 0x7fffffff) >= 18) + exception(BX_GP_EXCEPTION, 0, 0); + } + else { + if ((ECX & 0xffffffff) >= 2) + exception(BX_GP_EXCEPTION, 0, 0); + } // Most counters are for hardware specific details, which // we anyhow do not emulate (like pipeline stalls etc) @@ -1549,8 +1541,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::RDPMC(bxInstruction_c *i) // not allowed to use RDPMC! exception(BX_GP_EXCEPTION, 0, 0); } -#else - exception(BX_UD_EXCEPTION, 0, 0); #endif } @@ -1594,9 +1584,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::RDTSC(bxInstruction_c *i) BX_ERROR(("RDTSC: not allowed to use instruction !")); exception(BX_GP_EXCEPTION, 0, 0); } -#else - BX_INFO(("RDTSC: Pentium CPU required, use --enable-cpu=5")); - exception(BX_UD_EXCEPTION, 0, 0); #endif } @@ -1788,7 +1775,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MWAIT(bxInstruction_c *i) void BX_CPP_AttrRegparmN(1) BX_CPU_C::SYSENTER(bxInstruction_c *i) { -#if BX_SUPPORT_SEP +#if BX_CPU_LEVEL >= 6 if (real_mode()) { BX_ERROR(("SYSENTER not recognized in real mode !")); exception(BX_GP_EXCEPTION, 0, 0); @@ -1875,15 +1862,12 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::SYSENTER(bxInstruction_c *i) BX_INSTR_FAR_BRANCH(BX_CPU_ID, BX_INSTR_IS_SYSENTER, BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].selector.value, RIP); -#else - BX_INFO(("SYSENTER: use --enable-sep to enable SYSENTER/SYSEXIT support")); - exception(BX_UD_EXCEPTION, 0, 0); #endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::SYSEXIT(bxInstruction_c *i) { -#if BX_SUPPORT_SEP +#if BX_CPU_LEVEL >= 6 if (real_mode() || CPL != 0) { BX_ERROR(("SYSEXIT from real mode or with CPL<>0 !")); exception(BX_GP_EXCEPTION, 0, 0); @@ -1981,9 +1965,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::SYSEXIT(bxInstruction_c *i) BX_INSTR_FAR_BRANCH(BX_CPU_ID, BX_INSTR_IS_SYSEXIT, BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].selector.value, RIP); -#else - BX_INFO(("SYSEXIT: use --enable-sep to enable SYSENTER/SYSEXIT support")); - exception(BX_UD_EXCEPTION, 0, 0); #endif } diff --git a/bochs/cpu/sse.cc b/bochs/cpu/sse.cc index 38f4076d0..bc8618864 100644 --- a/bochs/cpu/sse.cc +++ b/bochs/cpu/sse.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: sse.cc,v 1.68 2010-02-25 22:04:31 sshwarts Exp $ +// $Id: sse.cc,v 1.69 2010-02-26 11:44:50 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (c) 2003-2009 Stanislav Shwartsman @@ -33,6 +33,7 @@ /* 66 0F 38 00 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSHUFB_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2, result; @@ -57,11 +58,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSHUFB_VdqWdq(bxInstruction_c *i) } BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* 66 0F 38 01 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PHADDW_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2, result; @@ -87,11 +90,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PHADDW_VdqWdq(bxInstruction_c *i) result.xmm16u(7) = op2.xmm16u(6) + op2.xmm16u(7); BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* 66 0F 38 02 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PHADDD_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2, result; @@ -112,11 +117,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PHADDD_VdqWdq(bxInstruction_c *i) result.xmm32u(3) = op2.xmm32u(2) + op2.xmm32u(3); BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* 66 0F 38 03 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PHADDSW_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2, result; @@ -143,11 +150,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PHADDSW_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* 66 0F 38 04 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMADDUBSW_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2, result; @@ -172,11 +181,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMADDUBSW_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* 66 0F 38 05 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PHSUBSW_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2, result; @@ -203,11 +214,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PHSUBSW_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* 66 0F 38 05 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PHSUBW_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2, result; @@ -233,11 +246,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PHSUBW_VdqWdq(bxInstruction_c *i) result.xmm16u(7) = op2.xmm16u(6) - op2.xmm16u(7); BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* 66 0F 38 06 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PHSUBD_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2, result; @@ -258,11 +273,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PHSUBD_VdqWdq(bxInstruction_c *i) result.xmm32u(3) = op2.xmm32u(2) - op2.xmm32u(3); BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* 66 0F 38 08 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSIGNB_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -283,11 +300,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSIGNB_VdqWdq(bxInstruction_c *i) } BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F 38 09 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSIGNW_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -308,11 +327,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSIGNW_VdqWdq(bxInstruction_c *i) } BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F 38 0A */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSIGND_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -333,11 +354,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSIGND_VdqWdq(bxInstruction_c *i) } BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F 38 0B */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMULHRSW_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -363,11 +386,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMULHRSW_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F 38 1C */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PABSB_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op; @@ -400,11 +425,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PABSB_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op); +#endif } /* 66 0F 38 1D */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PABSW_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op; @@ -429,11 +456,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PABSW_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op); +#endif } /* 66 0F 38 1E */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PABSD_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op; @@ -454,11 +483,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PABSD_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op); +#endif } /* 66 0F 38 10 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PBLENDVB_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2, @@ -479,11 +510,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PBLENDVB_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F 38 14 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::BLENDVPS_VpsWps(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2, @@ -506,11 +539,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::BLENDVPS_VpsWps(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F 38 15 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::BLENDVPD_VpdWpd(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2, @@ -531,11 +566,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::BLENDVPD_VpdWpd(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F 38 17 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PTEST_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -558,11 +595,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PTEST_VdqWdq(bxInstruction_c *i) (op2.xmm64u(1) & ~op1.xmm64u(1)) == 0) result |= EFlagsCFMask; setEFlagsOSZAPC(result); +#endif } /* 66 0F 38 28 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMULDQ_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2, result; @@ -582,11 +621,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMULDQ_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* 66 0F 38 29 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PCMPEQQ_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -609,11 +650,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PCMPEQQ_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F 38 2B */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PACKUSDW_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2, result; @@ -639,11 +682,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PACKUSDW_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* 66 0F 38 37 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PCMPGTQ_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -666,11 +711,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PCMPGTQ_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F 38 38 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMINSB_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -691,11 +738,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMINSB_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F 38 39 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMINSD_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -717,11 +766,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMINSD_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F 38 3A */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMINUW_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -747,11 +798,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMINUW_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F 38 3B */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMINUD_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -773,11 +826,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMINUD_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F 38 3C */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMAXSB_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -798,11 +853,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMAXSB_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F 38 3D */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMAXSD_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -824,11 +881,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMAXSD_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F 38 3E */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMAXUW_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -854,11 +913,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMAXUW_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F 38 3F */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMAXUD_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -880,11 +941,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMAXUD_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F 38 40 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMULLD_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -911,11 +974,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMULLD_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F 38 41 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PHMINPOSUW_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op, result; @@ -943,11 +1008,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PHMINPOSUW_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* 66 0F 3A 0C */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::BLENDPS_VpsWpsIb(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -970,11 +1037,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::BLENDPS_VpsWpsIb(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F 3A 0D */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::BLENDPD_VpdWpdIb(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -995,11 +1064,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::BLENDPD_VpdWpdIb(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F 3A 0E */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PBLENDW_VdqWdqIb(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -1026,11 +1097,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PBLENDW_VdqWdqIb(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F 3A 14 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PEXTRB_HbdUdqIb(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op = BX_READ_XMM_REG(i->rm()); @@ -1045,11 +1118,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PEXTRB_HbdUdqIb(bxInstruction_c *i) /* pointer, segment address pair */ write_virtual_byte(i->seg(), eaddr, result); } +#endif } /* 66 0F 3A 15 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PEXTRW_HwdUdqIb(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op = BX_READ_XMM_REG(i->rm()); @@ -1064,11 +1139,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PEXTRW_HwdUdqIb(bxInstruction_c *i) /* pointer, segment address pair */ write_virtual_word(i->seg(), eaddr, result); } +#endif } /* 66 0F 3A 16 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PEXTRD_HdUdqIb(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op = BX_READ_XMM_REG(i->rm()); @@ -1103,11 +1180,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PEXTRD_HdUdqIb(bxInstruction_c *i) write_virtual_dword(i->seg(), eaddr, result); } } +#endif } /* 66 0F 3A 17 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::EXTRACTPS_HdUpsIb(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op = BX_READ_XMM_REG(i->rm()); @@ -1122,11 +1201,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::EXTRACTPS_HdUpsIb(bxInstruction_c *i) /* pointer, segment address pair */ write_virtual_dword(i->seg(), eaddr, result); } +#endif } /* 66 0F 3A 20 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PINSRB_VdqEbIb(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()); @@ -1146,11 +1227,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PINSRB_VdqEbIb(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F 3A 21 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::INSERTPS_VpsWssIb(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()); @@ -1177,11 +1260,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::INSERTPS_VpsWssIb(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F 3A 22 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PINSRD_VdqEdIb(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()); @@ -1223,11 +1308,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PINSRD_VdqEdIb(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F 3A 42 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MPSADBW_VdqWdqIb(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2, result; @@ -1260,11 +1347,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MPSADBW_VdqWdqIb(bxInstruction_c *i) } BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* 66 0F 60 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PUNPCKLBW_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2, result; @@ -1298,11 +1387,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PUNPCKLBW_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* 66 0F 61 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PUNPCKLWD_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2, result; @@ -1328,12 +1419,14 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PUNPCKLWD_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* UNPCKLPS: 0F 14 */ /* PUNPCKLDQ: 66 0F 62 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::UNPCKLPS_VpsWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2, result; @@ -1355,11 +1448,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::UNPCKLPS_VpsWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* 66 0F 63 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PACKSSWB_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2, result; @@ -1394,11 +1489,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PACKSSWB_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* 66 0F 64 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PCMPGTB_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -1419,11 +1516,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PCMPGTB_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F 65 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PCMPGTW_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -1449,11 +1548,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PCMPGTW_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F 66 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PCMPGTD_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -1475,11 +1576,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PCMPGTD_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F 67 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PACKUSWB_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2, result; @@ -1514,11 +1617,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PACKUSWB_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* 66 0F 68 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PUNPCKHBW_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2, result; @@ -1552,11 +1657,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PUNPCKHBW_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* 66 0F 69 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PUNPCKHWD_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2, result; @@ -1582,12 +1689,14 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PUNPCKHWD_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* UNPCKHPS: 0F 15 */ /* PUNPCKHDQ: 66 0F 6A */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::UNPCKHPS_VpsWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2, result; @@ -1609,11 +1718,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::UNPCKHPS_VpsWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* 66 0F 6B */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PACKSSDW_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2, result; @@ -1640,12 +1751,14 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PACKSSDW_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* UNPCKLPD: 66 0F 14 */ /* PUNPCKLQDQ: 66 0F 6C */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PUNPCKLQDQ_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -1664,12 +1777,14 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PUNPCKLQDQ_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* UNPCKHPD: 66 0F 15 */ /* PUNPCKHQDQ: 66 0F 6D */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PUNPCKHQDQ_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2, result; @@ -1689,11 +1804,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PUNPCKHQDQ_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* 66 0F 70 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSHUFD_VdqWdqIb(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op, result; @@ -1716,11 +1833,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSHUFD_VdqWdqIb(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* F2 0F 70 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSHUFHW_VdqWdqIb(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op, result; @@ -1744,11 +1863,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSHUFHW_VdqWdqIb(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* F3 0F 70 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSHUFLW_VdqWdqIb(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op, result; @@ -1772,11 +1893,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSHUFLW_VdqWdqIb(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* 66 0F 74 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PCMPEQB_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -1797,11 +1920,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PCMPEQB_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F 75 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PCMPEQW_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -1827,11 +1952,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PCMPEQW_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F 76 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PCMPEQD_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -1853,11 +1980,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PCMPEQD_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F C4 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PINSRW_VdqEwIb(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()); @@ -1878,11 +2007,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PINSRW_VdqEwIb(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F C5 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PEXTRW_GdUdqIb(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op = BX_READ_XMM_REG(i->rm()); @@ -1890,11 +2021,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PEXTRW_GdUdqIb(bxInstruction_c *i) Bit32u result = (Bit32u) op.xmm16u(count); BX_WRITE_32BIT_REGZ(i->nnn(), result); +#endif } /* 0F C6 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::SHUFPS_VpsWpsIb(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2, result; @@ -1917,11 +2050,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::SHUFPS_VpsWpsIb(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* 66 0F C6 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::SHUFPD_VpdWpdIb(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2, result; @@ -1942,11 +2077,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::SHUFPD_VpdWpdIb(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* 66 0F D1 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSRLW_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -1982,11 +2119,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSRLW_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F D2 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSRLD_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -2018,11 +2157,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSRLD_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F D3 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSRLQ_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -2052,11 +2193,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSRLQ_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F D4 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PADDQ_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -2076,11 +2219,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PADDQ_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F D5 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMULLW_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -2115,11 +2260,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMULLW_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F D8 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSUBUSB_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2, result; @@ -2146,11 +2293,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSUBUSB_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* 66 0F D9 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSUBUSW_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2, result; @@ -2177,11 +2326,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSUBUSW_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* 66 0F DA */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMINUB_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -2202,6 +2353,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMINUB_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* ANDPS: 0F 54 */ @@ -2209,6 +2361,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMINUB_VdqWdq(bxInstruction_c *i) /* PAND: 66 0F DB */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::ANDPS_VpsWps(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -2228,11 +2381,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::ANDPS_VpsWps(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F DC */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PADDUSB_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -2253,11 +2408,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PADDUSB_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F DD */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PADDUSW_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -2283,11 +2440,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PADDUSW_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F DE */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMAXUB_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -2308,6 +2467,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMAXUB_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* ANDNPS: 0F 55 */ @@ -2315,6 +2475,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMAXUB_VdqWdq(bxInstruction_c *i) /* PANDN: 66 0F DF */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::ANDNPS_VpsWps(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -2334,11 +2495,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::ANDNPS_VpsWps(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F E0 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PAVGB_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -2359,11 +2522,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PAVGB_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F E1 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSRAW_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2, result; @@ -2416,11 +2581,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSRAW_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* 66 0F E2 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSRAD_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2, result; @@ -2461,11 +2628,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSRAD_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* 66 0F E3 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PAVGW_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -2491,11 +2660,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PAVGW_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F E4 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMULHUW_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -2530,11 +2701,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMULHUW_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F E5 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMULHW_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -2569,11 +2742,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMULHW_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F E8 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSUBSB_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -2594,11 +2769,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSUBSB_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F E9 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSUBSW_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -2624,11 +2801,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSUBSW_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F EA */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMINSW_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -2654,6 +2833,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMINSW_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* ORPS: 0F 56 */ @@ -2661,6 +2841,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMINSW_VdqWdq(bxInstruction_c *i) /* POR: 66 0F EB */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::ORPS_VpsWps(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -2680,11 +2861,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::ORPS_VpsWps(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F EC */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PADDSB_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -2705,11 +2888,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PADDSB_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F ED */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PADDSW_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -2735,11 +2920,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PADDSW_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F EE */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMAXSW_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -2765,6 +2952,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMAXSW_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* XORPS: 0F 57 */ @@ -2772,6 +2960,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMAXSW_VdqWdq(bxInstruction_c *i) /* PXOR: 66 0F EF */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::XORPS_VpsWps(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -2791,11 +2980,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::XORPS_VpsWps(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F F1 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSLLW_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -2831,11 +3022,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSLLW_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F F2 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSLLD_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -2867,11 +3060,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSLLD_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F F3 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSLLQ_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -2901,11 +3096,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSLLQ_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F F4 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMULUDQ_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2, result; @@ -2925,11 +3122,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMULUDQ_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* 66 0F F5 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMADDWD_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2, result; @@ -2958,11 +3157,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMADDWD_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* 66 0F F6 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSADBW_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -3001,11 +3202,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSADBW_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F F8 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSUBB_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -3026,11 +3229,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSUBB_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F F9 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSUBW_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -3056,11 +3261,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSUBW_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F FA */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSUBD_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -3082,11 +3289,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSUBD_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F FB */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSUBQ_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -3106,11 +3315,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSUBQ_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F FC */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PADDB_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -3131,11 +3342,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PADDB_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F FD */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PADDW_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -3161,11 +3374,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PADDW_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F FE */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PADDD_VdqWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -3187,11 +3402,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PADDD_VdqWdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F 71 Grp12 010 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSRLW_UdqIb(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op = BX_READ_XMM_REG(i->rm()); @@ -3214,11 +3431,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSRLW_UdqIb(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->rm(), op); +#endif } /* 0F 71 Grp12 100 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSRAW_UdqIb(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op = BX_READ_XMM_REG(i->rm()), result; @@ -3258,11 +3477,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSRAW_UdqIb(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->rm(), result); +#endif } /* 66 0F 71 Grp12 110 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSLLW_UdqIb(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op = BX_READ_XMM_REG(i->rm()); @@ -3285,11 +3506,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSLLW_UdqIb(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->rm(), op); +#endif } /* 66 0F 72 Grp13 010 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSRLD_UdqIb(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op = BX_READ_XMM_REG(i->rm()); @@ -3308,11 +3531,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSRLD_UdqIb(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->rm(), op); +#endif } /* 0F 72 Grp13 100 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSRAD_UdqIb(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op = BX_READ_XMM_REG(i->rm()), result; @@ -3340,11 +3565,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSRAD_UdqIb(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->rm(), result); +#endif } /* 66 0F 72 Grp13 110 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSLLD_UdqIb(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op = BX_READ_XMM_REG(i->rm()); @@ -3363,11 +3590,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSLLD_UdqIb(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->rm(), op); +#endif } /* 66 0F 73 Grp14 010 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSRLQ_UdqIb(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op = BX_READ_XMM_REG(i->rm()); @@ -3384,11 +3613,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSRLQ_UdqIb(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->rm(), op); +#endif } /* 66 0F 73 Grp14 011 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSRLDQ_UdqIb(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op = BX_READ_XMM_REG(i->rm()), result; @@ -3402,11 +3633,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSRLDQ_UdqIb(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->rm(), result); +#endif } /* 66 0F 73 Grp14 110 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSLLQ_UdqIb(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op = BX_READ_XMM_REG(i->rm()); @@ -3423,11 +3656,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSLLQ_UdqIb(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->rm(), op); +#endif } /* 66 0F 73 Grp14 111 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSLLDQ_UdqIb(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op = BX_READ_XMM_REG(i->rm()), result; @@ -3441,4 +3676,5 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PSLLDQ_UdqIb(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->rm(), result); +#endif } diff --git a/bochs/cpu/sse_move.cc b/bochs/cpu/sse_move.cc index 2850fa4bc..4c38383bc 100644 --- a/bochs/cpu/sse_move.cc +++ b/bochs/cpu/sse_move.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: sse_move.cc,v 1.108 2010-02-25 22:04:31 sshwarts Exp $ +// $Id: sse_move.cc,v 1.109 2010-02-26 11:44:50 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (c) 2003-2009 Stanislav Shwartsman @@ -26,6 +26,8 @@ #include "cpu.h" #define LOG_THIS BX_CPU_THIS_PTR +#if BX_CPU_LEVEL >= 6 + void BX_CPU_C::print_state_SSE(void) { BX_DEBUG(("MXCSR: 0x%08x\n", BX_MXCSR_REGISTER)); @@ -36,6 +38,8 @@ void BX_CPU_C::print_state_SSE(void) } } +#endif + #if BX_SUPPORT_FPU Bit8u BX_CPU_C::pack_FPU_TW(Bit16u twd) { @@ -119,6 +123,7 @@ Bit16u BX_CPU_C::unpack_FPU_TW(Bit16u tag_byte) /* 0F AE Grp15 010 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::LDMXCSR(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); bx_address eaddr = BX_CPU_CALL_METHODR(i->ResolveModrm, (i)); @@ -128,11 +133,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::LDMXCSR(bxInstruction_c *i) exception(BX_GP_EXCEPTION, 0, 0); BX_MXCSR_REGISTER = new_mxcsr; +#endif } /* 0F AE Grp15 011 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::STMXCSR(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); Bit32u mxcsr = BX_MXCSR_REGISTER & MXCSR_MASK; @@ -140,11 +147,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::STMXCSR(bxInstruction_c *i) bx_address eaddr = BX_CPU_CALL_METHODR(i->ResolveModrm, (i)); write_virtual_dword(i->seg(), eaddr, mxcsr); +#endif } /* 0F AE Grp15 000 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FXSAVE(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 unsigned index; BxPackedXmmRegister xmm; @@ -242,6 +251,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FXSAVE(bxInstruction_c *i) return; // skip saving of the XMM state #endif + if (BX_CPU_SUPPORT_FEATURE(BX_CPU_SSE)) { /* store XMM register file */ @@ -256,11 +266,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FXSAVE(bxInstruction_c *i) } /* do not touch reserved fields */ +#endif } /* 0F AE Grp15 001 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FXRSTOR(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BxPackedXmmRegister xmm; unsigned index; @@ -316,6 +328,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FXRSTOR(bxInstruction_c *i) BX_CPU_THIS_PTR the_i387.fds = xmm.xmm16u(2); } +#if BX_CPU_LEVEL >= 6 /* If the OSFXSR bit in CR4 is not set, the FXRSTOR instruction does not restore the states of the XMM and MXCSR registers. */ if(BX_CPU_THIS_PTR cr4.get_OSFXSR()) @@ -326,6 +339,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FXRSTOR(bxInstruction_c *i) BX_MXCSR_REGISTER = new_mxcsr; } +#endif /* load i387 register file */ for(index=0; index < 8; index++) @@ -353,6 +367,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FXRSTOR(bxInstruction_c *i) return; // skip restore of the XMM state #endif +#if BX_CPU_LEVEL >= 6 /* If the OSFXSR bit in CR4 is not set, the FXRSTOR instruction does not restore the states of the XMM and MXCSR registers. */ if(BX_CPU_THIS_PTR cr4.get_OSFXSR()) @@ -367,6 +382,9 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FXRSTOR(bxInstruction_c *i) } } } +#endif + +#endif } /* *************************** */ @@ -380,6 +398,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FXRSTOR(bxInstruction_c *i) /* MOVDQU: F3 0F 6F */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVUPS_VpsWpsM(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op; @@ -388,6 +407,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVUPS_VpsWpsM(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op); +#endif } /* MOVUPS: 0F 11 */ @@ -395,10 +415,12 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVUPS_VpsWpsM(bxInstruction_c *i) /* MOVDQU: F3 0F 7F */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVUPS_WpsVpsM(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op = BX_READ_XMM_REG(i->nnn()); bx_address eaddr = BX_CPU_CALL_METHODR(i->ResolveModrm, (i)); write_virtual_dqword(i->seg(), eaddr, (Bit8u *) &op); +#endif } /* MOVAPS: 0F 28 */ @@ -406,12 +428,15 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVUPS_WpsVpsM(bxInstruction_c *i) /* MOVDQA: F3 0F 6F */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVAPS_VpsWpsR(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BX_WRITE_XMM_REG(i->nnn(), BX_READ_XMM_REG(i->rm())); +#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVAPS_VpsWpsM(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op; @@ -420,6 +445,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVAPS_VpsWpsM(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op); +#endif } /* MOVAPS: 0F 29 */ @@ -427,30 +453,37 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVAPS_VpsWpsM(bxInstruction_c *i) /* MOVDQA: F3 0F 7F */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVAPS_WpsVpsR(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BX_WRITE_XMM_REG(i->rm(), BX_READ_XMM_REG(i->nnn())); +#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVAPS_WpsVpsM(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op = BX_READ_XMM_REG(i->nnn()); bx_address eaddr = BX_CPU_CALL_METHODR(i->ResolveModrm, (i)); write_virtual_dqword_aligned(i->seg(), eaddr, (Bit8u *) &op); +#endif } /* F3 0F 10 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVSS_VssWssR(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); /* If the source operand is an XMM register, the high-order 96 bits of the destination XMM register are not modified. */ BX_WRITE_XMM_REG_LO_DWORD(i->nnn(), BX_READ_XMM_REG_LO_DWORD(i->rm())); +#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVSS_VssWssM(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op; @@ -464,30 +497,36 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVSS_VssWssM(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op); +#endif } /* F3 0F 11 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVSS_WssVssM(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); bx_address eaddr = BX_CPU_CALL_METHODR(i->ResolveModrm, (i)); write_virtual_dword(i->seg(), eaddr, BX_READ_XMM_REG_LO_DWORD(i->nnn())); +#endif } /* F2 0F 10 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVSD_VsdWsdR(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); /* If the source operand is an XMM register, the high-order 64 bits of the destination XMM register are not modified. */ BX_WRITE_XMM_REG_LO_QWORD(i->nnn(), BX_READ_XMM_REG_LO_QWORD(i->rm())); +#endif } /* MOVLPS: 0F 12 */ /* MOVLPD: 66 0F 12 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVLPS_VpsMq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); Bit64u val64; @@ -503,11 +542,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVLPS_VpsMq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG_LO_QWORD(i->nnn(), val64); +#endif } /* F2 0F 12 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVDDUP_VpdWq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); Bit64u val64; BxPackedXmmRegister op; @@ -527,11 +568,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVDDUP_VpdWq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op); +#endif } /* F3 0F 12 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVSLDUP_VpsWps(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op, result; @@ -552,11 +595,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVSLDUP_VpsWps(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* F3 0F 16 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVSHDUP_VpsWps(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op, result; @@ -577,21 +622,25 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVSHDUP_VpsWps(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* MOVLPS: 0F 13 */ /* MOVLPD: 66 0F 13 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVLPS_MqVps(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); bx_address eaddr = BX_CPU_CALL_METHODR(i->ResolveModrm, (i)); write_virtual_qword(i->seg(), eaddr, BX_XMM_REG_LO_QWORD(i->nnn())); +#endif } /* MOVHPS: 0F 16 */ /* MOVHPD: 66 0F 16 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVHPS_VpsMq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); Bit64u val64; @@ -607,20 +656,24 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVHPS_VpsMq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG_HI_QWORD(i->nnn(), val64); +#endif } /* MOVHPS: 0F 17 */ /* MOVHPD: 66 0F 17 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVHPS_MqVps(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); bx_address eaddr = BX_CPU_CALL_METHODR(i->ResolveModrm, (i)); write_virtual_qword(i->seg(), eaddr, BX_XMM_REG_HI_QWORD(i->nnn())); +#endif } /* F2 0F F0 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::LDDQU_VdqMdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op; @@ -629,11 +682,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::LDDQU_VdqMdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op); +#endif } /* 66 0F F7 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MASKMOVDQU_VdqUdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); bx_address rdi; @@ -665,11 +720,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MASKMOVDQU_VdqUdq(bxInstruction_c *i) /* and write result back to the memory */ write_virtual_dqword(i->seg(), rdi, (Bit8u *) &temp); +#endif } /* 0F 50 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVMSKPS_GdVRps(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op = BX_READ_XMM_REG(i->nnn()); @@ -681,11 +738,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVMSKPS_GdVRps(bxInstruction_c *i) if(op.xmm32u(3) & 0x80000000) val32 |= 0x8; BX_WRITE_32BIT_REGZ(i->rm(), val32); +#endif } /* 66 0F 50 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVMSKPD_GdVRpd(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op = BX_READ_XMM_REG(i->nnn()); @@ -695,11 +754,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVMSKPD_GdVRpd(bxInstruction_c *i) if(op.xmm32u(3) & 0x80000000) val32 |= 0x2; BX_WRITE_32BIT_REGZ(i->rm(), val32); +#endif } /* 66 0F 6E */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVD_VdqEdR(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op; @@ -707,6 +768,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVD_VdqEdR(bxInstruction_c *i) op.xmm64u(1) = 0; BX_WRITE_XMM_REG(i->nnn(), op); +#endif } #if BX_SUPPORT_X86_64 @@ -714,6 +776,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVD_VdqEdR(bxInstruction_c *i) /* 66 0F 6E */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVQ_VdqEqR(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op; @@ -721,6 +784,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVQ_VdqEqR(bxInstruction_c *i) op.xmm64u(1) = 0; BX_WRITE_XMM_REG(i->nnn(), op); +#endif } #endif @@ -728,15 +792,19 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVQ_VdqEqR(bxInstruction_c *i) /* 66 0F 7E */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVD_EdVdR(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BX_WRITE_32BIT_REGZ(i->rm(), BX_READ_XMM_REG_LO_DWORD(i->nnn())); +#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVD_EdVdM(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); bx_address eaddr = BX_CPU_CALL_METHODR(i->ResolveModrm, (i)); write_virtual_dword(i->seg(), eaddr, BX_READ_XMM_REG_LO_DWORD(i->nnn())); +#endif } #if BX_SUPPORT_X86_64 @@ -744,8 +812,10 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVD_EdVdM(bxInstruction_c *i) /* 66 0F 7E */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVQ_EqVqR(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BX_WRITE_64BIT_REG(i->rm(), BX_READ_XMM_REG_LO_QWORD(i->nnn())); +#endif } #endif @@ -753,6 +823,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVQ_EqVqR(bxInstruction_c *i) /* F3 0F 7E */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVQ_VqWqR(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op; @@ -761,10 +832,12 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVQ_VqWqR(bxInstruction_c *i) op.xmm64u(1) = 0; /* zero-extension to 128 bit */ BX_WRITE_XMM_REG(i->nnn(), op); +#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVQ_VqWqM(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op; @@ -775,29 +848,35 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVQ_VqWqM(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op); +#endif } /* 66 0F D6 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVQ_WqVqR(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op; op.xmm64u(0) = BX_READ_XMM_REG_LO_QWORD(i->nnn()); op.xmm64u(1) = 0; /* zero-extension to 128 bit */ BX_WRITE_XMM_REG(i->rm(), op); +#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVQ_WqVqM(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); bx_address eaddr = BX_CPU_CALL_METHODR(i->ResolveModrm, (i)); write_virtual_qword(i->seg(), eaddr, BX_READ_XMM_REG_LO_QWORD(i->nnn())); +#endif } /* F2 0F D6 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVDQ2Q_PqVRq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BX_CPU_THIS_PTR FPU_check_pending_exceptions(); /* check floating point status word for a pending FPU exceptions */ BX_CPU_THIS_PTR prepareFPU2MMX(); @@ -806,11 +885,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVDQ2Q_PqVRq(bxInstruction_c *i) MMXUQ(mm) = BX_READ_XMM_REG_LO_QWORD(i->nnn()); BX_WRITE_MMX_REG(i->rm(), mm); +#endif } /* F3 0F D6 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVQ2DQ_VdqQq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BX_CPU_THIS_PTR FPU_check_pending_exceptions(); /* check floating point status word for a pending FPU exceptions */ BX_CPU_THIS_PTR prepareFPU2MMX(); @@ -822,11 +903,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVQ2DQ_VdqQq(bxInstruction_c *i) op.xmm64u(1) = 0; BX_WRITE_XMM_REG(i->rm(), op); +#endif } /* 66 0F D7 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMOVMSKB_GdUdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op = BX_READ_XMM_REG(i->rm()); @@ -851,6 +934,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMOVMSKB_GdUdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_32BIT_REGZ(i->nnn(), result); +#endif } /* **************************** */ @@ -860,8 +944,10 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMOVMSKB_GdUdq(bxInstruction_c *i) /* 0F C3 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVNTI_MdGd(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 bx_address eaddr = BX_CPU_CALL_METHODR(i->ResolveModrm, (i)); write_virtual_dword(i->seg(), eaddr, BX_READ_32BIT_REG(i->nnn())); +#endif } #if BX_SUPPORT_X86_64 @@ -869,8 +955,10 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVNTI_MdGd(bxInstruction_c *i) /* 0F C3 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVNTI_MqGq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 bx_address eaddr = BX_CPU_CALL_METHODR(i->ResolveModrm, (i)); write_virtual_qword_64(i->seg(), eaddr, BX_READ_64BIT_REG(i->nnn())); +#endif } #endif @@ -880,9 +968,11 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVNTI_MqGq(bxInstruction_c *i) /* MOVNTDQ: 66 0F E7 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVNTPS_MpsVps(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); bx_address eaddr = BX_CPU_CALL_METHODR(i->ResolveModrm, (i)); write_virtual_dqword_aligned(i->seg(), eaddr, (Bit8u *)(&BX_READ_XMM_REG(i->nnn()))); +#endif } /* ************************** */ @@ -892,6 +982,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVNTPS_MpsVps(bxInstruction_c *i) /* 66 0F 38 20 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMOVSXBW_VdqWq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister result; Bit64u val64; @@ -917,11 +1008,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMOVSXBW_VdqWq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* 66 0F 38 21 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMOVSXBD_VdqWd(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister result; Bit32u val32; @@ -943,11 +1036,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMOVSXBD_VdqWd(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* 66 0F 38 22 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMOVSXBQ_VdqWw(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister result; Bit16u val16; @@ -967,11 +1062,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMOVSXBQ_VdqWw(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* 66 0F 38 23 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMOVSXWD_VdqWq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister result; Bit64u val64; @@ -993,11 +1090,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMOVSXWD_VdqWq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* 66 0F 38 24 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMOVSXWQ_VdqWd(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister result; Bit32u val32; @@ -1017,11 +1116,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMOVSXWQ_VdqWd(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* 66 0F 38 25 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMOVSXDQ_VdqWq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister result; Bit64u val64; @@ -1041,11 +1142,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMOVSXDQ_VdqWq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* 66 0F 38 2A */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVNTDQA_VdqMdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 /* source must be memory reference */ if (i->modC0()) { BX_INFO(("MOVNTDQA_VdqMdq: must be memory reference")); @@ -1062,11 +1165,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVNTDQA_VdqMdq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), op); +#endif } /* 66 0F 38 30 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMOVZXBW_VdqWq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister result; Bit64u val64; @@ -1092,11 +1197,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMOVZXBW_VdqWq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* 66 0F 38 31 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMOVZXBD_VdqWd(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister result; Bit32u val32; @@ -1118,11 +1225,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMOVZXBD_VdqWd(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* 66 0F 38 32 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMOVZXBQ_VdqWw(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister result; Bit16u val16; @@ -1142,11 +1251,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMOVZXBQ_VdqWw(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* 66 0F 38 33 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMOVZXWD_VdqWq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister result; Bit64u val64; @@ -1168,11 +1279,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMOVZXWD_VdqWq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* 66 0F 38 34 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMOVZXWQ_VdqWd(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister result; Bit32u val32; @@ -1192,11 +1305,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMOVZXWQ_VdqWd(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* 66 0F 38 35 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMOVZXDQ_VdqWq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister result; Bit64u val64; @@ -1216,11 +1331,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMOVZXDQ_VdqWq(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* 66 0F 3A 0F */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PALIGNR_VdqWdqIb(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2, result; @@ -1274,4 +1391,5 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PALIGNR_VdqWdqIb(bxInstruction_c *i) /* now write result back to destination */ BX_WRITE_XMM_REG(i->nnn(), result); +#endif } diff --git a/bochs/cpu/sse_pfp.cc b/bochs/cpu/sse_pfp.cc index 00b93ffb2..a035212b8 100644 --- a/bochs/cpu/sse_pfp.cc +++ b/bochs/cpu/sse_pfp.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: sse_pfp.cc,v 1.63 2010-02-25 22:04:31 sshwarts Exp $ +// $Id: sse_pfp.cc,v 1.64 2010-02-26 11:44:50 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (c) 2003-2009 Stanislav Shwartsman @@ -26,6 +26,8 @@ #include "cpu.h" #define LOG_THIS BX_CPU_THIS_PTR +#if BX_CPU_LEVEL >= 6 + #include "fpu/softfloat-specialize.h" void BX_CPU_C::check_exceptionsSSE(int exceptions_flags) @@ -70,6 +72,8 @@ static float64_compare_method compare64[4] = { float64_unordered }; +#endif // BX_CPU_LEVEL >= 6 + /* * Opcode: 0F 2A * Convert two 32bit signed integers from MMX/MEM to two single precision FP @@ -79,6 +83,7 @@ static float64_compare_method compare64[4] = { */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTPI2PS_VpsQqR(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister result; @@ -97,10 +102,12 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTPI2PS_VpsQqR(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); prepareFPU2MMX(); /* cause FPU2MMX state transition */ BX_WRITE_XMM_REG_LO_QWORD(i->nnn(), result.xmm64u(0)); +#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTPI2PS_VpsQqM(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedMmxRegister op; @@ -118,6 +125,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTPI2PS_VpsQqM(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG_LO_QWORD(i->nnn(), result.xmm64u(0)); +#endif } /* @@ -127,6 +135,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTPI2PS_VpsQqM(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTPI2PD_VpdQqR(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister result; @@ -141,10 +150,12 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTPI2PD_VpdQqR(bxInstruction_c *i) result.xmm64u(1) = int32_to_float64(MMXUD1(op)); BX_WRITE_XMM_REG(i->nnn(), result); +#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTPI2PD_VpdQqM(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedMmxRegister op; @@ -158,6 +169,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTPI2PD_VpdQqM(bxInstruction_c *i) result.xmm64u(1) = int32_to_float64(MMXUD1(op)); BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* @@ -167,6 +179,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTPI2PD_VpdQqM(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTSI2SD_VsdEdR(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); float_status_t status_word; @@ -182,10 +195,12 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTSI2SD_VsdEdR(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG_LO_QWORD(i->nnn(), result); +#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTSI2SD_VsdEdM(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); float_status_t status_word; @@ -209,6 +224,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTSI2SD_VsdEdM(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG_LO_QWORD(i->nnn(), result); +#endif } /* @@ -220,6 +236,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTSI2SD_VsdEdM(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTSI2SS_VssEdR(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); float_status_t status_word; @@ -235,10 +252,12 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTSI2SS_VssEdR(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG_LO_DWORD(i->nnn(), result); +#endif } void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTSI2SS_VssEdM(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); float_status_t status_word; @@ -262,6 +281,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTSI2SS_VssEdM(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG_LO_DWORD(i->nnn(), result); +#endif } /* @@ -272,6 +292,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTSI2SS_VssEdM(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTTPS2PI_PqWps(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); /* check floating point status word for a pending FPU exceptions */ @@ -307,6 +328,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTTPS2PI_PqWps(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); prepareFPU2MMX(); /* cause FPU2MMX state transition */ BX_WRITE_MMX_REG(i->nnn(), result); +#endif } /* @@ -317,6 +339,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTTPS2PI_PqWps(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTTPD2PI_PqWpd(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); /* check floating point status word for a pending FPU exceptions */ @@ -349,6 +372,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTTPD2PI_PqWpd(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); prepareFPU2MMX(); /* cause FPU2MMX state transition */ BX_WRITE_MMX_REG(i->nnn(), result); +#endif } /* @@ -359,6 +383,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTTPD2PI_PqWpd(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTTSD2SI_GdWsd(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); float64 op; @@ -392,6 +417,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTTSD2SI_GdWsd(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_32BIT_REGZ(i->nnn(), result); } +#endif } /* @@ -402,6 +428,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTTSD2SI_GdWsd(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTTSS2SI_GdWss(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); float32 op; @@ -435,6 +462,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTTSS2SI_GdWss(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_32BIT_REGZ(i->nnn(), result); } +#endif } /* @@ -446,6 +474,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTTSS2SI_GdWss(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTPS2PI_PqWps(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); /* check floating point status word for a pending FPU exceptions */ @@ -481,6 +510,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTPS2PI_PqWps(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); prepareFPU2MMX(); /* cause FPU2MMX state transition */ BX_WRITE_MMX_REG(i->nnn(), result); +#endif } /* @@ -492,6 +522,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTPS2PI_PqWps(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTPD2PI_PqWpd(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); /* check floating point status word for a pending FPU exceptions */ @@ -524,6 +555,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTPD2PI_PqWpd(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); prepareFPU2MMX(); /* cause FPU2MMX state transition */ BX_WRITE_MMX_REG(i->nnn(), result); +#endif } /* @@ -535,6 +567,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTPD2PI_PqWpd(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTSD2SI_GdWsd(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); float64 op; @@ -567,6 +600,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTSD2SI_GdWsd(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_32BIT_REGZ(i->nnn(), result); } +#endif } /* @@ -578,6 +612,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTSD2SI_GdWsd(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTSS2SI_GdWss(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); float32 op; @@ -610,6 +645,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTSS2SI_GdWss(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_32BIT_REGZ(i->nnn(), result); } +#endif } /* @@ -619,6 +655,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTSS2SI_GdWss(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTPS2PD_VpsWps(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); Bit64u op; @@ -650,6 +687,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTPS2PD_VpsWps(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* @@ -661,6 +699,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTPS2PD_VpsWps(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTPD2PS_VpdWpd(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op, result; @@ -690,6 +729,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTPD2PS_VpdWpd(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* @@ -701,6 +741,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTPD2PS_VpdWpd(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTSD2SS_VsdWsd(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); float64 op; @@ -722,6 +763,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTSD2SS_VsdWsd(bxInstruction_c *i) result = float64_to_float32(op, status_word); check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG_LO_DWORD(i->nnn(), result); +#endif } /* @@ -731,6 +773,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTSD2SS_VsdWsd(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTSS2SD_VssWss(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); float32 op; @@ -752,6 +795,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTSS2SD_VssWss(bxInstruction_c *i) result = float32_to_float64(op, status_word); check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG_LO_QWORD(i->nnn(), result); +#endif } /* @@ -763,6 +807,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTSS2SD_VssWss(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTDQ2PS_VpsWdq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op; @@ -787,6 +832,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTDQ2PS_VpsWdq(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG(i->nnn(), op); +#endif } /* @@ -798,6 +844,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTDQ2PS_VpsWdq(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTPS2DQ_VdqWps(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op; @@ -829,6 +876,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTPS2DQ_VdqWps(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG(i->nnn(), op); +#endif } /* @@ -839,6 +887,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTPS2DQ_VdqWps(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTTPS2DQ_VdqWps(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op; @@ -870,6 +919,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTTPS2DQ_VdqWps(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG(i->nnn(), op); +#endif } /* @@ -880,6 +930,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTTPS2DQ_VdqWps(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTTPD2DQ_VqWpd(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op, result; @@ -908,6 +959,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTTPD2DQ_VqWpd(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* @@ -919,6 +971,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTTPD2DQ_VqWpd(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTPD2DQ_VqWpd(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op, result; @@ -947,6 +1000,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTPD2DQ_VqWpd(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* @@ -956,6 +1010,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTPD2DQ_VqWpd(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTDQ2PD_VpdWq(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); Bit64u op; @@ -978,6 +1033,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTDQ2PD_VpdWq(bxInstruction_c *i) result.xmm64u(1) = int32_to_float64(r1); BX_WRITE_XMM_REG(i->nnn(), result); +#endif } /* @@ -987,6 +1043,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTDQ2PD_VpdWq(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::UCOMISS_VssWss(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); float32 op1 = BX_READ_XMM_REG_LO_DWORD(i->nnn()), op2; @@ -1013,6 +1070,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::UCOMISS_VssWss(bxInstruction_c *i) int rc = float32_compare_quiet(op1, op2, status_word); check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR write_eflags_fpu_compare(rc); +#endif } /* @@ -1022,6 +1080,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::UCOMISS_VssWss(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::UCOMISD_VsdWsd(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); float64 op1 = BX_READ_XMM_REG_LO_QWORD(i->nnn()), op2; @@ -1048,6 +1107,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::UCOMISD_VsdWsd(bxInstruction_c *i) int rc = float64_compare_quiet(op1, op2, status_word); check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR write_eflags_fpu_compare(rc); +#endif } /* @@ -1057,6 +1117,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::UCOMISD_VsdWsd(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::COMISS_VpsWps(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); float32 op1 = BX_READ_XMM_REG_LO_DWORD(i->nnn()), op2; @@ -1083,6 +1144,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::COMISS_VpsWps(bxInstruction_c *i) int rc = float32_compare(op1, op2, status_word); check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR write_eflags_fpu_compare(rc); +#endif } /* @@ -1092,6 +1154,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::COMISS_VpsWps(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::COMISD_VpdWpd(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); float64 op1 = BX_READ_XMM_REG_LO_QWORD(i->nnn()), op2; @@ -1118,6 +1181,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::COMISD_VpdWpd(bxInstruction_c *i) int rc = float64_compare(op1, op2, status_word); check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR write_eflags_fpu_compare(rc); +#endif } /* @@ -1127,6 +1191,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::COMISD_VpdWpd(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::SQRTPS_VpsWps(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op; @@ -1159,6 +1224,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::SQRTPS_VpsWps(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG(i->nnn(), op); +#endif } /* @@ -1168,6 +1234,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::SQRTPS_VpsWps(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::SQRTPD_VpdWpd(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op; @@ -1196,6 +1263,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::SQRTPD_VpdWpd(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG(i->nnn(), op); +#endif } /* @@ -1205,6 +1273,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::SQRTPD_VpdWpd(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::SQRTSD_VsdWsd(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); float64 op; @@ -1225,6 +1294,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::SQRTSD_VsdWsd(bxInstruction_c *i) op = float64_sqrt(op, status_word); check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG_LO_QWORD(i->nnn(), op); +#endif } /* @@ -1234,6 +1304,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::SQRTSD_VsdWsd(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::SQRTSS_VssWss(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); float32 op; @@ -1254,6 +1325,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::SQRTSS_VssWss(bxInstruction_c *i) op = float32_sqrt(op, status_word); check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG_LO_DWORD(i->nnn(), op); +#endif } /* @@ -1263,6 +1335,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::SQRTSS_VssWss(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::ADDPS_VpsWps(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -1299,6 +1372,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::ADDPS_VpsWps(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* @@ -1308,6 +1382,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::ADDPS_VpsWps(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::ADDPD_VpdWpd(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -1338,6 +1413,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::ADDPD_VpdWpd(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* @@ -1347,6 +1423,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::ADDPD_VpdWpd(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::ADDSD_VsdWsd(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); float64 op1 = BX_READ_XMM_REG_LO_QWORD(i->nnn()), op2; @@ -1373,6 +1450,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::ADDSD_VsdWsd(bxInstruction_c *i) op1 = float64_add(op1, op2, status_word); check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG_LO_QWORD(i->nnn(), op1); +#endif } /* @@ -1382,6 +1460,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::ADDSD_VsdWsd(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::ADDSS_VssWss(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); float32 op1 = BX_READ_XMM_REG_LO_DWORD(i->nnn()), op2; @@ -1408,6 +1487,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::ADDSS_VssWss(bxInstruction_c *i) op1 = float32_add(op1, op2, status_word); check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG_LO_DWORD(i->nnn(), op1); +#endif } /* @@ -1417,6 +1497,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::ADDSS_VssWss(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MULPS_VpsWps(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -1453,6 +1534,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MULPS_VpsWps(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* @@ -1462,6 +1544,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MULPS_VpsWps(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MULPD_VpdWpd(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -1492,6 +1575,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MULPD_VpdWpd(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* @@ -1501,6 +1585,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MULPD_VpdWpd(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MULSD_VsdWsd(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); float64 op1 = BX_READ_XMM_REG_LO_QWORD(i->nnn()), op2; @@ -1527,6 +1612,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MULSD_VsdWsd(bxInstruction_c *i) op1 = float64_mul(op1, op2, status_word); check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG_LO_QWORD(i->nnn(), op1); +#endif } /* @@ -1536,6 +1622,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MULSD_VsdWsd(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MULSS_VssWss(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); float32 op1 = BX_READ_XMM_REG_LO_DWORD(i->nnn()), op2; @@ -1562,6 +1649,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MULSS_VssWss(bxInstruction_c *i) op1 = float32_mul(op1, op2, status_word); check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG_LO_DWORD(i->nnn(), op1); +#endif } /* @@ -1571,6 +1659,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MULSS_VssWss(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::SUBPS_VpsWps(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -1607,6 +1696,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::SUBPS_VpsWps(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* @@ -1616,6 +1706,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::SUBPS_VpsWps(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::SUBPD_VpdWpd(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -1646,6 +1737,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::SUBPD_VpdWpd(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* @@ -1655,6 +1747,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::SUBPD_VpdWpd(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::SUBSD_VsdWsd(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); float64 op1 = BX_READ_XMM_REG_LO_QWORD(i->nnn()), op2; @@ -1681,6 +1774,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::SUBSD_VsdWsd(bxInstruction_c *i) op1 = float64_sub(op1, op2, status_word); check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG_LO_QWORD(i->nnn(), op1); +#endif } /* @@ -1690,6 +1784,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::SUBSD_VsdWsd(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::SUBSS_VssWss(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); float32 op1 = BX_READ_XMM_REG_LO_DWORD(i->nnn()), op2; @@ -1716,6 +1811,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::SUBSS_VssWss(bxInstruction_c *i) op1 = float32_sub(op1, op2, status_word); check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG_LO_DWORD(i->nnn(), op1); +#endif } /* @@ -1725,6 +1821,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::SUBSS_VssWss(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MINPS_VpsWps(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -1766,6 +1863,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MINPS_VpsWps(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* @@ -1775,6 +1873,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MINPS_VpsWps(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MINPD_VpdWpd(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -1808,6 +1907,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MINPD_VpdWpd(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* @@ -1817,6 +1917,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MINPD_VpdWpd(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MINSD_VsdWsd(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); float64 op1 = BX_READ_XMM_REG_LO_QWORD(i->nnn()), op2; @@ -1844,6 +1945,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MINSD_VsdWsd(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG_LO_QWORD(i->nnn(), (rc == float_relation_less) ? op1 : op2); +#endif } /* @@ -1853,6 +1955,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MINSD_VsdWsd(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MINSS_VssWss(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); float32 op1 = BX_READ_XMM_REG_LO_DWORD(i->nnn()), op2; @@ -1880,6 +1983,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MINSS_VssWss(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG_LO_DWORD(i->nnn(), (rc == float_relation_less) ? op1 : op2); +#endif } /* @@ -1889,6 +1993,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MINSS_VssWss(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::DIVPS_VpsWps(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -1925,6 +2030,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::DIVPS_VpsWps(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* @@ -1934,6 +2040,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::DIVPS_VpsWps(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::DIVPD_VpdWpd(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -1964,6 +2071,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::DIVPD_VpdWpd(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* @@ -1973,6 +2081,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::DIVPD_VpdWpd(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::DIVSD_VsdWsd(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); float64 op1 = BX_READ_XMM_REG_LO_QWORD(i->nnn()), op2; @@ -1999,6 +2108,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::DIVSD_VsdWsd(bxInstruction_c *i) op1 = float64_div(op1, op2, status_word); check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG_LO_QWORD(i->nnn(), op1); +#endif } /* @@ -2008,6 +2118,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::DIVSD_VsdWsd(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::DIVSS_VssWss(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); float32 op1 = BX_READ_XMM_REG_LO_DWORD(i->nnn()), op2; @@ -2034,6 +2145,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::DIVSS_VssWss(bxInstruction_c *i) op1 = float32_div(op1, op2, status_word); check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG_LO_DWORD(i->nnn(), op1); +#endif } /* @@ -2043,6 +2155,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::DIVSS_VssWss(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MAXPS_VpsWps(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -2084,6 +2197,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MAXPS_VpsWps(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* @@ -2093,6 +2207,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MAXPS_VpsWps(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MAXPD_VpdWpd(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -2126,6 +2241,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MAXPD_VpdWpd(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* @@ -2135,6 +2251,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MAXPD_VpdWpd(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MAXSD_VsdWsd(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); float64 op1 = BX_READ_XMM_REG_LO_QWORD(i->nnn()), op2; @@ -2162,6 +2279,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MAXSD_VsdWsd(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG_LO_QWORD(i->nnn(), (rc == float_relation_greater) ? op1 : op2); +#endif } /* @@ -2171,6 +2289,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MAXSD_VsdWsd(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MAXSS_VssWss(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); float32 op1 = BX_READ_XMM_REG_LO_DWORD(i->nnn()), op2; @@ -2198,6 +2317,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MAXSS_VssWss(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG_LO_DWORD(i->nnn(), (rc == float_relation_greater) ? op1 : op2); +#endif } /* @@ -2207,6 +2327,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MAXSS_VssWss(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::HADDPD_VpdWpd(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -2237,6 +2358,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::HADDPD_VpdWpd(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* @@ -2246,6 +2368,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::HADDPD_VpdWpd(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::HADDPS_VpsWps(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -2282,6 +2405,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::HADDPS_VpsWps(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* @@ -2291,6 +2415,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::HADDPS_VpsWps(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::HSUBPD_VpdWpd(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -2321,6 +2446,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::HSUBPD_VpdWpd(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* @@ -2330,6 +2456,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::HSUBPD_VpdWpd(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::HSUBPS_VpsWps(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -2366,6 +2493,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::HSUBPS_VpsWps(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* @@ -2375,6 +2503,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::HSUBPS_VpsWps(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMPPS_VpsWpsIb(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -2438,6 +2567,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMPPS_VpsWpsIb(bxInstruction_c *i) check_exceptionsSSE(status.float_exception_flags); BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* @@ -2447,6 +2577,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMPPS_VpsWpsIb(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMPPD_VpdWpdIb(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -2498,6 +2629,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMPPD_VpdWpdIb(bxInstruction_c *i) check_exceptionsSSE(status.float_exception_flags); BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* @@ -2507,6 +2639,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMPPD_VpdWpdIb(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMPSD_VsdWsdIb(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); float64 op1 = BX_READ_XMM_REG_LO_QWORD(i->nnn()), op2, result = 0; @@ -2553,6 +2686,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMPSD_VsdWsdIb(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG_LO_QWORD(i->nnn(), result); +#endif } /* @@ -2562,6 +2696,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMPSD_VsdWsdIb(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMPSS_VssWssIb(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); float32 op1 = BX_READ_XMM_REG_LO_DWORD(i->nnn()), op2, result = 0; @@ -2608,6 +2743,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMPSS_VssWssIb(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG_LO_DWORD(i->nnn(), result); +#endif } /* @@ -2617,6 +2753,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMPSS_VssWssIb(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::ADDSUBPD_VpdWpd(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -2647,6 +2784,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::ADDSUBPD_VpdWpd(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* @@ -2656,6 +2794,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::ADDSUBPD_VpdWpd(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::ADDSUBPS_VpsWps(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -2692,11 +2831,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::ADDSUBPS_VpsWps(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* 66 0F 3A 08 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::ROUNDPS_VpsWpsIb(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op; @@ -2737,11 +2878,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::ROUNDPS_VpsWpsIb(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG(i->nnn(), op); +#endif } /* 66 0F 3A 09 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::ROUNDPD_VpdWpdIb(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op; @@ -2778,11 +2921,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::ROUNDPD_VpdWpdIb(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG(i->nnn(), op); +#endif } /* 66 0F 3A 0A */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::ROUNDSS_VssWssIb(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); float32 op; @@ -2815,11 +2960,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::ROUNDSS_VssWssIb(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG_LO_DWORD(i->nnn(), op); +#endif } /* 66 0F 3A 0B */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::ROUNDSD_VsdWsdIb(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); float64 op; @@ -2852,6 +2999,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::ROUNDSD_VsdWsdIb(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG_LO_QWORD(i->nnn(), op); +#endif } /* Opcode: 66 0F 3A 40 @@ -2861,6 +3009,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::ROUNDSD_VsdWsdIb(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::DPPS_VpsWpsIb(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2, tmp; @@ -2915,6 +3064,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::DPPS_VpsWpsIb(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } /* Opcode: 66 0F 3A 41 @@ -2924,6 +3074,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::DPPS_VpsWpsIb(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::DPPD_VpdWpdIb(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2, tmp; @@ -2966,4 +3117,5 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::DPPD_VpdWpdIb(bxInstruction_c *i) check_exceptionsSSE(status_word.float_exception_flags); BX_WRITE_XMM_REG(i->nnn(), op1); +#endif } diff --git a/bochs/cpu/sse_rcp.cc b/bochs/cpu/sse_rcp.cc index fe66bb4ab..2b28e8b54 100755 --- a/bochs/cpu/sse_rcp.cc +++ b/bochs/cpu/sse_rcp.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: sse_rcp.cc,v 1.23 2010-02-25 22:04:31 sshwarts Exp $ +// $Id: sse_rcp.cc,v 1.24 2010-02-26 11:44:50 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (c) 2003-2009 Stanislav Shwartsman @@ -26,6 +26,8 @@ #include "cpu.h" #define LOG_THIS BX_CPU_THIS_PTR +#if BX_CPU_LEVEL >= 6 + #include "fpu/softfloat-specialize.h" BX_CPP_INLINE float32 convert_to_QNaN(float32 op) @@ -335,6 +337,8 @@ static float32 approximate_rcp(float32 op) return packFloat32(sign, exp, (Bit32u)(rcp_table[fraction >> 12]) << 8); } +#endif + /* * Opcode: 0F 53 * Approximate reciprocals of packed single precision FP values from XMM2/MEM. @@ -342,6 +346,7 @@ static float32 approximate_rcp(float32 op) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::RCPPS_VpsWps(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op; @@ -361,6 +366,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::RCPPS_VpsWps(bxInstruction_c *i) op.xmm32u(3) = approximate_rcp(op.xmm32u(3)); BX_WRITE_XMM_REG(i->nnn(), op); +#endif } /* @@ -370,6 +376,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::RCPPS_VpsWps(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::RCPSS_VssWss(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); float32 op; @@ -385,8 +392,11 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::RCPSS_VssWss(bxInstruction_c *i) op = approximate_rcp(op); BX_WRITE_XMM_REG_LO_DWORD(i->nnn(), op); +#endif } +#if BX_CPU_LEVEL >= 6 + Bit16u rsqrt_table0[1024] = { 0x34f8, 0x34e0, 0x34d0, 0x34b8, 0x34a0, 0x3488, 0x3470, 0x3460, @@ -702,6 +712,8 @@ static float32 approximate_rsqrt(float32 op) return packFloat32(sign, exp, (Bit32u)(rsqrt_table[fraction >> 13]) << 8); } +#endif + /* * Opcode: F3 0F 52 * Approximate reciprocal of square root of scalar single precision FP value @@ -710,6 +722,7 @@ static float32 approximate_rsqrt(float32 op) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::RSQRTSS_VssWss(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); float32 op; @@ -725,6 +738,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::RSQRTSS_VssWss(bxInstruction_c *i) op = approximate_rsqrt(op); BX_WRITE_XMM_REG_LO_DWORD(i->nnn(), op); +#endif } /* @@ -735,6 +749,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::RSQRTSS_VssWss(bxInstruction_c *i) */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::RSQRTPS_VpsWps(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op; @@ -754,4 +769,5 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::RSQRTPS_VpsWps(bxInstruction_c *i) op.xmm32u(3) = approximate_rsqrt(op.xmm32u(3)); BX_WRITE_XMM_REG(i->nnn(), op); +#endif } diff --git a/bochs/cpu/sse_string.cc b/bochs/cpu/sse_string.cc index 20e903f7e..9a67425df 100755 --- a/bochs/cpu/sse_string.cc +++ b/bochs/cpu/sse_string.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: sse_string.cc,v 1.15 2010-02-25 22:04:31 sshwarts Exp $ +// $Id: sse_string.cc,v 1.16 2010-02-26 11:44:50 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (c) 2007-2009 Stanislav Shwartsman @@ -31,6 +31,8 @@ #define RCX ECX #endif +#if BX_CPU_LEVEL >= 6 + // Compare all pairs of Ai, Bj according to imm8 control static void compare_strings(Bit8u BoolRes[16][16], BxPackedXmmRegister op1, BxPackedXmmRegister op2, Bit8u imm) { @@ -284,9 +286,12 @@ static Bit16u aggregate(Bit8u BoolRes[16][16], unsigned len1, unsigned len2, Bit return result; } +#endif // BX_CPU_LEVEL >= 6 + /* 66 0F 3A 60 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PCMPESTRM_VdqWdqIb(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2, result; @@ -347,11 +352,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PCMPESTRM_VdqWdqIb(bxInstruction_c *i) setEFlagsOSZAPC(flags); BX_WRITE_XMM_REG(0, result); /* store result XMM0 */ +#endif } /* 66 0F 3A 61 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PCMPESTRI_VdqWdqIb(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -408,11 +415,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PCMPESTRI_VdqWdqIb(bxInstruction_c *i) if (result2 & 0x1) flags |= EFlagsOFMask; setEFlagsOSZAPC(flags); +#endif } /* 66 0F 3A 62 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PCMPISTRM_VdqWdqIb(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2, result; @@ -464,11 +473,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PCMPISTRM_VdqWdqIb(bxInstruction_c *i) setEFlagsOSZAPC(flags); BX_WRITE_XMM_REG(0, result); /* store result XMM0 */ +#endif } /* 66 0F 3A 63 */ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PCMPISTRI_VdqWdqIb(bxInstruction_c *i) { +#if BX_CPU_LEVEL >= 6 BX_CPU_THIS_PTR prepareSSE(); BxPackedXmmRegister op1 = BX_READ_XMM_REG(i->nnn()), op2; @@ -516,4 +527,5 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PCMPISTRI_VdqWdqIb(bxInstruction_c *i) if (result2 & 0x1) flags |= EFlagsOFMask; setEFlagsOSZAPC(flags); +#endif } diff --git a/bochs/doc/docbook/user/user.dbk b/bochs/doc/docbook/user/user.dbk index 209d327dd..65a8cf4db 100644 --- a/bochs/doc/docbook/user/user.dbk +++ b/bochs/doc/docbook/user/user.dbk @@ -1,7 +1,7 @@