Raymond Toy pushed to branch issue-355-solaris-x86-fp-trap-handler at cmucl / cmucl

Commits:

1 changed file:

Changes:

  • src/code/float-trap.lisp
    ... ... @@ -92,7 +92,7 @@
    92 92
         (setf (x87-floating-point-modes) x87-modes)))
    
    93 93
       )
    
    94 94
     
    
    95
    -#+(and sse2 (not (or solaris darwin)))
    
    95
    +#+(and sse2 (not darwin))
    
    96 96
     (progn
    
    97 97
       (defun floating-point-modes ()
    
    98 98
         ;; Combine the modes from the FPU and SSE2 units.  Since the sse
    
    ... ... @@ -126,10 +126,7 @@
    126 126
         new-mode)
    
    127 127
       )
    
    128 128
     
    
    129
    -;; For Darwin and Solaris/x86, only diddle the SSE2 mode bits.  Darwin
    
    130
    -;; doesn't use x87.  Not sure about Solaris/x86, but this works better
    
    131
    -;; than mixing the x87 and sse2 mode bits.
    
    132
    -#+(and sse2 (or solaris darwin))
    
    129
    +#+(and sse2 darwin)
    
    133 130
     (progn
    
    134 131
       (defun floating-point-modes ()
    
    135 132
         ;; Get just the SSE2 mode bits.
    
    ... ... @@ -459,19 +456,12 @@
    459 456
       (defconstant +fpe-fltden+ 9
    
    460 457
         "Signal code for FP denormalize"))
    
    461 458
     
    
    462
    -;; SIGFPE handler for Solaris/x86.  For this OS, the CODE contains the
    
    463
    -;; information about what caused the SIGFPE signal, so use that to
    
    464
    -;; determine the reason for the SIGFPE.
    
    465 459
     #+(and solaris x86)
    
    466 460
     (defun sigfpe-handler (signal code scp)
    
    467 461
       (declare (ignore signal)
    
    468 462
     	   (type system-area-pointer scp))
    
    469 463
       (let* ((modes (sigcontext-floating-point-modes
    
    470
    -		 (alien:sap-alien scp (* unix:sigcontext))))
    
    471
    -	 (traps (logand (ldb float-exceptions-byte modes)
    
    472
    -			(ldb float-traps-byte modes))))
    
    473
    -
    
    474
    -    
    
    464
    +		 (alien:sap-alien scp (* unix:sigcontext)))))
    
    475 465
         (multiple-value-bind (fop operands)
    
    476 466
     	(let ((sym (find-symbol "GET-FP-OPERANDS" "VM")))
    
    477 467
     	  (if (fboundp sym)
    
    ... ... @@ -511,7 +501,9 @@
    511 501
     	     (t
    
    512 502
     	      (error _"SIGFPE code ~D not handled" code)))
    
    513 503
     	;; Cleanup
    
    514
    -	(let* ((new-modes modes)
    
    504
    +	(let* ((traps (logand (ldb float-exceptions-byte modes)
    
    505
    +			(ldb float-traps-byte modes)))
    
    506
    +	       (new-modes modes)
    
    515 507
     	       (new-exceptions (logandc2 (ldb float-exceptions-byte new-modes)
    
    516 508
     					 traps)))
    
    517 509
     	  #+sse2
    
    ... ... @@ -521,7 +513,7 @@
    521 513
     	    ;; will cause the exception to be signaled again.  Hence, we
    
    522 514
     	    ;; need to clear out the exceptions that we are handling here.
    
    523 515
     	    (setf (ldb float-exceptions-byte new-modes) new-exceptions)
    
    524
    -	    #+nil
    
    516
    +	    ;;#+nil
    
    525 517
     	    (progn
    
    526 518
     	      (format *debug-io* "sigcontext modes: #x~4x (~A)~%"
    
    527 519
     		      modes (decode-floating-point-modes modes))