SBCL and FP state restoration when returning from signal handler

vasily postnicov shamaz.mazum at
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?

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: <>

More information about the Users mailing list