1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-21 11:13:30 +00:00

Use a different value for the initial control word for the FPU state for

32-bit processes.  The value matches the initial setting used by
FreeBSD/i386.  Otherwise, 32-bit binaries using floating point would use
a slightly different initial state when run on FreeBSD/amd64.

MFC after:	1 week
This commit is contained in:
John Baldwin 2009-01-28 20:35:16 +00:00
parent 3045a45f42
commit de43ac6044
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=187867
2 changed files with 6 additions and 0 deletions

View File

@ -391,6 +391,7 @@ fpudna()
{
struct pcb *pcb;
register_t s;
u_short control;
if (PCPU_GET(fpcurthread) == curthread) {
printf("fpudna: fpcurthread == curthread %d times\n",
@ -421,6 +422,10 @@ fpudna()
* explicitly load sanitized registers.
*/
fxrstor(&fpu_cleanstate);
if (pcb->pcb_flags & PCB_32BIT) {
control = __INITIAL_FPUCW_I386__;
fldcw(&control);
}
pcb->pcb_flags |= PCB_FPUINITDONE;
} else
fxrstor(&pcb->pcb_save);

View File

@ -92,6 +92,7 @@ struct savefpu {
* SSE2 based math. For FreeBSD/amd64, we go with the default settings.
*/
#define __INITIAL_FPUCW__ 0x037F
#define __INITIAL_FPUCW_I386__ 0x127F
#define __INITIAL_MXCSR__ 0x1F80
#define __INITIAL_MXCSR_MASK__ 0xFFBF