ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/uae_cpu/fpu/types.h
Revision: 1.1
Committed: 2002-09-13T12:50:40Z (21 years, 10 months ago) by gbeauche
Content type: text/plain
Branch: MAIN
Log Message:
* Basilisk II JIT integration, phase 2:
- Add new FPU core architecture
- Clean fpu_x86_asm.h as it is no longer automatically generated

File Contents

# User Rev Content
1 gbeauche 1.1 /*
2     * types.h - basic types for fpu registers
3     *
4     * Basilisk II (C) 1997-1999 Christian Bauer
5     *
6     * MC68881/68040 fpu emulation
7     *
8     * Original UAE FPU, copyright 1996 Herman ten Brugge
9     * Rewrite for x86, copyright 1999-2000 Lauri Pesonen
10     * New framework, copyright 2000 Gwenole Beauchesne
11     * Adapted for JIT compilation (c) Bernd Meyer, 2000
12     *
13     * This program is free software; you can redistribute it and/or modify
14     * it under the terms of the GNU General Public License as published by
15     * the Free Software Foundation; either version 2 of the License, or
16     * (at your option) any later version.
17     *
18     * This program is distributed in the hope that it will be useful,
19     * but WITHOUT ANY WARRANTY; without even the implied warranty of
20     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21     * GNU General Public License for more details.
22     *
23     * You should have received a copy of the GNU General Public License
24     * along with this program; if not, write to the Free Software
25     * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26     */
27    
28     #ifndef FPU_TYPES_H
29     #define FPU_TYPES_H
30    
31     #include "sysdeps.h"
32    
33     /* Default behavior is *not* to use long doubles */
34     #define USE_LONG_DOUBLE 0
35    
36     /* -------------------------------------------------------------------------- */
37     /* --- Original UAE fpu core --- */
38     /* -------------------------------------------------------------------------- */
39    
40     #if defined(FPU_UAE)
41    
42     /* 4-byte floats */
43     #if SIZEOF_FLOAT == 4
44     typedef float uae_f32;
45     #elif SIZEOF_DOUBLE == 4
46     typedef double uae_f32;
47     #else
48     #error "No 4 byte float type, you lose."
49     #endif
50    
51     /* 8-byte floats */
52     #if SIZEOF_DOUBLE == 8
53     typedef double uae_f64;
54     #elif SIZEOF_LONG_DOUBLE == 8
55     typedef long double uae_f64;
56     #else
57     #error "No 8 byte float type, you lose."
58     #endif
59    
60     /* Original UAE FPU registers are only 8 bytes long */
61     typedef uae_f64 fpu_register;
62     typedef fpu_register fpu_extended;
63     typedef uae_f64 fpu_double;
64     typedef uae_f32 fpu_single;
65    
66     /* -------------------------------------------------------------------------- */
67     /* --- Optimized core for x86 --- */
68     /* -------------------------------------------------------------------------- */
69    
70     #elif defined(FPU_X86)
71    
72     /* 4-byte floats */
73     #if SIZEOF_FLOAT == 4
74     typedef float uae_f32;
75     #elif SIZEOF_DOUBLE == 4
76     typedef double uae_f32;
77     #else
78     #error "No 4 byte float type, you lose."
79     #endif
80    
81     /* 8-byte floats */
82     #if SIZEOF_DOUBLE == 8
83     typedef float uae_f64;
84     #elif SIZEOF_LONG_DOUBLE == 8
85     typedef double uae_f64;
86     #else
87     #error "No 8 byte float type, you lose."
88     #endif
89    
90     /* At least 10-byte floats are required */
91     #if SIZEOF_LONG_DOUBLE >= 10
92     typedef long double fpu_register;
93     #else
94     #error "No float type at least 10 bytes long, you lose."
95     #endif
96    
97     /* X86 FPU has a custom register type that maps to a native X86 register */
98     typedef fpu_register fpu_extended;
99     typedef uae_f64 fpu_double;
100     typedef uae_f32 fpu_single;
101    
102     /* -------------------------------------------------------------------------- */
103     /* --- C99 implementation --- */
104     /* -------------------------------------------------------------------------- */
105    
106     #elif defined(FPU_IEEE)
107    
108     /* 4-byte floats */
109     #if SIZEOF_FLOAT == 4
110     typedef float uae_f32;
111     #elif SIZEOF_DOUBLE == 4
112     typedef double uae_f32;
113     #else
114     #error "No 4 byte float type, you lose."
115     #endif
116    
117     /* 8-byte floats */
118     #if SIZEOF_DOUBLE == 8
119     typedef double uae_f64;
120     #elif SIZEOF_LONG_DOUBLE == 8
121     typedef long double uae_f64;
122     #else
123     #error "No 8 byte float type, you lose."
124     #endif
125    
126     /* 12-byte or 16-byte floats */
127     #if SIZEOF_LONG_DOUBLE == 12
128     typedef long double uae_f96;
129     typedef uae_f96 fpu_register;
130     #elif SIZEOF_LONG_DOUBLE == 16
131     typedef long double uae_f128;
132     typedef uae_f128 fpu_register;
133     #else
134     #error "No float type bigger than 8 bytes, you lose."
135     #endif
136    
137     /* We *do* use long doubles for the IEEE-based FPE */
138     #undef USE_LONG_DOUBLE
139     #define USE_LONG_DOUBLE 1
140    
141     /* We need all those floating-point types */
142     typedef fpu_register fpu_extended;
143     typedef uae_f64 fpu_double;
144     typedef uae_f32 fpu_single;
145    
146     #endif
147    
148     #endif /* FPU_TYPES_H */