[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 5/7] softfloat: Rework `*_is_*_nan' functions
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH v2 5/7] softfloat: Rework `*_is_*_nan' functions |
Date: |
Thu, 5 Feb 2015 16:42:50 +0000 |
On 12 December 2014 at 19:35, Maciej W. Rozycki <address@hidden> wrote:
> Precompute the possible results, and then pick the suitable one. The
> calculation of the unused result will be optimized away by the compiler
> at any reasonable optimization level, so no run-time performance loss.
>
> Signed-off-by: Thomas Schwinge <address@hidden>
> Signed-off-by: Maciej W. Rozycki <address@hidden>
> --- qemu-git-trunk.orig/fpu/softfloat-specialize.h 2014-12-11
> 22:41:47.118930659 +0000
> +++ qemu-git-trunk/fpu/softfloat-specialize.h 2014-12-11 22:42:29.128941855
> +0000
> @@ -207,10 +207,13 @@ int float16_is_signaling_nan(float16 a_
> int float16_is_quiet_nan(float16 a_ STATUS_PARAM)
> {
> uint16_t a = float16_val(a_);
> + int __attribute__ ((unused)) x, y;
> + x = (((a >> 9) & 0x3F) == 0x3E) && (a & 0x1FF);
> + y = (a & ~0x8000) >= 0x7c80;
> #if SNAN_BIT_IS_ONE
> - return (((a >> 9) & 0x3F) == 0x3E) && (a & 0x1FF);
> + return x;
> #else
> - return ((a & ~0x8000) >= 0x7c80);
> + return y;
> #endif
> }
I don't really see the point in this patch -- the existing
version of the code seems better to me (doesn't need the
extra __attribute__ ((unused)) variables, for instance).
What's the benefit?
thanks
-- PMM
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Qemu-devel] [PATCH v2 5/7] softfloat: Rework `*_is_*_nan' functions,
Peter Maydell <=