From 7cc921d1dffe2bc5ff2abf0d3b26171a0bbe6fc0 Mon Sep 17 00:00:00 2001 From: Stanislav Shwartsman Date: Wed, 5 Apr 2006 18:49:35 +0000 Subject: [PATCH] Prepare configure support for SSE4 implemntation (coming soon) Rename _GAME configure macro to _GAMEPORT --- bochs/.conf.everything | 2 +- bochs/README | 6 ++-- bochs/config.h.in | 58 ++++++++++++++++----------------- bochs/configure | 47 ++++++++++++++++---------- bochs/configure.in | 30 ++++++++++------- bochs/doc/docbook/user/user.dbk | 4 +-- bochs/iodev/devices.cc | 6 ++-- bochs/iodev/gameport.cc | 10 +++--- bochs/iodev/gameport.h | 6 ++-- 9 files changed, 93 insertions(+), 76 deletions(-) diff --git a/bochs/.conf.everything b/bochs/.conf.everything index 5647a0a1d..79f39d9d6 100644 --- a/bochs/.conf.everything +++ b/bochs/.conf.everything @@ -19,7 +19,7 @@ --enable-vbe \ --enable-mmx \ --enable-fpu \ - --enable-sse=3 \ + --enable-sse=4 \ --enable-vme \ --enable-sep \ --enable-3dnow \ diff --git a/bochs/README b/bochs/README index 30a4b8da0..f9a5b6089 100644 --- a/bochs/README +++ b/bochs/README @@ -8,9 +8,9 @@ Bochs is a highly portable open source IA-32 (x86) PC emulator written in C++, that runs on most popular platforms. It includes emulation of the Intel x86 CPU, common I/O devices, and a custom BIOS. Currently, Bochs can be compiled to emulate a 386, 486, -Pentium, Pentium Pro or AMD64 CPU, including optional MMX, SSE, -SSE2 and 3DNow! instructions. Bochs is capable of running most -Operating Systems inside the emulation including Linux, DOS, +Pentium, Pentium Pro or x86-64 CPU, including optional MMX, +SSE/SSE2/SSE3 and 3DNow! instructions. Bochs is capable of running +most Operating Systems inside the emulation including Linux, DOS, Windows 95/98 and Windows NT/2000/XP. Bochs was written by Kevin Lawton and is currently maintained by the Bochs project at "http://bochs.sourceforge.net". diff --git a/bochs/config.h.in b/bochs/config.h.in index 45d37d411..5914c70b5 100644 --- a/bochs/config.h.in +++ b/bochs/config.h.in @@ -227,32 +227,32 @@ // 0 = Use nonstatic member functions (use only if you need // multiple instances of a device class -#define BX_USE_HD_SMF 1 // Hard drive -#define BX_USE_BIOS_SMF 1 // BIOS -#define BX_USE_CMOS_SMF 1 // CMOS -#define BX_USE_DMA_SMF 1 // DMA -#define BX_USE_FD_SMF 1 // Floppy -#define BX_USE_KEY_SMF 1 // Keyboard -#define BX_USE_PAR_SMF 1 // Parallel -#define BX_USE_PIC_SMF 1 // PIC -#define BX_USE_PIT_SMF 1 // PIT -#define BX_USE_SER_SMF 1 // Serial -#define BX_USE_UM_SMF 1 // Unmapped -#define BX_USE_VGA_SMF 1 // VGA -#define BX_USE_SB16_SMF 1 // Sound (SB 16) -#define BX_USE_DEV_SMF 1 // System Devices (port92) -#define BX_USE_PCI_SMF 1 // PCI -#define BX_USE_P2I_SMF 1 // PCI-to-ISA bridge -#define BX_USE_PIDE_SMF 1 // PCI-IDE -#define BX_USE_PCIVGA_SMF 1 // PCI-VGA -#define BX_USE_PCIDEV_SMF 1 // PCI-DEV -#define BX_USE_PCIUSB_SMF 1 // USB hub -#define BX_USE_PCIPNIC_SMF 1 // PCI pseudo NIC -#define BX_USE_NE2K_SMF 1 // NE2K -#define BX_USE_EFI_SMF 1 // External FPU IRQ -#define BX_USE_GAME_SMF 1 // Gameport -#define BX_USE_CIRRUS_SMF 1 // SVGA Cirrus -#define BX_USE_BUSM_SMF 1 // Bus Mouse +#define BX_USE_HD_SMF 1 // Hard drive +#define BX_USE_BIOS_SMF 1 // BIOS +#define BX_USE_CMOS_SMF 1 // CMOS +#define BX_USE_DMA_SMF 1 // DMA +#define BX_USE_FD_SMF 1 // Floppy +#define BX_USE_KEY_SMF 1 // Keyboard +#define BX_USE_PAR_SMF 1 // Parallel +#define BX_USE_PIC_SMF 1 // PIC +#define BX_USE_PIT_SMF 1 // PIT +#define BX_USE_SER_SMF 1 // Serial +#define BX_USE_UM_SMF 1 // Unmapped +#define BX_USE_VGA_SMF 1 // VGA +#define BX_USE_SB16_SMF 1 // Sound (SB 16) +#define BX_USE_DEV_SMF 1 // System Devices (port92) +#define BX_USE_PCI_SMF 1 // PCI +#define BX_USE_P2I_SMF 1 // PCI-to-ISA bridge +#define BX_USE_PIDE_SMF 1 // PCI-IDE +#define BX_USE_PCIVGA_SMF 1 // PCI-VGA +#define BX_USE_PCIDEV_SMF 1 // PCI-DEV +#define BX_USE_PCIUSB_SMF 1 // USB hub +#define BX_USE_PCIPNIC_SMF 1 // PCI pseudo NIC +#define BX_USE_NE2K_SMF 1 // NE2K +#define BX_USE_EFI_SMF 1 // External FPU IRQ +#define BX_USE_GAMEPORT_SMF 1 // Gameport +#define BX_USE_CIRRUS_SMF 1 // SVGA Cirrus +#define BX_USE_BUSM_SMF 1 // Bus Mouse #define BX_PLUGINS 0 #define BX_HAVE_DLFCN_H 0 @@ -265,13 +265,13 @@ || !BX_USE_SB16_SMF || !BX_USE_DEV_SMF || !BX_USE_PCI_SMF \ || !BX_USE_P2I_SMF || !BX_USE_PCIVGA_SMF || !BX_USE_PCIUSB_SMF \ || !BX_USE_PCIPNIC_SMF || !BX_USE_PIDE_SMF \ - || !BX_USE_NE2K_SMF || !BX_USE_EFI_SMF || !BX_USE_GAME_SMF \ + || !BX_USE_NE2K_SMF || !BX_USE_EFI_SMF || !BX_USE_GAMEPORT_SMF \ || !BX_USE_PCIDEV_SMF || !BX_USE_CIRRUS_SMF) #error You must use SMF to have plugins #endif -#define BX_SUPPORT_SB16 0 -#define BX_SUPPORT_GAME 0 +#define BX_SUPPORT_SB16 0 +#define BX_SUPPORT_GAMEPORT 0 #if BX_SUPPORT_SB16 // Use virtual methods for the sound output functions diff --git a/bochs/configure b/bochs/configure index 3cd2ab140..6fb1ca6c2 100755 --- a/bochs/configure +++ b/bochs/configure @@ -1084,7 +1084,7 @@ Optional Features: --enable-vme virtual 8086 mode extensions --enable-mmx MMX support --enable-3dnow 3DNow! support - --enable-sse SSE/SSE2/SSE3 support (--enable-sse=no|1|2|3) + --enable-sse SSE support (--enable-sse=no|1|2|3|4) --enable-daz denormals-are-zeroes support --enable-sep SYSENTER/SYSEXIT support --enable-x86-debugger x86 debugger support @@ -35809,21 +35809,26 @@ echo "${ECHO_T}no" >&6 ;; yes | 1) support_sse=1 - echo "$as_me:$LINENO: result: SSE only" >&5 -echo "${ECHO_T}SSE only" >&6 + echo "$as_me:$LINENO: result: SSE1" >&5 +echo "${ECHO_T}SSE1" >&6 ;; 2) support_sse=2 - echo "$as_me:$LINENO: result: SSE and SSE2" >&5 -echo "${ECHO_T}SSE and SSE2" >&6 + echo "$as_me:$LINENO: result: SSE2" >&5 +echo "${ECHO_T}SSE2" >&6 ;; 3) support_sse=3 - echo "$as_me:$LINENO: result: SSE" >&5 -echo "${ECHO_T}SSE" >&6 + echo "$as_me:$LINENO: result: SSE3" >&5 +echo "${ECHO_T}SSE3" >&6 + ;; + 4) + support_sse=4 + echo "$as_me:$LINENO: result: SSE4" >&5 +echo "${ECHO_T}SSE4" >&6 ;; *) - echo "ERROR: --enable-sse=$enableval not understood. Use --enable-sse=no|1|2" + echo "ERROR: --enable-sse=$enableval not understood. Use --enable-sse=no|1|2|3|4" exit 1 ;; esac @@ -35832,8 +35837,8 @@ else if test "$use_x86_64" = 1; then support_sse=2 - echo "$as_me:$LINENO: result: SSE and SSE2" >&5 -echo "${ECHO_T}SSE and SSE2" >&6 + echo "$as_me:$LINENO: result: SSE2" >&5 +echo "${ECHO_T}SSE2" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 @@ -35854,7 +35859,12 @@ echo "$as_me: error: x86-64 needs SSE2 support" >&2;} { (exit 1); exit 1; }; } fi -if test "$support_sse" = 3; then +if test "$support_sse" = 4; then + cat >>confdefs.h <<\_ACEOF +#define BX_SUPPORT_SSE 4 +_ACEOF + +elif test "$support_sse" = 3; then cat >>confdefs.h <<\_ACEOF #define BX_SUPPORT_SSE 3 _ACEOF @@ -36338,7 +36348,7 @@ if test "${enable_gameport+set}" = set; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 cat >>confdefs.h <<\_ACEOF -#define BX_SUPPORT_GAME 1 +#define BX_SUPPORT_GAMEPORT 1 _ACEOF if test "$gameport_present" = 0; then @@ -36354,7 +36364,7 @@ _ACEOF echo "${ECHO_T}no" >&6 GAME_OBJS='' cat >>confdefs.h <<\_ACEOF -#define BX_SUPPORT_GAME 0 +#define BX_SUPPORT_GAMEPORT 0 _ACEOF fi @@ -36362,14 +36372,14 @@ else if test "$gameport_present" = 1; then cat >>confdefs.h <<\_ACEOF -#define BX_SUPPORT_GAME 1 +#define BX_SUPPORT_GAMEPORT 1 _ACEOF echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else cat >>confdefs.h <<\_ACEOF -#define BX_SUPPORT_GAME 0 +#define BX_SUPPORT_GAMEPORT 0 _ACEOF echo "$as_me:$LINENO: result: no" >&5 @@ -39472,9 +39482,10 @@ for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` - # 2. Add them. - ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs diff --git a/bochs/configure.in b/bochs/configure.in index 1145a1151..15820e05f 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.316 2006-03-13 17:17:38 vruppert Exp $]]) +AC_REVISION([[$Id: configure.in,v 1.317 2006-04-05 18:49:30 sshwarts Exp $]]) AC_CONFIG_HEADER(config.h) AC_CONFIG_HEADER(ltdlconf.h) @@ -1523,7 +1523,7 @@ AC_ARG_ENABLE(3dnow, support_sse=0 AC_MSG_CHECKING(for SSE support) AC_ARG_ENABLE(sse, - [ --enable-sse SSE/SSE2/SSE3 support (--enable-sse=[no|1|2|3])], + [ --enable-sse SSE support (--enable-sse=[no|1|2|3|4])], [case "$enableval" in no | 0) support_sse=0 @@ -1531,18 +1531,22 @@ AC_ARG_ENABLE(sse, ;; yes | 1) support_sse=1 - AC_MSG_RESULT(SSE only) + AC_MSG_RESULT(SSE1) ;; 2) support_sse=2 - AC_MSG_RESULT(SSE and SSE2) + AC_MSG_RESULT(SSE2) ;; 3) support_sse=3 - AC_MSG_RESULT(SSE, SSE2 and SSE3) + AC_MSG_RESULT(SSE3) + ;; + 4) + support_sse=4 + AC_MSG_RESULT(SSE4) ;; *) - echo "ERROR: --enable-sse=$enableval not understood. Use --enable-sse=[no|1|2]" + echo "ERROR: --enable-sse=$enableval not understood. Use --enable-sse=[no|1|2|3|4]" exit 1 ;; esac @@ -1550,7 +1554,7 @@ AC_ARG_ENABLE(sse, [ if test "$use_x86_64" = 1; then support_sse=2 - AC_MSG_RESULT(SSE and SSE2) + AC_MSG_RESULT(SSE2) else AC_MSG_RESULT(no) fi @@ -1565,7 +1569,9 @@ if test "$support_sse" -lt 2 -a "$use_x86_64" = 1; then AC_MSG_ERROR([x86-64 needs SSE2 support]) fi -if test "$support_sse" = 3; then +if test "$support_sse" = 4; then + AC_DEFINE(BX_SUPPORT_SSE, 4) +elif test "$support_sse" = 3; then AC_DEFINE(BX_SUPPORT_SSE, 3) elif test "$support_sse" = 2; then AC_DEFINE(BX_SUPPORT_SSE, 2) @@ -1774,7 +1780,7 @@ AC_ARG_ENABLE(gameport, [ --enable-gameport enable standard PC gameport support], [if test "$enableval" = yes; then AC_MSG_RESULT(yes) - AC_DEFINE(BX_SUPPORT_GAME, 1) + AC_DEFINE(BX_SUPPORT_GAMEPORT, 1) if test "$gameport_present" = 0; then GAME_OBJS='gameport.o' case $target in @@ -1786,14 +1792,14 @@ AC_ARG_ENABLE(gameport, else AC_MSG_RESULT(no) GAME_OBJS='' - AC_DEFINE(BX_SUPPORT_GAME, 0) + AC_DEFINE(BX_SUPPORT_GAMEPORT, 0) fi], [ if test "$gameport_present" = 1; then - AC_DEFINE(BX_SUPPORT_GAME, 1) + AC_DEFINE(BX_SUPPORT_GAMEPORT, 1) AC_MSG_RESULT(yes) else - AC_DEFINE(BX_SUPPORT_GAME, 0) + AC_DEFINE(BX_SUPPORT_GAMEPORT, 0) AC_MSG_RESULT(no) fi] ) diff --git a/bochs/doc/docbook/user/user.dbk b/bochs/doc/docbook/user/user.dbk index 2e4938cc5..409ff9643 100644 --- a/bochs/doc/docbook/user/user.dbk +++ b/bochs/doc/docbook/user/user.dbk @@ -1,7 +1,7 @@ 386, 486, Pentium, Pentium Pro, or -AMD64 CPU, including optional MMX, SSE, SSE2, SSE3 and 3DNow! instructions. +x86-64 CPU, including optional MMX, SSE/SSE2/SSE3 and 3DNow! instructions. Bochs interprets every instruction from power-up to reboot, and has device models for all of the standard PC peripherals: keyboard, mouse, VGA card/monitor, disks, timer chips, network card, etc. Because Bochs diff --git a/bochs/iodev/devices.cc b/bochs/iodev/devices.cc index b55122135..63b07d36d 100644 --- a/bochs/iodev/devices.cc +++ b/bochs/iodev/devices.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: devices.cc,v 1.96 2006-03-26 22:15:05 sshwarts Exp $ +// $Id: devices.cc,v 1.97 2006-04-05 18:49:32 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2002 MandrakeSoft S.A. @@ -105,7 +105,7 @@ void bx_devices_c::init(BX_MEM_C *newmem) { unsigned i; - BX_DEBUG(("Init $Id: devices.cc,v 1.96 2006-03-26 22:15:05 sshwarts Exp $")); + BX_DEBUG(("Init $Id: devices.cc,v 1.97 2006-04-05 18:49:32 sshwarts Exp $")); mem = newmem; /* set no-default handlers, will be overwritten by the real default handler */ @@ -168,7 +168,7 @@ void bx_devices_c::init(BX_MEM_C *newmem) if (is_parallel_enabled()) PLUG_load_plugin(parallel, PLUGTYPE_OPTIONAL); PLUG_load_plugin(extfpuirq, PLUGTYPE_OPTIONAL); -#if BX_SUPPORT_GAME +#if BX_SUPPORT_GAMEPORT PLUG_load_plugin(gameport, PLUGTYPE_OPTIONAL); #endif PLUG_load_plugin(speaker, PLUGTYPE_OPTIONAL); diff --git a/bochs/iodev/gameport.cc b/bochs/iodev/gameport.cc index b780ac53c..4d4b77737 100644 --- a/bochs/iodev/gameport.cc +++ b/bochs/iodev/gameport.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: gameport.cc,v 1.7 2006-03-07 18:16:40 sshwarts Exp $ +// $Id: gameport.cc,v 1.8 2006-04-05 18:49:34 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2003 MandrakeSoft S.A. @@ -171,7 +171,7 @@ void bx_gameport_c::poll_joydev(void) Bit32u bx_gameport_c::read_handler(void *this_ptr, Bit32u address, unsigned io_len) { -#if !BX_USE_GAME_SMF +#if !BX_USE_GAMEPORT_SMF bx_gameport_c *class_ptr = (bx_gameport_c *) this_ptr; return class_ptr->read(address, io_len); } @@ -180,7 +180,7 @@ Bit32u bx_gameport_c::read(Bit32u address, unsigned io_len) { #else UNUSED(this_ptr); -#endif // !BX_USE_GAME_SMF +#endif // !BX_USE_GAMEPORT_SMF Bit64u usec; if (BX_GAMEPORT_THIS joyfd >= 0) { @@ -210,7 +210,7 @@ Bit32u bx_gameport_c::read(Bit32u address, unsigned io_len) void bx_gameport_c::write_handler(void *this_ptr, Bit32u address, Bit32u value, unsigned io_len) { -#if !BX_USE_GAME_SMF +#if !BX_USE_GAMEPORT_SMF bx_gameport_c *class_ptr = (bx_gameport_c *) this_ptr; class_ptr->write(address, value, io_len); } @@ -219,7 +219,7 @@ void bx_gameport_c::write(Bit32u address, Bit32u value, unsigned io_len) { #else UNUSED(this_ptr); -#endif // !BX_USE_GAME_SMF +#endif // !BX_USE_GAMEPORT_SMF BX_GAMEPORT_THIS write_usec = bx_pc_system.time_usec(); BX_GAMEPORT_THIS timer_x = 1; diff --git a/bochs/iodev/gameport.h b/bochs/iodev/gameport.h index 3a573aaaf..203e456e3 100644 --- a/bochs/iodev/gameport.h +++ b/bochs/iodev/gameport.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: gameport.h,v 1.3 2006-03-07 21:11:16 sshwarts Exp $ +// $Id: gameport.h,v 1.4 2006-04-05 18:49:35 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2003 MandrakeSoft S.A. @@ -27,7 +27,7 @@ #ifndef BX_IODEV_GAMEPORT_H #define BX_IODEV_GAMEPORT_H -#if BX_USE_GAME_SMF +#if BX_USE_GAMEPORT_SMF # define BX_GAMEPORT_SMF static # define BX_GAMEPORT_THIS theGameport-> #else @@ -57,7 +57,7 @@ private: static Bit32u read_handler(void *this_ptr, Bit32u address, unsigned io_len); static void write_handler(void *this_ptr, Bit32u address, Bit32u value, unsigned io_len); -#if !BX_USE_GAME_SMF +#if !BX_USE_GAMEPORT_SMF Bit32u read(Bit32u address, unsigned io_len); void write(Bit32u address, Bit32u value, unsigned io_len); #endif