DragonFly users List (threaded) for 2013-04
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
[
Date Index][
Thread Index]
SBCL and FP state restoration when returning from signal handler
--bcaec5171f9df36f7c04dadbf652
Content-Type: text/plain; charset=ISO-8859-1
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.
--bcaec5171f9df36f7c04dadbf652
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
There is a function in SBCL, which restores FP state when SBCL returns from=
signal handler:<br><br>> void<br>> os_restore_fp_control(os_context_=
t *context)<br>> {<br>> =A0 struct envxmm *ex =3D (struct envxmm*)(&a=
mp;context->uc_mcontext.mc_fpregs);<br>
> =A0=A0 /* reset exception flags and restore control flags on SSE2 FPU =
*/<br>>=A0=A0=A0 unsigned int temp =3D (ex->en_mxcsr) & ~0x3F;<br=
>>=A0=A0=A0 asm ("ldmxcsr %0" : : "m" (temp));<br>&g=
t;=A0 =A0 /* same for x87 FPU. */<br>
>=A0=A0=A0 asm ("fldcw %0" : : "m" (ex->en_cw));<=
br>>}<br><br>As you can see, it restores both mxcsr and x87 FPU control =
word. Do we still need it after this commit?<br><br><a href=3D"http://gitwe=
b.dragonflybsd.org/dragonfly.git/commit/e6e019a801e99ba7888ed009c5c3b3c7b04=
7af1e">http://gitweb.dragonflybsd.org/dragonfly.git/commit/e6e019a801e99ba7=
888ed009c5c3b3c7b047af1e</a><br>
<br>P.S. It is curious, what my old SBCL build stopped working after I rebu=
ild recent DragonFly. git bisect says that this commit was the cause. But a=
fter I rebuild it with clisp it began to work again. It seems that some kin=
d of binary incompatibility has place.<br>
--bcaec5171f9df36f7c04dadbf652--
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
[
Date Index][
Thread Index]