SBCL and FP state restoration when returning from signal handler

vasily postnicov shamaz.mazum at gmail.com
Sun Apr 21 02:56:22 PDT 2013


There is a function in SBCL, which restores FP state when SBCL returns from
signal handler:

> void
> os_restore_fp_control(os_context_t *context)
> {
>   struct envxmm *ex = (struct envxmm*)(&context->uc_mcontext.mc_fpregs);
>    /* reset exception flags and restore control flags on SSE2 FPU */
>    unsigned int temp = (ex->en_mxcsr) & ~0x3F;
>    asm ("ldmxcsr %0" : : "m" (temp));
>    /* same for x87 FPU. */
>    asm ("fldcw %0" : : "m" (ex->en_cw));
>}

As you can see, it restores both mxcsr and x87 FPU control word. Do we
still need it after this commit?

http://gitweb.dragonflybsd.org/dragonfly.git/commit/e6e019a801e99ba7888ed009c5c3b3c7b047af1e

P.S. It is curious, what my old SBCL build stopped working after I rebuild
recent DragonFly. git bisect says that this commit was the cause. But after
I rebuild it with clisp it began to work again. It seems that some kind of
binary incompatibility has place.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dragonflybsd.org/pipermail/users/attachments/20130421/97c0c3af/attachment.html>


More information about the Users mailing list