Skip to content
Snippets Groups Projects
Commit 346910c6 authored by rtoy's avatar rtoy
Browse files

Clear the FPU status word before loading the control word from the

sigcontext.

This is a workaround for an issue on x86/darwin where loading of the
control word enabling the invalid operation exception would cause that
exception because the status word had that exception.  Not sure why
this is needed or why the invalid operation exception was set.  It was
happening in a call run-program while concatenating the files for the
hemlock library.
parent 517dc508
No related branches found
No related tags found
No related merge requests found
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* Frobbed for OpenBSD by Pierre R. Mai, 2001. * Frobbed for OpenBSD by Pierre R. Mai, 2001.
* Frobbed for Darwin by Pierre R. Mai, 2003. * Frobbed for Darwin by Pierre R. Mai, 2003.
* *
* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/Darwin-os.c,v 1.14 2008/01/03 11:41:53 cshapiro Exp $ * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/Darwin-os.c,v 1.15 2008/01/17 14:13:15 rtoy Exp $
* *
*/ */
...@@ -269,6 +269,7 @@ restore_fpu(ucontext_t *scp) ...@@ -269,6 +269,7 @@ restore_fpu(ucontext_t *scp)
{ {
unsigned short cw; unsigned short cw;
memcpy(&cw, &scp->uc_mcontext->__fs.__fpu_fcw, sizeof(cw)); memcpy(&cw, &scp->uc_mcontext->__fs.__fpu_fcw, sizeof(cw));
__asm__ __volatile__ ("fclex");
__asm__ __volatile__ ("fldcw %0" : : "m" (*&cw)); __asm__ __volatile__ ("fldcw %0" : : "m" (*&cw));
} }
#endif #endif
......
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