]>
git.proxmox.com Git - mirror_edk2.git/blob - StdLib/Include/X64/machine/fpu.h
1 /* $NetBSD: fpu.h,v 1.1 2003/04/26 18:39:40 fvdl Exp $ */
7 * NetBSD/amd64 only uses the extended save/restore format used
8 * by fxsave/fsrestore, to always deal with the SSE registers,
9 * which are part of the ABI to pass floating point values.
10 * Must be stored in memory on a 16-byte boundary.
22 u_int32_t fx_mxcsr_mask
;
23 u_int64_t fx_st
[8][2]; /* 8 normal FP regs */
24 u_int64_t fx_xmm
[16][2]; /* 16 SSE2 registers */
25 u_int8_t fx_unused3
[96];
26 } __attribute__((packed
));
29 struct fxsave64 fp_fxsave
; /* see above */
30 u_int16_t fp_ex_sw
; /* saved status from last exception */
31 u_int16_t fp_ex_tw
; /* saved tag from last exception */
37 * This one only used for backward compat coredumping.
51 } __attribute__ ((packed
));
57 * The i387 defaults to Intel extended precision mode and round to nearest,
58 * with all exceptions masked.
60 #define __INITIAL_NPXCW__ 0x037f
61 #define __INITIAL_MXCSR__ 0x1f80
62 #define __INITIAL_MXCSR_MASK__ 0xffbf
64 /* NetBSD uses IEEE double precision. */
65 #define __NetBSD_NPXCW__ 0x127f
66 /* Linux just uses the default control word. */
67 #define __Linux_NPXCW__ 0x037f
70 * The standard control word from finit is 0x37F, giving:
73 * all exceptions masked.
76 * affine mode (if we decide to support 287's)
79 * all exceptions masked.
81 * 64-bit precision often gives bad results with high level languages
82 * because it makes the results of calculations depend on whether
83 * intermediate values are stored in memory or in FPU registers.
93 void fpuinit(struct cpu_info
*);
95 void fpusave(struct lwp
*);
96 void fpudiscard(struct lwp
*);
97 void fputrap(struct trapframe
*);
98 void fpusave_lwp(struct lwp
*, int);
99 void fpusave_cpu(struct cpu_info
*, int);
103 #endif /* _AMD64_FPU_H_ */