From adcd870f5442b48e0572f1de51fe53edfa2ba26b Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Mon, 15 Sep 2003 13:45:16 +0000 Subject: [PATCH] 0.8.3.67: Somewhat amazingly, fixing the floating point issue described in "Alpha aargh" (CSR sbcl-devel 2003-09-12) wasn't too hard to fix. ... so fix it :-) --- src/runtime/alpha-linux-os.c | 16 ++++------------ tests/compiler.pure.lisp | 7 +++++++ version.lisp-expr | 2 +- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/runtime/alpha-linux-os.c b/src/runtime/alpha-linux-os.c index e8e8ec0..5e25e80 100644 --- a/src/runtime/alpha-linux-os.c +++ b/src/runtime/alpha-linux-os.c @@ -87,18 +87,10 @@ os_context_fp_control(os_context_t *context) void os_restore_fp_control(os_context_t *context) { - /* FIXME (in two parts): - Firstly, what happens in alpha linux inside the signal handler? - Does the floating point control state get cleared as in other - Linuxes? - - Secondly, how do we put it back if so? It will probably involve - something to do with - - context->uc_mcontext.sc_fpcr - - (maybe a simple assembly statement will be enough) - */ + /* FIXME: 0x7E0000 is defined as something useful in constants.h, + but without the L, which would probably lead to 32/64-bit + errors if we simply used it here. Ugh. CSR, 2003-09-15 */ + arch_set_fp_control(os_context_fp_control(context) & ~(0x7e0000L)); } void os_flush_icache(os_vm_address_t address, os_vm_size_t length) diff --git a/tests/compiler.pure.lisp b/tests/compiler.pure.lisp index 2b7c1a4..e540206 100644 --- a/tests/compiler.pure.lisp +++ b/tests/compiler.pure.lisp @@ -583,3 +583,10 @@ (* (logandc1 (max -29303 b) 4) b) (abs (logorc1 (+ (logandc1 -11 b) 2607688420) -31153924))) (logeqv (max a 0) b)))) + +;;; Alpha floating point modes weren't being reset after an exception, +;;; leading to an exception on the second compile, below. +(compile nil '(lambda (x y) (declare (type (double-float 0.0d0) x y)) (/ x y))) +(handler-bind ((division-by-zero #'abort)) + (/ 1.0 0.0)) +(compile nil '(lambda (x y) (declare (type (double-float 0.0d0) x y)) (/ x y))) diff --git a/version.lisp-expr b/version.lisp-expr index 333f29c..0ec0240 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".) -"0.8.3.66" +"0.8.3.67" -- 1.7.10.4