142 |
#include "cpu.h" |
#include "cpu.h" |
143 |
#include "exec-all.h" |
#include "exec-all.h" |
144 |
|
|
145 |
|
/* XXX: add a generic FPU library */ |
146 |
|
|
147 |
|
static inline double float32_to_float64(float a) |
148 |
|
{ |
149 |
|
return a; |
150 |
|
} |
151 |
|
|
152 |
|
static inline float float64_to_float32(double a) |
153 |
|
{ |
154 |
|
return a; |
155 |
|
} |
156 |
|
|
157 |
|
#if defined(__powerpc__) |
158 |
|
/* better to call an helper on ppc */ |
159 |
|
float int32_to_float32(int32_t a); |
160 |
|
double int32_to_float64(int32_t a); |
161 |
|
#else |
162 |
|
static inline float int32_to_float32(int32_t a) |
163 |
|
{ |
164 |
|
return (float)a; |
165 |
|
} |
166 |
|
|
167 |
|
static inline double int32_to_float64(int32_t a) |
168 |
|
{ |
169 |
|
return (double)a; |
170 |
|
} |
171 |
|
#endif |
172 |
|
|
173 |
|
static inline float int64_to_float32(int64_t a) |
174 |
|
{ |
175 |
|
return (float)a; |
176 |
|
} |
177 |
|
|
178 |
|
static inline double int64_to_float64(int64_t a) |
179 |
|
{ |
180 |
|
return (double)a; |
181 |
|
} |
182 |
|
|
183 |
typedef struct CCTable { |
typedef struct CCTable { |
184 |
int (*compute_all)(void); /* return all the flags */ |
int (*compute_all)(void); /* return all the flags */ |
185 |
int (*compute_c)(void); /* return the C flag */ |
int (*compute_c)(void); /* return the C flag */ |
597 |
void save_native_fp_state(CPUState *env); |
void save_native_fp_state(CPUState *env); |
598 |
float approx_rsqrt(float a); |
float approx_rsqrt(float a); |
599 |
float approx_rcp(float a); |
float approx_rcp(float a); |
600 |
|
double helper_sqrt(double a); |
601 |
int fpu_isnan(double a); |
int fpu_isnan(double a); |
602 |
|
|
603 |
extern const uint8_t parity_table[256]; |
extern const uint8_t parity_table[256]; |