From: Peter Maydell Date: Fri, 14 Jan 2011 19:39:18 +0000 (+0100) Subject: softfloat: Add float32_is_zero_or_denormal() function X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=6f3300ad2b5a1e7090720993d9fcb9f550259e12;p=qemu.git softfloat: Add float32_is_zero_or_denormal() function Add a utility function to softfloat to test whether a float32 is zero or denormal. Signed-off-by: Peter Maydell Reviewed-by: Aurelien Jarno Signed-off-by: Aurelien Jarno --- diff --git a/fpu/softfloat.h b/fpu/softfloat.h index a6d0f16b42..4a5345ceca 100644 --- a/fpu/softfloat.h +++ b/fpu/softfloat.h @@ -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)