fpu.h revision 4fd606d1f5abe38e1f42c38de1d2e895166bd0f4
/* $NetBSD: fpu.h,v 1.1 2003/04/26 18:39:40 fvdl Exp $ */
#ifndef _AMD64_FPU_H_
#define _AMD64_FPU_H_
/*
* which are part of the ABI to pass floating point values.
* Must be stored in memory on a 16-byte boundary.
*/
struct fxsave64 {
} __attribute__((packed));
struct savefpu {
};
#ifdef _KERNEL
/*
* This one only used for backward compat coredumping.
*/
struct oldfsave {
} __attribute__ ((packed));
#endif
/*
* The i387 defaults to Intel extended precision mode and round to nearest,
* with all exceptions masked.
*/
#define __INITIAL_NPXCW__ 0x037f
#define __INITIAL_MXCSR__ 0x1f80
#define __INITIAL_MXCSR_MASK__ 0xffbf
/* NetBSD uses IEEE double precision. */
#define __NetBSD_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
*/
struct trapframe;
struct cpu_info;
void fpudrop(void);
void fpudiscard(struct lwp *);
void fpusave_lwp(struct lwp *, int);
void fpusave_cpu(struct cpu_info *, int);
#endif
#endif /* _AMD64_FPU_H_ */