GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / cfe / cfe / x86emu / x86emu / fpu_regs.h
blob56e9a04d75c18f2df72d1dd2e03f365faeb20b60
1 /****************************************************************************
3 * Realmode X86 Emulator Library
5 * Copyright (C) 1996-1999 SciTech Software, Inc.
6 * Copyright (C) David Mosberger-Tang
7 * Copyright (C) 1999 Egbert Eich
9 * ========================================================================
11 * Permission to use, copy, modify, distribute, and sell this software and
12 * its documentation for any purpose is hereby granted without fee,
13 * provided that the above copyright notice appear in all copies and that
14 * both that copyright notice and this permission notice appear in
15 * supporting documentation, and that the name of the authors not be used
16 * in advertising or publicity pertaining to distribution of the software
17 * without specific, written prior permission. The authors makes no
18 * representations about the suitability of this software for any purpose.
19 * It is provided "as is" without express or implied warranty.
21 * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
22 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
23 * EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
24 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
25 * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
26 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
27 * PERFORMANCE OF THIS SOFTWARE.
29 * ========================================================================
31 * Language: ANSI C
32 * Environment: Any
33 * Developer: Kendall Bennett
35 * Description: Header file for FPU register definitions.
37 ****************************************************************************/
39 #ifndef __X86EMU_FPU_REGS_H
40 #define __X86EMU_FPU_REGS_H
42 #ifdef X86_FPU_SUPPORT
44 #pragma pack(1)
46 /* Basic 8087 register can hold any of the following values: */
48 union x86_fpu_reg_u {
49 s8 tenbytes[10];
50 double dval;
51 float fval;
52 s16 sval;
53 s32 lval;
56 struct x86_fpu_reg {
57 union x86_fpu_reg_u reg;
58 char tag;
62 * Since we are not going to worry about the problems of aliasing
63 * registers, every time a register is modified, its result type is
64 * set in the tag fields for that register. If some operation
65 * attempts to access the type in a way inconsistent with its current
66 * storage format, then we flag the operation. If common, we'll
67 * attempt the conversion.
70 #define X86_FPU_VALID 0x80
71 #define X86_FPU_REGTYP(r) ((r) & 0x7F)
73 #define X86_FPU_WORD 0x0
74 #define X86_FPU_SHORT 0x1
75 #define X86_FPU_LONG 0x2
76 #define X86_FPU_FLOAT 0x3
77 #define X86_FPU_DOUBLE 0x4
78 #define X86_FPU_LDBL 0x5
79 #define X86_FPU_BSD 0x6
81 #define X86_FPU_STKTOP 0
83 struct x86_fpu_registers {
84 struct x86_fpu_reg x86_fpu_stack[8];
85 int x86_fpu_flags;
86 int x86_fpu_config; /* rounding modes, etc. */
87 short x86_fpu_tos, x86_fpu_bos;
90 #pragma pack()
93 * There are two versions of the following macro.
95 * One version is for opcode D9, for which there are more than 32
96 * instructions encoded in the second byte of the opcode.
98 * The other version, deals with all the other 7 i87 opcodes, for
99 * which there are only 32 strings needed to describe the
100 * instructions.
103 #endif /* X86_FPU_SUPPORT */
105 #ifdef DEBUG
106 # define DECODE_PRINTINSTR32(t,mod,rh,rl) \
107 DECODE_PRINTF(t[(mod<<3)+(rh)]);
108 # define DECODE_PRINTINSTR256(t,mod,rh,rl) \
109 DECODE_PRINTF(t[(mod<<6)+(rh<<3)+(rl)]);
110 #else
111 # define DECODE_PRINTINSTR32(t,mod,rh,rl)
112 # define DECODE_PRINTINSTR256(t,mod,rh,rl)
113 #endif
115 #endif /* __X86EMU_FPU_REGS_H */