On 12 December 2014 at 19:35, Maciej W. Rozycki <ma...@codesourcery.com> 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 <tho...@codesourcery.com> > Signed-off-by: Maciej W. Rozycki <ma...@codesourcery.com>
> --- 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