fp.h revision ae115bc77f6fcde83175c75b4206dc2e50747966
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1990, 1991 UNIX System Laboratories, Inc. */
/* Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T */
/* All Rights Reserved */
#ifndef _SYS_FP_H
#define _SYS_FP_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
*/
/*
* values that go into fp_kind
*/
#define FP_NO 0 /* no fp chip, no emulator (no fp support) */
/*
* masks for 80387 control word
*/
/*
* (Old symbol compatibility)
*/
/*
* precision, rounding, and infinity options in control word
*/
/*
* masks for 80387 status word
*/
/*
* Exception flags manually cleared during x87 exception handling.
*/
#define FPS_SW_EFLAGS \
/*
* Initial value of FPU control word as per 4th ed. ABI document
* - affine infinity
* - round to nearest or even
* - 64-bit double precision
* - all exceptions masked
*/
#define FPU_CW_INIT 0x133f
/*
*/
#define SSE_MXCSR_EFLAGS \
#define SSE_MXCSR_INIT \
#define SSE_MXCSR_MASK_DEFAULT \
#define SSE_FMT_MXCSR \
"\20\20fz\17ru\16rd\15pm\14um\13om\12zm\11dm" \
"\10im\7daz\6pe\5ue\4oe\3ze\2de\1ie"
extern int fp_kind; /* kind of fp support */
extern int fpu_exists; /* FPU hw exists */
#ifdef _KERNEL
extern int fpu_ignored;
extern int fpu_pentium_fdivbug;
extern uint32_t sse_mxcsr_mask;
extern void fpu_probe(void);
extern uint_t fpu_initial_probe(void);
extern int fpu_probe_pentium_fdivbug(void);
extern void fpnsave_ctxt(void *);
extern void fpxsave_ctxt(void *);
extern void (*fpsave_ctxt)(void *);
struct fnsave_state;
struct fxsave_state;
extern void fxsave_insn(struct fxsave_state *);
extern void fpsave(struct fnsave_state *);
extern void fprestore(struct fnsave_state *);
extern void fpxsave(struct fxsave_state *);
extern void fpxrestore(struct fxsave_state *);
extern void fpenable(void);
extern void fpdisable(void);
extern void fpinit(void);
extern uint32_t fperr_reset(void);
extern uint32_t fpxerr_reset(void);
extern uint32_t fpgetmxcsr(void);
struct regs;
extern int fpnoextflt(struct regs *);
extern int fpextovrflt(struct regs *);
extern int fpexterrflt(struct regs *);
extern int fpsimderrflt(struct regs *);
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_FP_H */