0.7.4.40:
authorChristophe Rhodes <csr21@cam.ac.uk>
Thu, 20 Jun 2002 11:23:48 +0000 (11:23 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Thu, 20 Jun 2002 11:23:48 +0000 (11:23 +0000)
SPARC floating point fixes
... write a C function to get at the floating point state register
and use it for context-floating-point-modes (SunOS)
... attempt to do the same for SPARC/Linux, then realise that
the current state was more broken than I thought, so
wrote a BUG instead
Portability fix to binary-distribution.sh

BUGS
binary-distribution.sh
src/code/sparc-vm.lisp
src/runtime/sparc-arch.c
src/runtime/sparc-sunos-os.c
version.lisp-expr

diff --git a/BUGS b/BUGS
index 2ba3b13..bba6c83 100644 (file)
--- a/BUGS
+++ b/BUGS
@@ -973,6 +973,36 @@ WORKAROUND:
         (call-next-method)))
   Now (FOO 3) should return 3, but instead it returns 4.
 
+140:
+  (reported by Alexey Dejneka sbcl-devel 2002-01-03)
+
+  SUBTYPEP does not work well with redefined classes:
+  ---
+  * (defclass a () ())
+  #<STANDARD-CLASS A>
+  * (defclass b () ())
+  #<STANDARD-CLASS B>
+  * (subtypep 'b 'a)
+  NIL
+  T
+  * (defclass b (a) ())
+  #<STANDARD-CLASS B>
+  * (subtypep 'b 'a)
+  T
+  T
+  * (defclass b () ())
+  #<STANDARD-CLASS B>
+   
+  ;;; And now...
+  * (subtypep 'b 'a)
+  T
+  T
+
+  This bug was fixed in sbcl-0.7.4.1 by invalidating the PCL wrapper
+  class upon redefinition. Unfortunately, doing so causes bug #176 to
+  appear.  Pending further investication, one or other of these bugs
+  might be present at any given time.
+
 141: 
   Pretty-printing nested backquotes doesn't work right, as 
   reported by Alexey Dejneka sbcl-devel 2002-01-13:
@@ -1276,6 +1306,8 @@ WORKAROUND:
     (defclass c0 (b) ())
     (make-instance 'c19)
 
+  See also bug #140.
+
 178: "AVER failure compiling confused THEs in FUNCALL"
   In sbcl-0.7.4.24, compiling
     (defun bug178 (x)
@@ -1299,7 +1331,37 @@ WORKAROUND:
   the compiler handle the error, convert it into a COMPILER-ERROR, and
   continue compiling) which seems wrong.
 
-  
+182: "SPARC/Linux floating point"
+  Evaluating (/ 1.0 0.0) at the prompt causes a Bus error and complete
+  death of the environment. Other floating point operations sometimes
+  return infinities when they should raise traps (e.g. the test case
+  for bug #146, (expt 2.0 12777)).
+
+183: "IEEE floating point issues"
+  Even where floating point handling is being dealt with relatively
+  well (as of sbcl-0.7.5, on sparc/sunos and alpha; see bug #146), the
+  accrued-exceptions and current-exceptions part of the fp control
+  word don't seem to bear much relation to reality. E.g. on
+  SPARC/SunOS:
+  * (/ 1.0 0.0)
+
+  debugger invoked on condition of type DIVISION-BY-ZERO:
+    arithmetic error DIVISION-BY-ZERO signalled
+  0] (sb-vm::get-floating-point-modes)
+
+  (:TRAPS (:OVERFLOW :INVALID :DIVIDE-BY-ZERO)
+          :ROUNDING-MODE :NEAREST
+          :CURRENT-EXCEPTIONS NIL
+          :ACCRUED-EXCEPTIONS (:INEXACT)
+          :FAST-MODE NIL)
+  0] abort
+  * (sb-vm::get-floating-point-modes)
+  (:TRAPS (:OVERFLOW :INVALID :DIVIDE-BY-ZERO)
+          :ROUNDING-MODE :NEAREST
+          :CURRENT-EXCEPTIONS (:INEXACT)
+          :ACCRUED-EXCEPTIONS (:INEXACT)
+          :FAST-MODE NIL)
+
 DEFUNCT CATEGORIES OF BUGS
   IR1-#:
     These labels were used for bugs related to the old IR1 interpreter.
index 1a6a127..144830d 100755 (executable)
@@ -10,7 +10,7 @@
 # switched over to trying to do this the way everyone else does.)
 
 b=${1:?missing base directory name argument}
-tar cf $b-binary.tar \
+tar -cf $b-binary.tar \
     $b/output/sbcl.core $b/src/runtime/sbcl \
     $b/BUGS $b/COPYING $b/CREDITS $b/INSTALL $b/NEWS $b/README \
     $b/install.sh \
index 05502de..5507d9f 100644 (file)
 
 ;;; Given a signal context, return the floating point modes word in
 ;;; the same format as returned by FLOATING-POINT-MODES.
+
+;;; Under SunOS, we have a straightforward implementation in C:
+#!+sunos
+(define-alien-routine ("os_context_fp_control" context-floating-point-modes)
+    (sb!alien:unsigned 32)
+  (context (* os-context-t)))
+
+;;; Under Linux, we have to contend with utterly broken signal handling.
+#!+linux
 (defun context-floating-point-modes (context)
-  ;; FIXME: As of sbcl-0.6.7 and the big rewrite of signal handling for
-  ;; POSIXness and (at the Lisp level) opaque signal contexts,
-  ;; this is stubified. It needs to be rewritten as an
-  ;; alien function.
   (warn "stub CONTEXT-FLOATING-POINT-MODES")
-  ;; old code for Linux:
-  #+nil
-  (let ((cw (slot (deref (slot context 'fpstate) 0) 'cw))
-       (sw (slot (deref (slot context 'fpstate) 0) 'sw)))
-    ;;(format t "cw = ~4X~%sw = ~4X~%" cw sw)
-    ;; NOT TESTED -- Clear sticky bits to clear interrupt condition.
-    (setf (slot (deref (slot context 'fpstate) 0) 'sw) (logandc2 sw #x3f))
-    ;;(format t "new sw = ~X~%" (slot (deref (slot context 'fpstate) 0) 'sw))
-    ;; Simulate floating-point-modes VOP.
-    (logior (ash (logand sw #xffff) 16) (logxor (logand cw #xffff) #x3f)))
-
   0)
 \f
 ;;;; INTERNAL-ERROR-ARGS.
index 050b746..c2bfd22 100644 (file)
@@ -23,7 +23,7 @@
 #include "breakpoint.h"
 #include "monitor.h"
 
-#ifdef linux
+#ifdef LISP_FEATURE_LINUX
 extern int early_kernel;
 #endif
 
@@ -188,7 +188,7 @@ static void sigill_handler(int signal, siginfo_t *siginfo, void *void_context)
   sigprocmask(SIG_SETMASK, os_context_sigmask_addr(context), 0);
 
   if ((siginfo->si_code) == ILL_ILLOPC
-#ifdef linux
+#ifdef LISP_FEATURE_LINUX
       || (early_kernel && (siginfo->si_code == 2))
 #endif
       ) {
@@ -237,7 +237,7 @@ static void sigill_handler(int signal, siginfo_t *siginfo, void *void_context)
     }
   }
   else if ((siginfo->si_code) == ILL_ILLTRP
-#ifdef linux
+#ifdef LISP_FEATURE_LINUX
           || (early_kernel && (siginfo->si_code) == 192)
 #endif
           ) {
index 6b8364d..634e5e1 100644 (file)
@@ -77,6 +77,12 @@ os_context_sigmask_addr(os_context_t *context)
     return &(context->uc_sigmask);
 }
 
+unsigned long
+os_context_fp_control(os_context_t *context)
+{
+    return (context->uc_mcontext.fpregs.fpu_fsr);
+}
+
 void os_flush_icache(os_vm_address_t address, os_vm_size_t length)
 {
     /* see sparc-assem.S */
index efc84f1..902090d 100644 (file)
@@ -18,4 +18,4 @@
 ;;; for internal versions, especially for internal versions off the
 ;;; main CVS branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
 
-"0.7.4.39"
+"0.7.4.40"