From b8682397ab2db1aed7f25d0a0c7c81134a97c8c7 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Thu, 17 Sep 2015 16:47:14 +0000 Subject: Reduce number of constants in __finite* (bug 15384). Bug 15384 notes that in __finite, two different constants are used that could be the same constant (the result only depends on the exponent of the floating-point representation), and that using the same constant is better for architectures where constants need loading from a constant pool. This patch implements that change. Tested for x86_64, mips64 and powerpc. [BZ #15384] * sysdeps/ieee754/dbl-64/s_finite.c (FINITE): Use same constant as bit-mask as in subtraction. * sysdeps/ieee754/dbl-64/wordsize-64/s_finite.c (__finite): Likewise. * sysdeps/ieee754/flt-32/s_finitef.c (FINITEF): Likewise. * sysdeps/ieee754/ldbl-128/s_finitel.c (__finitel): Likewise. * sysdeps/ieee754/ldbl-128ibm/s_finitel.c (__finitel): Likewise. --- sysdeps/ieee754/flt-32/s_finitef.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sysdeps/ieee754/flt-32/s_finitef.c') diff --git a/sysdeps/ieee754/flt-32/s_finitef.c b/sysdeps/ieee754/flt-32/s_finitef.c index 4ea270ae07..4c5b339235 100644 --- a/sysdeps/ieee754/flt-32/s_finitef.c +++ b/sysdeps/ieee754/flt-32/s_finitef.c @@ -35,7 +35,7 @@ int FINITEF(float x) { int32_t ix; GET_FLOAT_WORD(ix,x); - return (int)((u_int32_t)((ix&0x7fffffff)-0x7f800000)>>31); + return (int)((u_int32_t)((ix&0x7f800000)-0x7f800000)>>31); } hidden_def (__finitef) weak_alias (__finitef, finitef) -- cgit 1.4.1