]> git.proxmox.com Git - qemu.git/commitdiff
softfloat-native: add a few constant values
authorAurelien Jarno <aurelien@aurel32.net>
Wed, 20 Apr 2011 11:04:22 +0000 (13:04 +0200)
committerAurelien Jarno <aurelien@aurel32.net>
Mon, 25 Apr 2011 09:18:32 +0000 (11:18 +0200)
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
fpu/softfloat-native.h

index ea7a15e1c45820fc90783f0791015ced931f2a8f..97fb3c7a5c707c934064dd6dbefdecdbfe70911a 100644 (file)
@@ -171,6 +171,15 @@ floatx80 int64_to_floatx80( int64_t STATUS_PARAM);
 float128 int64_to_float128( int64_t STATUS_PARAM);
 #endif
 
+/*----------------------------------------------------------------------------
+| Software IEC/IEEE single-precision conversion constants.
+*----------------------------------------------------------------------------*/
+#define float32_zero (0.0)
+#define float32_one (1.0)
+#define float32_ln2 (0.6931471)
+#define float32_pi (3.1415926)
+#define float32_half (0.5)
+
 /*----------------------------------------------------------------------------
 | Software IEC/IEEE single-precision conversion routines.
 *----------------------------------------------------------------------------*/
@@ -279,6 +288,15 @@ INLINE float32 float32_scalbn(float32 a, int n)
     return scalbnf(a, n);
 }
 
+/*----------------------------------------------------------------------------
+| Software IEC/IEEE double-precision conversion constants.
+*----------------------------------------------------------------------------*/
+#define float64_zero (0.0)
+#define float64_one (1.0)
+#define float64_ln2 (0.693147180559945)
+#define float64_pi (3.141592653589793)
+#define float64_half (0.5)
+
 /*----------------------------------------------------------------------------
 | Software IEC/IEEE double-precision conversion routines.
 *----------------------------------------------------------------------------*/
@@ -393,6 +411,15 @@ INLINE float64 float64_scalbn(float64 a, int n)
 
 #ifdef FLOATX80
 
+/*----------------------------------------------------------------------------
+| Software IEC/IEEE extended double-precision conversion constants.
+*----------------------------------------------------------------------------*/
+#define floatx80_zero (0.0L)
+#define floatx80_one (1.0L)
+#define floatx80_ln2 (0.69314718055994530943L)
+#define floatx80_pi (3.14159265358979323851L)
+#define floatx80_half (0.5L)
+
 /*----------------------------------------------------------------------------
 | Software IEC/IEEE extended double-precision conversion routines.
 *----------------------------------------------------------------------------*/