]> git.proxmox.com Git - qemu.git/commitdiff
softfloat: Add float32_is_zero_or_denormal() function
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 14 Jan 2011 19:39:18 +0000 (20:39 +0100)
committerAurelien Jarno <aurelien@aurel32.net>
Fri, 14 Jan 2011 19:39:18 +0000 (20:39 +0100)
Add a utility function to softfloat to test whether a float32
is zero or denormal.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
fpu/softfloat.h

index a6d0f16b42815aeda4ae06d321e357b56a61d33b..4a5345ceca3abdf76f2a2dfd72455c0b0f7efd21 100644 (file)
@@ -336,6 +336,11 @@ INLINE int float32_is_any_nan(float32 a)
     return ((float32_val(a) & ~(1 << 31)) > 0x7f800000UL);
 }
 
+INLINE int float32_is_zero_or_denormal(float32 a)
+{
+    return (float32_val(a) & 0x7f800000) == 0;
+}
+
 #define float32_zero make_float32(0)
 #define float32_one make_float32(0x3f800000)
 #define float32_ln2 make_float32(0x3f317218)