master
1/* $NetBSD: fpreg.h,v 1.3 2014/03/18 18:20:41 riastradh Exp $ */
2
3/*
4 * Copyright (c) 1995 Gordon Ross
5 * Copyright (c) 1995 Ken Nakata
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. The name of the author may not be used to endorse or promote products
17 * derived from this software without specific prior written permission.
18 * 4. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by Gordon Ross
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
23 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 */
33
34#ifndef _FPREG_H_
35#define _FPREG_H_
36
37
38/*
39 * MC68881/68882 FPcr bit definitions
40 */
41
42/* fpsr */
43#define FPSR_CCB 0xff000000
44# define FPSR_NEG 0x08000000
45# define FPSR_ZERO 0x04000000
46# define FPSR_INF 0x02000000
47# define FPSR_NAN 0x01000000
48#define FPSR_QTT 0x00ff0000
49# define FPSR_QSG 0x00800000
50# define FPSR_QUO 0x007f0000
51#define FPSR_EXCP 0x0000ff00
52#define FPSR_EXCP2 0x00003e00
53# define FPSR_BSUN 0x00008000
54# define FPSR_SNAN 0x00004000
55# define FPSR_OPERR 0x00002000
56# define FPSR_OVFL 0x00001000
57# define FPSR_UNFL 0x00000800
58# define FPSR_DZ 0x00000400
59# define FPSR_INEX2 0x00000200
60# define FPSR_INEX1 0x00000100
61#define FPSR_AEX 0x000000f8
62# define FPSR_AIOP 0x00000080
63# define FPSR_AOVFL 0x00000040
64# define FPSR_AUNFL 0x00000020
65# define FPSR_ADZ 0x00000010
66# define FPSR_AINEX 0x00000008
67
68/* fpcr */
69#define FPCR_EXCP FPSR_EXCP
70#define FPCR_EXCP2 FPSR_EXCP2
71# define FPCR_BSUN FPSR_BSUN
72# define FPCR_SNAN FPSR_SNAN
73# define FPCR_OPERR FPSR_OPERR
74# define FPCR_OVFL FPSR_OVFL
75# define FPCR_UNFL FPSR_UNFL
76# define FPCR_DZ FPSR_DZ
77# define FPCR_INEX2 FPSR_INEX2
78# define FPCR_INEX1 FPSR_INEX1
79#define FPCR_MODE 0x000000ff
80# define FPCR_PREC 0x000000c0
81# define FPCR_EXTD 0x00000000
82# define FPCR_SNGL 0x00000040
83# define FPCR_DBL 0x00000080
84# define FPCR_ROUND 0x00000030
85# define FPCR_NEAR 0x00000000
86# define FPCR_ZERO 0x00000010
87# define FPCR_MINF 0x00000020
88# define FPCR_PINF 0x00000030
89
90
91#endif