aboutsummaryrefslogtreecommitdiff
path: root/fpu/softfloat-native.h
diff options
context:
space:
mode:
authoraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2008-12-15 17:14:20 +0000
committeraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2008-12-15 17:14:20 +0000
commitc52ab6f585f7cbda2d436be8b0490000c1cef16e (patch)
tree1d1c3a8588a17fd5c0a106bb5f58219f6ce38705 /fpu/softfloat-native.h
parent1b2ad2ec7a79634f8186098dbe34a162d4851ded (diff)
fp: add floatXX_is_infinity(), floatXX_is_neg(), floatXX_is_zero()
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6050 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'fpu/softfloat-native.h')
-rw-r--r--fpu/softfloat-native.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/fpu/softfloat-native.h b/fpu/softfloat-native.h
index f0a7c2e53b..c795795151 100644
--- a/fpu/softfloat-native.h
+++ b/fpu/softfloat-native.h
@@ -258,6 +258,21 @@ INLINE float32 float32_chs(float32 a)
return -a;
}
+INLINE float32 float32_is_infinity(float32 a)
+{
+ return fpclassify(a) == FP_INFINITE;
+}
+
+INLINE float32 float32_is_neg(float32 a)
+{
+ return a < 0.0;
+}
+
+INLINE float32 float32_is_zero(float32 a)
+{
+ return fpclassify(a) == FP_ZERO;
+}
+
INLINE float32 float32_scalbn(float32 a, int n)
{
return scalbnf(a, n);
@@ -350,6 +365,21 @@ INLINE float64 float64_chs(float64 a)
return -a;
}
+INLINE float64 float64_is_infinity(float64 a)
+{
+ return fpclassify(a) == FP_INFINITE;
+}
+
+INLINE float64 float64_is_neg(float64 a)
+{
+ return a < 0.0;
+}
+
+INLINE float64 float64_is_zero(float64 a)
+{
+ return fpclassify(a) == FP_ZERO;
+}
+
INLINE float64 float64_scalbn(float64 a, int n)
{
return scalbn(a, n);
@@ -437,6 +467,21 @@ INLINE floatx80 floatx80_chs(floatx80 a)
return -a;
}
+INLINE floatx80 floatx80_is_infinity(floatx80 a)
+{
+ return fpclassify(a) == FP_INFINITE;
+}
+
+INLINE floatx80 floatx80_is_neg(floatx80 a)
+{
+ return a < 0.0;
+}
+
+INLINE floatx80 floatx80_is_zero(floatx80 a)
+{
+ return fpclassify(a) == FP_ZERO;
+}
+
INLINE floatx80 floatx80_scalbn(floatx80 a, int n)
{
return scalbnl(a, n);