SBCL and FP state restoration when returning from signal handler

John Marino dragonflybsd at marino.st
Sun Apr 21 03:03:07 PDT 2013


On 4/21/2013 11:56, vasily postnicov wrote:
> 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.


Definitely - this avx commit broke a lot of things for x86-64.  the 
whole world and every package has to be rebuilt if you upgrade from 
before this commit.

Well known!




More information about the Users mailing list