and make them behave as intended again.
The existing constraints are too weak; this used to work in older days, but
got broken when the system compiler was updated to gcc 4 (or maybe even gcc 3).
-/* $OpenBSD: fpsetmask.c,v 1.5 2014/04/18 15:09:52 guenther Exp $ */
+/* $OpenBSD: fpsetmask.c,v 1.6 2023/01/27 11:25:16 miod Exp $ */
/*
* Written by Miodrag Vallat. Public domain
__asm__ volatile("fstd %%fr0,0(%1)" : "=m"(fpsr) : "r"(&fpsr));
old = (fpsr >> 32) & 0x1f;
fpsr = (fpsr & 0xffffffe000000000LL) | ((u_int64_t)(mask & 0x1f) << 32);
- __asm__ volatile("fldd 0(%0),%%fr0" : : "r"(&fpsr));
+ __asm__ volatile("fldd 0(%0),%%fr0" : : "r"(&fpsr), "m"(fpsr));
return (old);
}
-/* $OpenBSD: fpsetround.c,v 1.4 2014/04/18 15:09:52 guenther Exp $ */
+/* $OpenBSD: fpsetround.c,v 1.5 2023/01/27 11:25:16 miod Exp $ */
/*
* Written by Miodrag Vallat. Public domain
old = (fpsr >> 41) & 0x03;
fpsr = (fpsr & 0xfffff9ff00000000LL) |
((u_int64_t)(rnd_dir & 0x03) << 41);
- __asm__ volatile("fldd 0(%0),%%fr0" : : "r" (&fpsr));
+ __asm__ volatile("fldd 0(%0),%%fr0" : : "r"(&fpsr), "m"(fpsr));
return (old);
}
-/* $OpenBSD: fpsetsticky.c,v 1.6 2014/04/18 15:09:52 guenther Exp $ */
+/* $OpenBSD: fpsetsticky.c,v 1.7 2023/01/27 11:25:16 miod Exp $ */
/*
* Written by Miodrag Vallat. Public domain
__asm__ volatile("fstd %%fr0,0(%1)" : "=m" (fpsr) : "r" (&fpsr));
old = (fpsr >> 59) & 0x1f;
fpsr = (fpsr & 0x07ffffff00000000LL) | ((u_int64_t)(mask & 0x1f) << 59);
- __asm__ volatile("fldd 0(%0),%%fr0" : : "r" (&fpsr));
+ __asm__ volatile("fldd 0(%0),%%fr0" : : "r"(&fpsr), "m"(fpsr));
return (old);
}