[Openmcl-cvs-notifications] r13994 - /trunk/source/lisp-kernel/x86-spentry64.s

rme at clozure.com rme at clozure.com
Tue Jul 20 12:29:42 CDT 2010


Author: rme
Date: Tue Jul 20 12:29:42 2010
New Revision: 13994

Log:
Clear tcr.ffi_exception in .SPffcall/.SPffcall_return_registers
before calling foreign code.

If foreign code generates an fp exception, we put the MXCSR into
tcr.ffi_exception.  This value hangs around until another foreign fp
exception takes place, or something from lisp calls
%get-post-ffi-exception, which clears tcr.ffi_exception as a
side-effect.

This was causing lisp functions (e.g., LOG, COS, etc.) to signal
spurious floating-point errors: even though the call out to the C
library function (e.g., log) produced no exception, the lisp code that
looks for a post-ffi fp exception would sometimes see one anyway, left
over from some ff-call.

See ticket:707.

Modified:
    trunk/source/lisp-kernel/x86-spentry64.s

Modified: trunk/source/lisp-kernel/x86-spentry64.s
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/lisp-kernel/x86-spentry64.s (original)
+++ trunk/source/lisp-kernel/x86-spentry64.s Tue Jul 20 12:29:42 2010
@@ -3989,6 +3989,7 @@
 	__(movq %rsp,rcontext(tcr.save_vsp))
         __(movq %rbp,rcontext(tcr.save_rbp))
 	__(movq $TCR_STATE_FOREIGN,rcontext(tcr.valence))
+	__(movq $0,rcontext(tcr.ffi_exception))
         __(movq rcontext(tcr.foreign_sp),%rsp)
 	__(emms)
 	__(movq (%rsp),%rbp)
@@ -4213,6 +4214,7 @@
 	__(movq %rsp,rcontext(tcr.save_vsp))
         __(movq %rbp,rcontext(tcr.save_rbp))
 	__(movq $TCR_STATE_FOREIGN,rcontext(tcr.valence))
+	__(movq $0,rcontext(tcr.ffi_exception))
         __(movq rcontext(tcr.foreign_sp),%rsp)
 	__(emms)
 	__(movq (%rsp),%rbp)



More information about the Openmcl-cvs-notifications mailing list