1 |
|
/* |
2 |
|
* fpu/impl.h - extra functions and inline implementations |
3 |
|
* |
4 |
< |
* Basilisk II (C) 1997-1999 Christian Bauer |
4 |
> |
* Basilisk II (C) 1997-2004 Christian Bauer |
5 |
|
* |
6 |
|
* MC68881/68040 fpu emulation |
7 |
|
* |
48 |
|
#ifdef FPU_X86 |
49 |
|
|
50 |
|
/* Return the floating-point status register in m68k format */ |
51 |
< |
PUBLIC inline uae_u32 FFPU get_fpsr(void) |
51 |
> |
static inline uae_u32 FFPU get_fpsr(void) |
52 |
|
{ |
53 |
|
return to_m68k_fpcond[(x86_status_word & 0x4700) >> 8] |
54 |
|
| FPU fpsr.quotient |
58 |
|
} |
59 |
|
|
60 |
|
/* Set the floating-point status register from an m68k format */ |
61 |
< |
PUBLIC inline void FFPU set_fpsr(uae_u32 new_fpsr) |
61 |
> |
static inline void FFPU set_fpsr(uae_u32 new_fpsr) |
62 |
|
{ |
63 |
|
x86_status_word = to_host_fpcond[(new_fpsr & FPSR_CCB) >> 24 ] |
64 |
|
| exception_mac2host[(new_fpsr & FPSR_EXCEPTION_STATUS) >> 8]; |
74 |
|
#ifndef FPU_X86 |
75 |
|
|
76 |
|
/* Return the floating-point status register in m68k format */ |
77 |
< |
PUBLIC inline uae_u32 FFPU get_fpsr(void) |
77 |
> |
static inline uae_u32 FFPU get_fpsr(void) |
78 |
|
{ |
79 |
|
uae_u32 condition_codes = get_fpccr(); |
80 |
|
uae_u32 exception_status = get_exception_status(); |
84 |
|
} |
85 |
|
|
86 |
|
/* Set the floating-point status register from an m68k format */ |
87 |
< |
PUBLIC inline void FFPU set_fpsr(uae_u32 new_fpsr) |
87 |
> |
static inline void FFPU set_fpsr(uae_u32 new_fpsr) |
88 |
|
{ |
89 |
|
set_fpccr ( new_fpsr & FPSR_CCB ); |
90 |
|
set_exception_status ( new_fpsr & FPSR_EXCEPTION_STATUS ); |
99 |
|
/* -------------------------------------------------------------------------- */ |
100 |
|
|
101 |
|
/* Return the floating-point control register in m68k format */ |
102 |
< |
PUBLIC inline uae_u32 FFPU get_fpcr(void) |
102 |
> |
static inline uae_u32 FFPU get_fpcr(void) |
103 |
|
{ |
104 |
|
uae_u32 rounding_precision = get_rounding_precision(); |
105 |
|
uae_u32 rounding_mode = get_rounding_mode(); |
107 |
|
} |
108 |
|
|
109 |
|
/* Set the floating-point control register from an m68k format */ |
110 |
< |
PUBLIC inline void FFPU set_fpcr(uae_u32 new_fpcr) |
110 |
> |
static inline void FFPU set_fpcr(uae_u32 new_fpcr) |
111 |
|
{ |
112 |
|
set_rounding_precision ( new_fpcr & FPCR_ROUNDING_PRECISION); |
113 |
|
set_rounding_mode ( new_fpcr & FPCR_ROUNDING_MODE ); |
121 |
|
#ifdef FPU_X86 |
122 |
|
|
123 |
|
/* Retrieve a floating-point register value and convert it to double precision */ |
124 |
< |
PUBLIC inline double FFPU fpu_get_register(int r) |
124 |
> |
static inline double FFPU fpu_get_register(int r) |
125 |
|
{ |
126 |
|
double f; |
127 |
|
__asm__ __volatile__("fldt %1\n\tfstpl %0" : "=m" (f) : "m" (FPU registers[r])); |
137 |
|
#if defined(FPU_UAE) || defined(FPU_IEEE) |
138 |
|
|
139 |
|
/* Retrieve a floating-point register value and convert it to double precision */ |
140 |
< |
PUBLIC inline double FFPU fpu_get_register(int r) |
140 |
> |
static inline double FFPU fpu_get_register(int r) |
141 |
|
{ |
142 |
|
return FPU registers[r]; |
143 |
|
} |