1 |
|
/* |
2 |
|
* fpu/rounding.h - system-dependant FPU rounding mode and precision |
3 |
|
* |
4 |
< |
* Basilisk II (C) 1997-1999 Christian Bauer |
4 |
> |
* Basilisk II (C) 1997-2008 Christian Bauer |
5 |
|
* |
6 |
|
* MC68881/68040 fpu emulation |
7 |
|
* |
50 |
|
/* -------------------------------------------------------------------------- */ |
51 |
|
|
52 |
|
/* Optimized i386 fpu core must use native rounding mode */ |
53 |
< |
#if defined(FPU_X86) && defined(X86_ASSEMBLY) |
53 |
> |
#if defined(FPU_X86) && defined(USE_X87_ASSEMBLY) |
54 |
|
# undef FPU_USE_GENERIC_ROUNDING_MODE |
55 |
|
# define FPU_USE_X86_ROUNDING_MODE |
56 |
|
#endif |
57 |
|
|
58 |
|
/* Optimized i386 fpu core must use native rounding precision */ |
59 |
< |
#if defined(FPU_X86) && defined(X86_ASSEMBLY) |
59 |
> |
#if defined(FPU_X86) && defined(USE_X87_ASSEMBLY) |
60 |
|
# undef FPU_USE_GENERIC_ROUNDING_PRECISION |
61 |
|
# define FPU_USE_X86_ROUNDING_PRECISION |
62 |
|
#endif |
63 |
|
|
64 |
|
#if 0 // gb-- FIXME: that doesn't work |
65 |
|
/* IEEE-based fpu core can have native rounding mode on i386 */ |
66 |
< |
#if defined(FPU_IEEE) && defined(X86_ASSEMBLY) |
66 |
> |
#if defined(FPU_IEEE) && defined(USE_X87_ASSEMBLY) |
67 |
|
# undef FPU_USE_GENERIC_ROUNDING_MODE |
68 |
|
# define FPU_USE_X86_ROUNDING_MODE |
69 |
|
#endif |
70 |
|
|
71 |
|
/* IEEE-based fpu core can have native rounding precision on i386 */ |
72 |
< |
#if defined(FPU_IEEE) && defined(X86_ASSEMBLY) |
72 |
> |
#if defined(FPU_IEEE) && defined(USE_X87_ASSEMBLY) |
73 |
|
# undef FPU_USE_GENERIC_ROUNDING_PRECISION |
74 |
|
# define FPU_USE_X86_ROUNDING_PRECISION |
75 |
|
#endif |
130 |
|
#if defined(FPU_USE_GENERIC_ROUNDING_MODE) || defined(FPU_USE_X86_ROUNDING_MODE) |
131 |
|
|
132 |
|
/* Return the current rounding mode in m68k format */ |
133 |
< |
PUBLIC inline uae_u32 FFPU get_rounding_mode(void) |
133 |
> |
static inline uae_u32 FFPU get_rounding_mode(void) |
134 |
|
{ return FPU fpcr.rounding_mode; } |
135 |
|
|
136 |
|
/* Convert and set to native rounding mode */ |
137 |
< |
PUBLIC inline void FFPU set_rounding_mode(uae_u32 new_rounding_mode) |
137 |
> |
static inline void FFPU set_rounding_mode(uae_u32 new_rounding_mode) |
138 |
|
{ FPU fpcr.rounding_mode = new_rounding_mode; } |
139 |
|
|
140 |
|
#endif |
142 |
|
#if defined(FPU_USE_GENERIC_ROUNDING_PRECISION) || defined(FPU_USE_X86_ROUNDING_PRECISION) |
143 |
|
|
144 |
|
/* Return the current rounding precision in m68k format */ |
145 |
< |
PUBLIC inline uae_u32 FFPU get_rounding_precision(void) |
145 |
> |
static inline uae_u32 FFPU get_rounding_precision(void) |
146 |
|
{ return FPU fpcr.rounding_precision; } |
147 |
|
|
148 |
|
/* Convert and set to native rounding precision */ |
149 |
< |
PUBLIC inline void FFPU set_rounding_precision(uae_u32 new_rounding_precision) |
149 |
> |
static inline void FFPU set_rounding_precision(uae_u32 new_rounding_precision) |
150 |
|
{ FPU fpcr.rounding_precision = new_rounding_precision; } |
151 |
|
|
152 |
|
#endif |