summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2006-10-01 10:52:11 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2006-10-01 10:52:11 +0000
commitb54f46e3e93c2b3688fb46634eda3690516a00ad (patch)
treeea1d2fa208cd4aa1067e25729045afa625fca5b4
parent2c74780ce5f1897162a4e7ec24c1dea78b33f85e (diff)
Switch fpu control word to the hardware default. This makes us use 64-bit
precision instead of 53-bit precision, giving us proper support for "long double". ok deraadt@
-rw-r--r--sys/arch/amd64/amd64/machdep.c4
-rw-r--r--sys/arch/amd64/include/fpu.h24
2 files changed, 3 insertions, 25 deletions
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c
index e972acecad9..efed8f9ec69 100644
--- a/sys/arch/amd64/amd64/machdep.c
+++ b/sys/arch/amd64/amd64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.50 2006/05/31 10:34:54 todd Exp $ */
+/* $OpenBSD: machdep.c,v 1.51 2006/10/01 10:52:10 kettenis Exp $ */
/* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */
/*-
@@ -1182,7 +1182,7 @@ setregs(struct proc *p, struct exec_package *pack, u_long stack,
p->p_md.md_flags &= ~MDP_USEDFPU;
pcb->pcb_flags = 0;
- pcb->pcb_savefpu.fp_fxsave.fx_fcw = __OpenBSD_NPXCW__;
+ pcb->pcb_savefpu.fp_fxsave.fx_fcw = __INITIAL_NPXCW__;
pcb->pcb_savefpu.fp_fxsave.fx_mxcsr = __INITIAL_MXCSR__;
pcb->pcb_savefpu.fp_fxsave.fx_mxcsr_mask = __INITIAL_MXCSR_MASK__;
diff --git a/sys/arch/amd64/include/fpu.h b/sys/arch/amd64/include/fpu.h
index 57a2b19ef13..f7da949e8e0 100644
--- a/sys/arch/amd64/include/fpu.h
+++ b/sys/arch/amd64/include/fpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: fpu.h,v 1.2 2004/02/28 22:26:05 deraadt Exp $ */
+/* $OpenBSD: fpu.h,v 1.3 2006/10/01 10:52:10 kettenis Exp $ */
/* $NetBSD: fpu.h,v 1.1 2003/04/26 18:39:40 fvdl Exp $ */
#ifndef _AMD64_FPU_H_
@@ -42,28 +42,6 @@ struct savefpu {
#define __INITIAL_MXCSR__ 0x1f80
#define __INITIAL_MXCSR_MASK__ 0xffbf
-/* OpenBSD uses IEEE double precision. */
-#define __OpenBSD_NPXCW__ 0x127f
-/* Linux just uses the default control word. */
-#define __Linux_NPXCW__ 0x037f
-
-/*
- * The standard control word from finit is 0x37F, giving:
- * round to nearest
- * 64-bit precision
- * all exceptions masked.
- *
- * Now we want:
- * affine mode (if we decide to support 287's)
- * round to nearest
- * 53-bit precision
- * all exceptions masked.
- *
- * 64-bit precision often gives bad results with high level languages
- * because it makes the results of calculations depend on whether
- * intermediate values are stored in memory or in FPU registers.
- */
-
#ifdef _KERNEL
/*
* XXX