5 * Copyright (C) 1992,1993,1994
6 * W. Metzenthen, 22 Parker St, Ormond, Vic 3163,
7 * Australia. E-mail billm@vaxc.cc.monash.edu.au
10 * This copyright notice covers the redistribution and use of the
11 * FPU emulator developed by W. Metzenthen. It covers only its use
12 * in the 386BSD, FreeBSD and NetBSD operating systems. Any other
13 * use is not permitted under this copyright.
15 * Redistribution and use in source and binary forms, with or without
16 * modification, are permitted provided that the following conditions
18 * 1. Redistributions of source code must retain the above copyright
19 * notice, this list of conditions and the following disclaimer.
20 * 2. Redistributions in binary form must include information specifying
21 * that source code for the emulator is freely available and include
23 * a) an offer to provide the source code for a nominal distribution
25 * b) list at least two alternative methods whereby the source
26 * can be obtained, e.g. a publically accessible bulletin board
27 * and an anonymous ftp site from which the software can be
29 * 3. All advertising materials specifically mentioning features or use of
30 * this emulator must acknowledge that it was developed by W. Metzenthen.
31 * 4. The name of W. Metzenthen may not be used to endorse or promote
32 * products derived from this software without specific prior written
35 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
36 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
37 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
38 * W. METZENTHEN BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
39 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
40 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
41 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
42 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
43 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
44 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
47 * The purpose of this copyright, based upon the Berkeley copyright, is to
48 * ensure that the covered software remains freely available to everyone.
50 * The software (with necessary differences) is also available, but under
51 * the terms of the GNU copyleft, for the Linux operating system and for
52 * the djgpp ms-dos extender.
54 * W. Metzenthen June 1994.
57 * $FreeBSD: src/sys/gnu/i386/fpemul/control_w.h,v 1.7 1999/08/28 00:42:48 peter Exp $
65 #define _Const_(x) $/**/x
70 #define CW_RC _Const_(0x0C00) /* rounding control */
71 #define CW_PC _Const_(0x0300) /* precision control */
73 #define CW_Precision Const_(0x0020) /* loss of precision mask */
74 #define CW_Underflow Const_(0x0010) /* underflow mask */
75 #define CW_Overflow Const_(0x0008) /* overflow mask */
76 #define CW_ZeroDiv Const_(0x0004) /* divide by zero mask */
77 #define CW_Denormal Const_(0x0002) /* denormalized operand mask */
78 #define CW_Invalid Const_(0x0001) /* invalid operation mask */
80 #define CW_Exceptions _Const_(0x003f) /* all masks */
82 #define RC_RND _Const_(0x0000)
83 #define RC_DOWN _Const_(0x0400)
84 #define RC_UP _Const_(0x0800)
85 #define RC_CHOP _Const_(0x0C00)
87 /* p 15-5: Precision control bits affect only the following:
88 ADD, SUB(R), MUL, DIV(R), and SQRT */
89 #define PR_24_BITS _Const_(0x000)
90 #define PR_53_BITS _Const_(0x200)
91 #define PR_64_BITS _Const_(0x300)
92 /* FULL_PRECISION simulates all exceptions masked */
93 #define FULL_PRECISION (PR_64_BITS | RC_RND | 0x3f)
95 #endif /* _CONTROLW_H_ */