From: Alastair Bridgewater Date: Sun, 23 May 2010 22:49:58 +0000 (+0000) Subject: 1.0.38.11: Enable floating-point exception delivery on PPC/Linux. X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=52c61a5ea469c7766ff493f889625394c4038b9a;p=sbcl.git 1.0.38.11: Enable floating-point exception delivery on PPC/Linux. * For some reason, Linux disables floating-point exception delivery by default. Use the PR_SET_FPEXC prctl (new in 2.4.21 and 2.5.32) to enable it in "precise" mode (possibly overkill). * This is necessary but not sufficient to fix one of the failing tests in float.pure.lisp. * Given that this is only necessary for one test case, the test suite has woefully incomplete coverage of floating-point exceptions. --- diff --git a/src/runtime/ppc-linux-os.c b/src/runtime/ppc-linux-os.c index 07124f1..fe22e41 100644 --- a/src/runtime/ppc-linux-os.c +++ b/src/runtime/ppc-linux-os.c @@ -34,6 +34,7 @@ #include #include #include +#include #include "validate.h" #include "ppc-linux-mcontext.h" @@ -41,6 +42,22 @@ size_t os_vm_page_size; int arch_os_thread_init(struct thread *thread) { + /* For some reason, PPC Linux appears to default to not generating + * floating point exceptions. PR_SET_FPEXC is a PPC-specific + * option new in kernel 2.4.21 and 2.5.32 that allows us to + * configure this. Should we need to run on an older kenel, the + * equivalent trick is to get into a signal-handling context and + * modify the saved machine state register. + * + * PR_FP_EXC_PRECISE may be more accurate than we need, + * particularly if we move to the x86oid trick of inserting + * explicit synchronization for floating-point exception + * delivery. If we wish to move to such a model, the other two + * exception delivery modes that we could use are PR_FP_EXC_ASYNC + * and PR_FP_EXC_NONRECOV, and exception delivery can be forced + * by any access to the FPSCR. -- AB, 2010-May-23 */ + prctl(PR_SET_FPEXC, PR_FP_EXC_PRECISE, 0, 0); + return 1; /* success */ } int arch_os_thread_cleanup(struct thread *thread) { diff --git a/version.lisp-expr b/version.lisp-expr index 1b7b1eb..9d3ff57 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"1.0.38.10" +"1.0.38.11"