/[qemu]/qemu/target-i386/exec.h
ViewVC logotype

Diff of /qemu/target-i386/exec.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.22 by bellard, Tue Mar 1 22:33:39 2005 UTC revision 1.23 by bellard, Sun Mar 13 16:59:53 2005 UTC
# Line 139  extern int loglevel; Line 139  extern int loglevel;
139  #include "cpu.h"  #include "cpu.h"
140  #include "exec-all.h"  #include "exec-all.h"
141    
 /* XXX: add a generic FPU library */  
   
 static inline double float32_to_float64(float a)  
 {  
     return a;  
 }  
   
 static inline float float64_to_float32(double a)  
 {  
     return a;  
 }  
   
 #if defined(__powerpc__)  
 /* better to call an helper on ppc */  
 float int32_to_float32(int32_t a);  
 double int32_to_float64(int32_t a);  
 #else  
 static inline float int32_to_float32(int32_t a)  
 {  
     return (float)a;  
 }  
   
 static inline double int32_to_float64(int32_t a)  
 {  
     return (double)a;  
 }  
 #endif  
   
 static inline float int64_to_float32(int64_t a)  
 {  
     return (float)a;  
 }  
   
 static inline double int64_to_float64(int64_t a)  
 {  
     return (double)a;  
 }  
   
142  typedef struct CCTable {  typedef struct CCTable {
143      int (*compute_all)(void); /* return all the flags */      int (*compute_all)(void); /* return all the flags */
144      int (*compute_c)(void);  /* return the C flag */      int (*compute_c)(void);  /* return the C flag */
# Line 358  static inline void stfl(target_ulong ptr Line 320  static inline void stfl(target_ulong ptr
320    
321  #ifdef USE_X86LDOUBLE  #ifdef USE_X86LDOUBLE
322  /* use long double functions */  /* use long double functions */
323  #define lrint lrintl  #define floatx_to_int32 floatx80_to_int32
324  #define llrint llrintl  #define floatx_to_int64 floatx80_to_int64
325  #define fabs fabsl  #define floatx_abs floatx80_abs
326    #define floatx_chs floatx80_chs
327    #define floatx_round_to_int floatx80_round_to_int
328  #define sin sinl  #define sin sinl
329  #define cos cosl  #define cos cosl
330  #define sqrt sqrtl  #define sqrt sqrtl
# Line 370  static inline void stfl(target_ulong ptr Line 334  static inline void stfl(target_ulong ptr
334  #define atan2 atan2l  #define atan2 atan2l
335  #define floor floorl  #define floor floorl
336  #define ceil ceill  #define ceil ceill
 #define rint rintl  
 #endif  
   
 #if !defined(_BSD)  
 extern int lrint(CPU86_LDouble x);  
 extern int64_t llrint(CPU86_LDouble x);  
337  #else  #else
338  #define lrint(d)                ((int)rint(d))  #define floatx_to_int32 float64_to_int32
339  #define llrint(d)               ((int)rint(d))  #define floatx_to_int64 float64_to_int64
340    #define floatx_abs float64_abs
341    #define floatx_chs float64_chs
342    #define floatx_round_to_int float64_round_to_int
343  #endif  #endif
344  extern CPU86_LDouble fabs(CPU86_LDouble x);  
345  extern CPU86_LDouble sin(CPU86_LDouble x);  extern CPU86_LDouble sin(CPU86_LDouble x);
346  extern CPU86_LDouble cos(CPU86_LDouble x);  extern CPU86_LDouble cos(CPU86_LDouble x);
347  extern CPU86_LDouble sqrt(CPU86_LDouble x);  extern CPU86_LDouble sqrt(CPU86_LDouble x);
# Line 390  extern CPU86_LDouble tan(CPU86_LDouble x Line 351  extern CPU86_LDouble tan(CPU86_LDouble x
351  extern CPU86_LDouble atan2(CPU86_LDouble, CPU86_LDouble);  extern CPU86_LDouble atan2(CPU86_LDouble, CPU86_LDouble);
352  extern CPU86_LDouble floor(CPU86_LDouble x);  extern CPU86_LDouble floor(CPU86_LDouble x);
353  extern CPU86_LDouble ceil(CPU86_LDouble x);  extern CPU86_LDouble ceil(CPU86_LDouble x);
 extern CPU86_LDouble rint(CPU86_LDouble x);  
354    
355  #define RC_MASK         0xc00  #define RC_MASK         0xc00
356  #define RC_NEAR         0x000  #define RC_NEAR         0x000
# Line 400  extern CPU86_LDouble rint(CPU86_LDouble Line 360  extern CPU86_LDouble rint(CPU86_LDouble
360    
361  #define MAXTAN 9223372036854775808.0  #define MAXTAN 9223372036854775808.0
362    
 #ifdef __arm__  
 /* we have no way to do correct rounding - a FPU emulator is needed */  
 #define FE_DOWNWARD   FE_TONEAREST  
 #define FE_UPWARD     FE_TONEAREST  
 #define FE_TOWARDZERO FE_TONEAREST  
 #endif  
   
363  #ifdef USE_X86LDOUBLE  #ifdef USE_X86LDOUBLE
364    
365  /* only for x86 */  /* only for x86 */
# Line 596  float approx_rsqrt(float a); Line 549  float approx_rsqrt(float a);
549  float approx_rcp(float a);  float approx_rcp(float a);
550  double helper_sqrt(double a);  double helper_sqrt(double a);
551  int fpu_isnan(double a);  int fpu_isnan(double a);
552    void update_fp_status(void);
553    
554  extern const uint8_t parity_table[256];  extern const uint8_t parity_table[256];
555  extern const uint8_t rclw_table[32];  extern const uint8_t rclw_table[32];

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.23

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26