Raymond Toy pushed to branch issue-355-solaris-x86-fp-trap-handler at cmucl / cmucl
Commits: 90296b78 by Raymond Toy at 2024-08-28T14:53:40-07:00 Revert "Fix a reader-conditional and add comments."
This reverts commit 90b41bd331fc3260dee9bf0316b4c4a1fc35449d.
- - - - - 33ea1d99 by Raymond Toy at 2024-08-28T14:54:02-07:00 Revert "For Solaris/x86, just use the sse2 mode bits."
This reverts commit 72af1c16346f042bf8d04e1aa0e9b2bd52276895.
- - - - - 15d7b1df by Raymond Toy at 2024-08-28T14:57:11-07:00 Minor cleanup of sigfpe-handler
Move computation of `traps` farther down in the function since we don't need `traps` so early.
- - - - -
1 changed file:
- src/code/float-trap.lisp
Changes:
===================================== src/code/float-trap.lisp ===================================== @@ -92,7 +92,7 @@ (setf (x87-floating-point-modes) x87-modes))) )
-#+(and sse2 (not (or solaris darwin))) +#+(and sse2 (not darwin)) (progn (defun floating-point-modes () ;; Combine the modes from the FPU and SSE2 units. Since the sse @@ -126,10 +126,7 @@ new-mode) )
-;; For Darwin and Solaris/x86, only diddle the SSE2 mode bits. Darwin -;; doesn't use x87. Not sure about Solaris/x86, but this works better -;; than mixing the x87 and sse2 mode bits. -#+(and sse2 (or solaris darwin)) +#+(and sse2 darwin) (progn (defun floating-point-modes () ;; Get just the SSE2 mode bits. @@ -459,19 +456,12 @@ (defconstant +fpe-fltden+ 9 "Signal code for FP denormalize"))
-;; SIGFPE handler for Solaris/x86. For this OS, the CODE contains the -;; information about what caused the SIGFPE signal, so use that to -;; determine the reason for the SIGFPE. #+(and solaris x86) (defun sigfpe-handler (signal code scp) (declare (ignore signal) (type system-area-pointer scp)) (let* ((modes (sigcontext-floating-point-modes - (alien:sap-alien scp (* unix:sigcontext)))) - (traps (logand (ldb float-exceptions-byte modes) - (ldb float-traps-byte modes)))) - - + (alien:sap-alien scp (* unix:sigcontext))))) (multiple-value-bind (fop operands) (let ((sym (find-symbol "GET-FP-OPERANDS" "VM"))) (if (fboundp sym) @@ -511,7 +501,9 @@ (t (error _"SIGFPE code ~D not handled" code))) ;; Cleanup - (let* ((new-modes modes) + (let* ((traps (logand (ldb float-exceptions-byte modes) + (ldb float-traps-byte modes))) + (new-modes modes) (new-exceptions (logandc2 (ldb float-exceptions-byte new-modes) traps))) #+sse2 @@ -521,7 +513,7 @@ ;; will cause the exception to be signaled again. Hence, we ;; need to clear out the exceptions that we are handling here. (setf (ldb float-exceptions-byte new-modes) new-exceptions) - #+nil + ;;#+nil (progn (format *debug-io* "sigcontext modes: #x~4x (~A)~%" modes (decode-floating-point-modes modes))
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/90b41bd331fc3260dee9bf0...