logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

CVS: sbcl/src/code sparc-vm.lisp,1.2,1.3: msg#00092

Subject: CVS: sbcl/src/code sparc-vm.lisp,1.2,1.3
Update of /cvsroot/sbcl/sbcl/src/code
In directory usw-pr-cvs1:/tmp/cvs-serv3102/src/code

Modified Files:
        sparc-vm.lisp 
Log Message:
0.7.4.40:
        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


Index: sparc-vm.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/code/sparc-vm.lisp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- sparc-vm.lisp       5 May 2002 15:09:34 -0000       1.2
+++ sparc-vm.lisp       20 Jun 2002 11:23:48 -0000      1.3
@@ -95,23 +95,17 @@
 
 ;;; 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)
 
 ;;;; INTERNAL-ERROR-ARGS.



-------------------------------------------------------
                   Bringing you mounds of caffeinated joy
                   >>>     http://thinkgeek.com/sf    <<<


<Prev in Thread] Current Thread [Next in Thread>