Changeset 13940 for branches


Ignore:
Timestamp:
Jul 8, 2010, 3:16:23 AM (9 years ago)
Author:
rme
Message:

Only avoid saving/restoring the MXCSR around FF calls on x8664,
at least for now.

Location:
branches/rme-fpe/lisp-kernel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/rme-fpe/lisp-kernel/x86-exceptions.c

    r13937 r13940  
    955955
    956956  if (old_valence == TCR_STATE_FOREIGN) {
     957#ifdef X8632
     958    return false;
     959#else
    957960    /* We got a floating point exception in foreign code.  Set a flag
    958961       in the TCR to indicate this, and resume with FP exceptions
     
    971974    xpMXCSR(xp) |= MXCSR_CONTROL_MASK;
    972975    return true;
    973   } else if ((fulltag_of(cmain) == fulltag_misc) &&
     976#endif
     977  }
     978
     979  if ((fulltag_of(cmain) == fulltag_misc) &&
    974980             (header_subtag(header_of(cmain)) == subtag_macptr)) {
    975981    xcf = create_exception_callback_frame(xp, tcr);
  • branches/rme-fpe/lisp-kernel/x86-spentry32.s

    r13938 r13940  
    41844184        __(popl rcontext(tcr.save_eflags))
    41854185        __(cld)       
     4186        __(stmxcsr rcontext(tcr.lisp_mxcsr))
    41864187        __(emms)
     4188        __(ldmxcsr rcontext(tcr.foreign_mxcsr))
    41874189        __(movl (%esp),%ebp)
    41884190LocalLabelPrefix`'ffcall_setup:
     
    42134215        __(clr %fn)
    42144216        __(pxor %fpzero,%fpzero)
    4215         /* If we got a floating-point exception during the ff-call,
    4216            our handler will have set a flag, preserved lisp's MXCSR,
    4217            and resumed execution with fp exceptions masked. */
    4218         __(btrl $TCR_FLAG_BIT_FOREIGN_FPE,rcontext(tcr.flags))
    4219         __(jnc 1f)
    42204217        __(cmpb $0,C(bogus_fp_exceptions))
    42214218        __(je 0f)
     
    42254222        __ifdef(`SSE2_MATH_LIB')
    42264223        __(stmxcsr rcontext(tcr.ffi_exception))
    4227         __(ldmxcsr rcontext(tcr.lisp_mxcsr)) /* preserved by the handler */
    42284224        __else
    42294225        __(fnstsw rcontext(tcr.ffi_exception))
     
    42394235        __(pop %arg_y)           
    42404236        __(pop %temp1)
     4237        __(ldmxcsr rcontext(tcr.lisp_mxcsr))
    42414238        __(check_pending_interrupt(%temp0))
    42424239        __(pop %temp0)
Note: See TracChangeset for help on using the changeset viewer.