Changeset 13994


Ignore:
Timestamp:
Jul 20, 2010, 5:29:42 PM (9 years ago)
Author:
rme
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/x86-spentry64.s

    r13952 r13994  
    39903990        __(movq %rbp,rcontext(tcr.save_rbp))
    39913991        __(movq $TCR_STATE_FOREIGN,rcontext(tcr.valence))
     3992        __(movq $0,rcontext(tcr.ffi_exception))
    39923993        __(movq rcontext(tcr.foreign_sp),%rsp)
    39933994        __(emms)
     
    42144215        __(movq %rbp,rcontext(tcr.save_rbp))
    42154216        __(movq $TCR_STATE_FOREIGN,rcontext(tcr.valence))
     4217        __(movq $0,rcontext(tcr.ffi_exception))
    42164218        __(movq rcontext(tcr.foreign_sp),%rsp)
    42174219        __(emms)
Note: See TracChangeset for help on using the changeset viewer.