Commit 79f91c27bad7cf39ff336f1b2ed418942f65bab6

Authored by bellard
1 parent dc9543dc

more fpu functions


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1233 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 39 additions and 0 deletions
target-i386/exec.h
... ... @@ -142,6 +142,44 @@ extern int loglevel;
142 142 #include "cpu.h"
143 143 #include "exec-all.h"
144 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 +
145 183 typedef struct CCTable {
146 184 int (*compute_all)(void); /* return all the flags */
147 185 int (*compute_c)(void); /* return the C flag */
... ... @@ -559,6 +597,7 @@ void restore_native_fp_state(CPUState *env);
559 597 void save_native_fp_state(CPUState *env);
560 598 float approx_rsqrt(float a);
561 599 float approx_rcp(float a);
  600 +double helper_sqrt(double a);
562 601 int fpu_isnan(double a);
563 602  
564 603 extern const uint8_t parity_table[256];
... ...