From 6059507910804b97709f16dee2bfc6b658a8cab9 Mon Sep 17 00:00:00 2001 From: gbeauche <> Date: Tue, 20 Mar 2001 18:05:36 +0000 Subject: [PATCH] Moved FPU emulation code sources to uae_cpu/fpu/ --- BasiliskII/src/Unix/configure.in | 51 +++++++++++++++++++ .../src/uae_cpu/{fpp.cpp => fpu/fpu_uae.cpp} | 0 BasiliskII/src/uae_cpu/{ => fpu}/fpu_x86.cpp | 4 +- BasiliskII/src/uae_cpu/{ => fpu}/fpu_x86.h | 0 .../src/uae_cpu/{ => fpu}/fpu_x86_asm.h | 0 5 files changed, 53 insertions(+), 2 deletions(-) rename BasiliskII/src/uae_cpu/{fpp.cpp => fpu/fpu_uae.cpp} (100%) rename BasiliskII/src/uae_cpu/{ => fpu}/fpu_x86.cpp (99%) rename BasiliskII/src/uae_cpu/{ => fpu}/fpu_x86.h (100%) rename BasiliskII/src/uae_cpu/{ => fpu}/fpu_x86_asm.h (100%) diff --git a/BasiliskII/src/Unix/configure.in b/BasiliskII/src/Unix/configure.in index 184d4740..6d1bb18f 100644 --- a/BasiliskII/src/Unix/configure.in +++ b/BasiliskII/src/Unix/configure.in @@ -11,6 +11,18 @@ AC_ARG_ENABLE(xf86-vidmode, [ --enable-xf86-vidmode use the XFree86 VidMode AC_ARG_ENABLE(fbdev-dga, [ --enable-fbdev-dga use direct frame buffer access via /dev/fb [default=yes]], [WANT_FBDEV_DGA=$enableval], [WANT_FBDEV_DGA=yes]) AC_ARG_ENABLE(vosf, [ --enable-vosf enable video on SEGV signals [default=no]], [WANT_VOSF=$enableval], [WANT_VOSF=no]) +dnl FPU emulation core. +AC_ARG_ENABLE(fpe, +[ --enable-fpe=which specify which fpu emulator to use [default=opt]], +[ case "$enableval" in + default) FPE_CORE="default";; dnl fpu_x86.cpp if i386 architecture, fpu_uae.cpp otherwise + uae) FPE_CORE="uae";; + *) AC_MSG_ERROR([--enable-fpe takes only one of the following values: default, uae]);; + esac +], +[ FPE_CORE="default" +]) + dnl Addressing modes. AC_ARG_ENABLE(addressing, [ --enable-addressing=AM specify the addressing mode to use [default=fastest]], @@ -601,6 +613,44 @@ elif [[ "x$WANT_NATIVE_M68K" = "xyes" ]]; then CPUSRCS="asm_support.s" fi +dnl Select appropriate FPU source. +dnl 1. Optimized X86 assembly core if target is i386 architecture +SAVED_DEFINES=$DEFINES +if [[ "x$FPE_CORE" = "xdefault" ]]; then + if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" -a "x$HAVE_GAS" = "xyes" ]]; then + DEFINES="$DEFINES -DFPU_X86" + FPE_CORE_STR="i386 optimized core" + FPUSRCS="../uae_cpu/fpu/fpu_x86.cpp" + fi +fi + +dnl 2. JIT-FPU only supports IEEE-based implementation. +if [[ "x$WANT_JIT_FPU" = "xyes" -a "x$FPE_CORE" != "xieee" ]]; then + AC_MSG_WARN([Sorry, JIT-FPU supports only the "ieee" FPE implementation]) + FPE_CORE="ieee" + dnl Restore previous variables. FPE_CORE_STR and FPUSRCS are overwritten + DEFINES=$SAVED_DEFINES +fi + +dnl 3. Choose either IEEE-based implementation or the old UAE core +if [[ "x$FPE_CORE" = "xieee" ]]; then + AC_CHECK_HEADERS(fenv.h) + AC_CHECK_FUNCS(feclearexcept fegetexceptflag feraiseexcept fesetexceptflag fetestexcept) + AC_CHECK_FUNCS(fegetround fesetround) + DEFINES="$DEFINES -DFPU_IEEE" + FPE_CORE_STR="ieee-based fpu core" + FPUSRCS="../uae_cpu/fpu/fpu_ieee.cpp" +elif [[ "x$FPE_CORE" = "xuae" ]]; then + DEFINES="$DEFINES -DFPU_UAE" + FPE_CORE_STR="original uae core" + FPUSRCS="../uae_cpu/fpu/fpu_uae.cpp" +fi + +dnl Check for certain math functions +AC_CHECK_FUNCS(atanh) +AC_CHECK_FUNCS(isnan isinf) dnl C99 +AC_CHECK_FUNCS(isnanl isinfl) dnl IEEE ? + dnl UAE CPU sources for all non-m68k-native architectures. if [[ "x$WANT_NATIVE_M68K" = "xno" ]]; then CPUINCLUDES="-I../uae_cpu" @@ -633,6 +683,7 @@ echo ESD sound support ................ : $WANT_ESD echo GTK user interface ............... : $WANT_GTK echo mon debugger support ............. : $WANT_MON echo Running m68k code natively ....... : $WANT_NATIVE_M68K +echo Floating-Point emulation core .... : $FPE_CORE_STR echo Assembly optimizations ........... : $ASM_OPTIMIZATIONS echo Addressing mode .................. : $ADDRESSING_MODE echo diff --git a/BasiliskII/src/uae_cpu/fpp.cpp b/BasiliskII/src/uae_cpu/fpu/fpu_uae.cpp similarity index 100% rename from BasiliskII/src/uae_cpu/fpp.cpp rename to BasiliskII/src/uae_cpu/fpu/fpu_uae.cpp diff --git a/BasiliskII/src/uae_cpu/fpu_x86.cpp b/BasiliskII/src/uae_cpu/fpu/fpu_x86.cpp similarity index 99% rename from BasiliskII/src/uae_cpu/fpu_x86.cpp rename to BasiliskII/src/uae_cpu/fpu/fpu_x86.cpp index d530dbb5..01b79a5b 100644 --- a/BasiliskII/src/uae_cpu/fpu_x86.cpp +++ b/BasiliskII/src/uae_cpu/fpu/fpu_x86.cpp @@ -135,8 +135,8 @@ #include "memory.h" #include "readcpu.h" #include "newcpu.h" -#include "fpu_x86.h" -#include "fpu_x86_asm.h" +#include "fpu/fpu_x86.h" +#include "fpu/fpu_x86_asm.h" /* ---------------------------- Compatibility ---------------------------- */ diff --git a/BasiliskII/src/uae_cpu/fpu_x86.h b/BasiliskII/src/uae_cpu/fpu/fpu_x86.h similarity index 100% rename from BasiliskII/src/uae_cpu/fpu_x86.h rename to BasiliskII/src/uae_cpu/fpu/fpu_x86.h diff --git a/BasiliskII/src/uae_cpu/fpu_x86_asm.h b/BasiliskII/src/uae_cpu/fpu/fpu_x86_asm.h similarity index 100% rename from BasiliskII/src/uae_cpu/fpu_x86_asm.h rename to BasiliskII/src/uae_cpu/fpu/fpu_x86_asm.h