Skip to content
Snippets Groups Projects
Commit e63bc1e9 authored by Raymond Toy's avatar Raymond Toy
Browse files

Handle FP exceptions better.

Don't restore the fpu state from the context in the interrupt handler
code (interrupt_handle_now) because that just makes the fpu state the
same as the sigcontext that received the exception.  I think this was
done to reset the x87 fpu precision to 53-bit so that lisp can
continue with default double-float rounding.  This isn't needed
anymore since lisp doesn't use x87 anymore.

In SIGFPE-HANDLER, don't modify the current fp state based on the
state from the sigcontext.

These two items cause the arithmetic-error exception printer to
trigger inexact when printing out the args.  We add a few debugging
prints for now so we can see what the FP state is in the handler.
Remove them later.
parent 5c10ab93
No related branches found
No related tags found
No related merge requests found
......@@ -357,6 +357,14 @@
;; XXX: This seems not right. Shouldn't we be setting the modes
;; in the sigcontext instead? This however seems to do what we
;; want.
(format *debug-io* "sigcontext modes: #x~4x (~A)~%"
modes (decode-floating-point-modes modes))
(format *debug-io* "current modes: #x~4x (~A)~%"
(vm:floating-point-modes) (get-floating-point-modes))
(format *debug-io* "new modes: #x~x (~A)~%"
new-modes (decode-floating-point-modes new-modes))
#+nil
(setf (vm:floating-point-modes) new-modes))
(multiple-value-bind (fop operands)
......
......@@ -252,7 +252,9 @@ interrupt_handle_now(HANDLER_ARGS)
handler = interrupt_handlers[signal];
#if 0
RESTORE_FPU(context);
#endif
if (handler.c == (void (*)(HANDLER_ARGS)) SIG_IGN)
return;
......@@ -333,7 +335,9 @@ maybe_now_maybe_later(HANDLER_ARGS)
setup_pending_signal(signal, code, context);
arch_set_pseudo_atomic_interrupted(context);
} else {
#if 0
RESTORE_FPU(context);
#endif
interrupt_handle_now(signal, code, context);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment