Received: from [140.186.70.92] (port=46931 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PcXc4-0000T7-P0 for qemu-devel@nongnu.org; Tue, 11 Jan 2011 01:21:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PcXc2-0008Ro-V8 for qemu-devel@nongnu.org; Tue, 11 Jan 2011 01:21:48 -0500 Received: from hall.aurel32.net ([88.191.126.93]:41628) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PcXc2-0008RQ-QZ for qemu-devel@nongnu.org; Tue, 11 Jan 2011 01:21:46 -0500 Received: from aurel32 by hall.aurel32.net with local (Exim 4.69) (envelope-from ) id 1PcXbt-0003iT-Ji for qemu-devel@nongnu.org; Tue, 11 Jan 2011 07:21:37 +0100 Resent-Message-ID: <20110111062137.GB10453@hall.aurel32.net> Resent-To: qemu-devel@nongnu.org Date: Mon, 10 Jan 2011 20:13:21 +0100 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH 1/4] softfloat: Add float32_is_zero_or_denormal() function Message-ID: <20110110191321.GO17026@hall.aurel32.net> References: <1294392387-24300-1-git-send-email-peter.maydell@linaro.org> <1294392387-24300-2-git-send-email-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <1294392387-24300-2-git-send-email-peter.maydell@linaro.org> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell On Fri, Jan 07, 2011 at 09:26:24AM +0000, Peter Maydell wrote: > Add a utility function to softfloat to test whether a float32 > is zero or denormal. > > Signed-off-by: Peter Maydell > --- > fpu/softfloat.h | 5 +++++ > 1 files changed, 5 insertions(+), 0 deletions(-) Reviewed-by: Aurelien Jarno > diff --git a/fpu/softfloat.h b/fpu/softfloat.h > index 15052cc..1acf7af 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) > -- > 1.6.3.3 > > > -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net