Raymond Toy pushed to branch issue-355-solaris-x86-fp-trap-handler at cmucl / cmucl
Commits: 23c55eb3 by Raymond Toy at 2024-09-06T18:29:52-07:00 Clean up sigfpe handler by removing uneeded sigcontext stuff
We don't need x87 and sse2 modes from the sigcontext so remove that code from `sigfpe-handler`.
- - - - -
1 changed file:
- src/code/float-trap.lisp
Changes:
===================================== src/code/float-trap.lisp ===================================== @@ -486,17 +486,12 @@ (format t "***Enter Handler***~%") (let* ((modes (sigcontext-floating-point-modes (alien:sap-alien scp (* unix:sigcontext)))) - (sigcontext-x87-modes (sigcontext-floating-point-modes-x87 - (alien:sap-alien scp (* unix:sigcontext)))) - (sigcontext-sse2-modes (sigcontext-floating-point-modes-sse2 - (alien:sap-alien scp (* unix:sigcontext)))) (current-x87-modes (vm::x87-floating-point-modes)) (current-sse2-modes (vm::sse2-floating-point-modes))) + (progn (format t "Current modes: ~32,'0b~%" modes) (format t "Current HW x87 modes: ~32,'0b~%" current-x87-modes) (format t "Current HW sse2 modes: ~32,'0b~%" current-sse2-modes) - (format t "sigcontext x87: ~32,'0b~%" sigcontext-x87-modes) - (format t "sigcontext sse2: ~32,'0b~%" sigcontext-sse2-modes)
(multiple-value-bind (fop operands) (let ((sym (find-symbol "GET-FP-OPERANDS" "VM"))) @@ -520,7 +515,6 @@ ;; ;; Clear out the status for any enabled traps. If we don't ;; then when we return, the exception gets signaled again. - ;;#+nil (let* ((trap-bit (third (assoc code +fpe-code-info-alist+))) (new-x87-modes (logandc2 current-x87-modes trap-bit)) @@ -533,40 +527,13 @@ (format t "Current HW sse2 modes: ~32,'0b~%" current-sse2-modes) (format t "New x87 modes: ~32,'0b~%" new-x87-modes) (format t "New sse2 modes: ~32,'0b~%" new-sse2-modes) - (ignore-errors - (format t "Setting new sse2 modes~%") - (let ((new-context (logandc2 sigcontext-sse2-modes trap-bit))) - (format t "New sse2 sigcontext: ~32,'0b~%" new-context) - (setf (vm::sse2-floating-point-modes) new-sse2-modes) - (%set-sigcontext-floating-point-modes-sse2 - (alien:sap-alien scp (* unix:sigcontext)) - new-context))) - (ignore-errors - (format t "Setting new x87 modes~%") - (let ((new-context (logandc2 sigcontext-x87-modes trap-bit))) - (format t "New x87 sigcontext: ~32,'0b~%" new-context) - (setf (vm::x87-floating-point-modes) new-x87-modes) - (%set-sigcontext-floating-point-modes-x87 - (alien:sap-alien scp (* unix:sigcontext)) - new-context))) + (format t "Setting new sse2 modes~%") + (setf (vm::sse2-floating-point-modes) new-sse2-modes) + (format t "Setting new x87 modes~%") + (setf (vm::x87-floating-point-modes) new-x87-modes)
(format t "new x87 modes: ~32,'0b~%" (vm::x87-floating-point-modes)) - (format t "new sse2 modes: ~32,'0b~%" (vm::sse2-floating-point-modes))) - #+nil - (let* ((trap-bit (third (assoc code +fpe-code-info-alist+))) - (x87-modes (sigcontext-floating-point-modes-x87 - (alien:sap-alien scp (* unix:sigcontext)))) - (sse2-modes (sigcontext-floating-point-modes-sse2 - (alien:sap-alien scp (* unix:sigcontext))))) - (format t "Trap bit: ~D~%" trap-bit) - (format t "New sigcontext x87: ~32,'0b~%" (logandc2 x87-modes trap-bit)) - (format t "New sigcontext sse2: ~32,'0b~%" (logandc2 sse2-modes trap-bit)) - (%set-sigcontext-floating-point-modes-x87 - (alien:sap-alien scp (* unix:sigcontext)) - (logandc2 x87-modes trap-bit)) - (%set-sigcontext-floating-point-modes-sse2 - (alien:sap-alien scp (* unix:sigcontext)) - (logandc2 sse2-modes trap-bit))))))) + (format t "new sse2 modes: ~32,'0b~%" (vm::sse2-floating-point-modes))))))))
#-(and solaris x86) (macrolet
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/23c55eb3acbf947bf45babbe...