From: Rich Felker Date: Sat, 31 Mar 2012 03:41:43 +0000 (-0400) Subject: optimize signbit macro X-Git-Tag: v0.8.8~58 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=4dbd94112ff74064554054b5ff27a7af547e4899;p=oweals%2Fmusl.git optimize signbit macro --- diff --git a/include/math.h b/include/math.h index 8791bba8..ff62cb7c 100644 --- a/include/math.h +++ b/include/math.h @@ -77,8 +77,8 @@ int __signbitf(float); int __signbitl(long double); #define signbit(x) ( \ - sizeof(x) == sizeof(float) ? !!(__FLOAT_BITS(x) & 0x80000000) : \ - sizeof(x) == sizeof(double) ? !!(__DOUBLE_BITS(x) & (__uint64_t)1<<63) : \ + sizeof(x) == sizeof(float) ? (int)(__FLOAT_BITS(x)>>31) : \ + sizeof(x) == sizeof(double) ? (int)(__DOUBLE_BITS(x)>>63) : \ __signbitl(x) ) #define isunordered(x,y) (isnan((x)) ? ((void)(y),1) : isnan((y)))