From b314841f7aa9e9236e8d5097a34f4f28349b408b Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Mon, 15 Sep 2003 15:09:01 +0000 Subject: [PATCH] 0.8.3.68: Kludge around an apparent problem in hardware/kernel/somewhere to do with denormalized float traps... ... explicitly clear that bit in os_restore_fp_control(); ... document in BUGS; ... handle ARITHMETIC-ERROR, not just DIVISION-BY-ZERO, so that ports without fp words in sigcontext pass the test --- BUGS | 10 ++++++++++ NEWS | 4 ++++ src/runtime/alpha-linux-os.c | 12 ++++++++++-- tests/compiler.pure.lisp | 3 ++- version.lisp-expr | 2 +- 5 files changed, 27 insertions(+), 4 deletions(-) diff --git a/BUGS b/BUGS index 41587108c..b9fb00729 100644 --- a/BUGS +++ b/BUGS @@ -1245,3 +1245,13 @@ WORKAROUND: requires less registers than [x y z + +]. This transformation is currently performed with source transforms, but it would be good to also perform it in IR1 optimization phase. + +290: Alpha floating point and denormalized traps + In SBCL 0.8.3.6x on the alpha, we work around what appears to be a + hardware or kernel deficiency: the status of the enable/disable + denormalized-float traps bit seems to be ambiguous; by the time we + get to os_restore_fp_control after a trap, denormalized traps seem + to be enabled. Since we don't want a trap every time someone uses a + denormalized float, in general, we mask out that bit when we restore + the control word; however, this clobbers any change the user might + have made. diff --git a/NEWS b/NEWS index 9b4cd010a..863001a03 100644 --- a/NEWS +++ b/NEWS @@ -2049,6 +2049,10 @@ changes in sbcl-0.8.4 relative to sbcl-0.8.3: MEMBER-types to numeric. * bug fix: COMPILE-FILE must bind *READTABLE*. (reported by Doug McNaught) + * bug fix: (SETF AREF) on byte-sized-element arrays with constant index + argument now works properly on the Alpha platform. + * bug fix: floating point exception treatment on the Alpha platform + is improved. * fixed some bugs revealed by Paul Dietz' test suite: ** the RETURN clause in LOOP is now equivalent to DO (RETURN ...). ** ROUND and FROUND now give the right answer when given very diff --git a/src/runtime/alpha-linux-os.c b/src/runtime/alpha-linux-os.c index 5e25e80de..9f1e586e0 100644 --- a/src/runtime/alpha-linux-os.c +++ b/src/runtime/alpha-linux-os.c @@ -88,9 +88,17 @@ void os_restore_fp_control(os_context_t *context) { /* FIXME: 0x7E0000 is defined as something useful in constants.h, - but without the L, which would probably lead to 32/64-bit + but without the UL, 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)); + arch_set_fp_control(os_context_fp_control(context) & ~(0x7e0000UL) & + /* KLUDGE: for some reason that I don't + understand, by the time we get here the + "enable denormalized traps" bit in the fp + control word is set. Since we really don't + want to tra every time someone types + LEAST-POSITIVE-SINGLE-FLOAT into the repl, + mask that bit out. -- CSR, 2003-09-15 */ + ~(0x1UL<<6)); } 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 e54020601..c1cb8f6c1 100644 --- a/tests/compiler.pure.lisp +++ b/tests/compiler.pure.lisp @@ -587,6 +587,7 @@ ;;; 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)) +(handler-bind ((arithmetic-error #'abort)) + ;; provoke an exception (/ 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 0ec02403e..a0018175c 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.67" +"0.8.3.68" -- 2.11.4.GIT