diff --git a/bochs/config.h.in b/bochs/config.h.in index dff58feca..833324c65 100644 --- a/bochs/config.h.in +++ b/bochs/config.h.in @@ -618,6 +618,8 @@ typedef #define BX_SUPPORT_FPU 0 #define BX_SUPPORT_MMX 0 +#define BX_SUPPORT_SSE 0 +#define BX_SUPPORT_SSE2 0 #define BX_SUPPORT_4MEG_PAGES 0 #define BX_SupportGuest2HostTLB 0 #define BX_SupportRepeatSpeedups 0 @@ -661,7 +663,13 @@ typedef #endif #if (BX_SUPPORT_MMX && !BX_SUPPORT_FPU) -#error "MMX cannot be compiled without FPU support"; +#error "MMX cannot be compiled without FPU support" +#endif + +#if (BX_SUPPORT_SSE || BX_SUPPORT_SSE2) +#if (!BX_SUPPORT_FPU) || (!BX_SUPPORT_MMX) +#error "SSE cannot be compiled without FPU+MMX support" +#endif #endif #if BX_SUPPORT_X86_64 diff --git a/bochs/configure b/bochs/configure index 704fb2e93..2103171f6 100755 --- a/bochs/configure +++ b/bochs/configure @@ -878,6 +878,7 @@ Optional Features: --enable-vbe use VESA BIOS extensions --enable-mmx compile in MMX emulation --enable-fpu compile in FPU emulation + --enable-sse =1 (SSE) =2 (SSE2) support --enable-x86-debugger x86 debugger support --enable-cdrom CDROM support --enable-sb16=xxx Sound Blaster 16 Support (xxx=dummy|win|linux|freebsd) @@ -10361,7 +10362,70 @@ fi; +support_sse=0 +echo "$as_me:$LINENO: checking for SSE support" >&5 +echo $ECHO_N "checking for SSE support... $ECHO_C" >&6 +# Check whether --enable-sse or --disable-sse was given. +if test "${enable_sse+set}" = set; then + enableval="$enable_sse" + case "$enableval" in + no | 0) + support_sse=0 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + ;; + yes | 1) + support_sse=1 + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + ;; + 2) + support_sse=2 + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + ;; + *) + echo "ERROR: --enable-sse=$enableval not understood" + exit 1 + ;; + esac +else + + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + + +fi; + +if test "$support_sse" = 2; then + cat >>confdefs.h <<\_ACEOF +#define BX_SUPPORT_SSE 1 +_ACEOF + + cat >>confdefs.h <<\_ACEOF +#define BX_SUPPORT_SSE2 1 +_ACEOF + +elif test "$support_sse" = 1; then + cat >>confdefs.h <<\_ACEOF +#define BX_SUPPORT_SSE 1 +_ACEOF + + cat >>confdefs.h <<\_ACEOF +#define BX_SUPPORT_SSE2 0 +_ACEOF + +else + cat >>confdefs.h <<\_ACEOF +#define BX_SUPPORT_SSE 0 +_ACEOF + + cat >>confdefs.h <<\_ACEOF +#define BX_SUPPORT_SSE2 0 +_ACEOF + +fi echo "$as_me:$LINENO: checking for x86 debugger support" >&5 echo $ECHO_N "checking for x86 debugger support... $ECHO_C" >&6 diff --git a/bochs/configure.in b/bochs/configure.in index 555b6d683..ed31a15c1 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.148 2002-10-05 12:07:51 bdenney Exp $]]) +AC_REVISION([[$Id: configure.in,v 1.149 2002-10-11 01:11:10 kevinlawton Exp $]]) AC_CONFIG_HEADER(config.h) dnl // Put Bochs version information right here so that it gets substituted @@ -1126,7 +1126,44 @@ AC_ARG_ENABLE(fpu, AC_SUBST(FPU_VAR) AC_SUBST(FPU_GLUE_OBJ) +support_sse=0 +AC_MSG_CHECKING(for SSE support) +AC_ARG_ENABLE(sse, + [ --enable-sse =1 (SSE) =2 (SSE2) support], + [case "$enableval" in + no | 0) + support_sse=0 + AC_MSG_RESULT(no) + ;; + yes | 1) + support_sse=1 + AC_MSG_RESULT(yes) + ;; + 2) + support_sse=2 + AC_MSG_RESULT(yes) + ;; + *) + echo "ERROR: --enable-sse=$enableval not understood" + exit 1 + ;; + esac + ], + [ + AC_MSG_RESULT(no) + ] + ) +if test "$support_sse" = 2; then + AC_DEFINE(BX_SUPPORT_SSE, 1) + AC_DEFINE(BX_SUPPORT_SSE2, 1) +elif test "$support_sse" = 1; then + AC_DEFINE(BX_SUPPORT_SSE, 1) + AC_DEFINE(BX_SUPPORT_SSE2, 0) +else + AC_DEFINE(BX_SUPPORT_SSE, 0) + AC_DEFINE(BX_SUPPORT_SSE2, 0) +fi AC_MSG_CHECKING(for x86 debugger support) AC_ARG_ENABLE(x86-debugger, diff --git a/bochs/cpu/access.cc b/bochs/cpu/access.cc index e9e85e991..b7533986e 100644 --- a/bochs/cpu/access.cc +++ b/bochs/cpu/access.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: access.cc,v 1.30 2002-09-28 00:54:04 kevinlawton Exp $ +// $Id: access.cc,v 1.31 2002-10-11 01:11:11 kevinlawton Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001 MandrakeSoft S.A. @@ -1156,3 +1156,29 @@ accessOK: write_virtual_checks(seg, offset, 8); goto accessOK; } + + +#if BX_SUPPORT_SSE + + void +BX_CPU_C::readVirtualDQword(unsigned s, bx_address offset, Bit8u *data) +{ +} + + void +BX_CPU_C::readVirtualDQwordAligned(unsigned s, bx_address offset, Bit8u *data) +{ +} + + void +BX_CPU_C::writeVirtualDQword(unsigned s, bx_address offset, Bit8u *data) +{ +} + + + void +BX_CPU_C::writeVirtualDQwordAligned(unsigned s, bx_address offset, Bit8u *data) +{ +} + +#endif // #if BX_SUPPORT_SSE diff --git a/bochs/cpu/cpu.h b/bochs/cpu/cpu.h index 47eb095a2..081f09173 100644 --- a/bochs/cpu/cpu.h +++ b/bochs/cpu/cpu.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: cpu.h,v 1.101 2002-10-08 14:43:18 ptrumpet Exp $ +// $Id: cpu.h,v 1.102 2002-10-11 01:11:11 kevinlawton Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001 MandrakeSoft S.A. @@ -2507,6 +2507,14 @@ union { #define Write_RMW_virtual_dword(val32) write_RMW_virtual_dword(val32) #define Write_RMW_virtual_qword(val32) write_RMW_virtual_qword(val32) +#if BX_SUPPORT_SSE + BX_SMF void readVirtualDQword(unsigned s, bx_address off, Bit8u *data); + BX_SMF void readVirtualDQwordAligned(unsigned s, bx_address off, Bit8u *data); + BX_SMF void writeVirtualDQword(unsigned s, bx_address off, Bit8u *data); + BX_SMF void writeVirtualDQwordAligned(unsigned s, bx_address off, Bit8u *data); +#endif + + BX_SMF void access_linear(bx_address address, unsigned length, unsigned pl, unsigned rw, void *data); BX_SMF Bit32u itranslate_linear(bx_address laddr, unsigned pl); diff --git a/bochs/cpu/protect_ctrl.cc b/bochs/cpu/protect_ctrl.cc index 02ddfb11a..3cc72cc0f 100644 --- a/bochs/cpu/protect_ctrl.cc +++ b/bochs/cpu/protect_ctrl.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: protect_ctrl.cc,v 1.17 2002-10-08 14:43:18 ptrumpet Exp $ +// $Id: protect_ctrl.cc,v 1.18 2002-10-11 01:11:11 kevinlawton Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001 MandrakeSoft S.A. @@ -459,7 +459,10 @@ BX_CPU_C::LTR_Ew(bxInstruction_c *i) bx_descriptor_t descriptor; bx_selector_t selector; Bit16u raw_selector; - Bit32u dword1, dword2, dword3; + Bit32u dword1, dword2; +#if BX_SUPPORT_X86_64 + Bit32u dword3; +#endif /* #GP(0) if the current privilege level is not 0 */