Skip to content

Commit

Permalink
0.8.3.68:
Browse files Browse the repository at this point in the history
	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
  • Loading branch information
csrhodes committed Sep 15, 2003
1 parent adcd870 commit b314841
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 4 deletions.
10 changes: 10 additions & 0 deletions BUGS
Expand Up @@ -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.
4 changes: 4 additions & 0 deletions NEWS
Expand Up @@ -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
Expand Down
12 changes: 10 additions & 2 deletions src/runtime/alpha-linux-os.c
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion tests/compiler.pure.lisp
Expand Up @@ -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)))
2 changes: 1 addition & 1 deletion version.lisp-expr
Expand Up @@ -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"

0 comments on commit b314841

Please sign in to comment.