sh: give FP_ILOGB0 the type ISO C asks for
sh was the only port to write these as hexadecimal:
# define FP_ILOGB0 0x80000001
# define FP_ILOGBNAN 0x7fffffff
0x80000001 does not fit in an int, so it has type unsigned int and the
value 2147483649, where ISO C 7.12 wants FP_ILOGB0 to expand to INT_MIN
or -INT_MAX. The macro then contradicts itself: libm/s_ilogb.c returns
it from a function declared int, so ilogb(0) hands back -2147483647,
while a program comparing against the macro is comparing with 2147483649.
That is what the ilogb test reports on sh4, at -O0 and at -O2:
FAIL: ilogb(0/00000000)=-2147483647/18446744071562067969
(expected 2147483649)
Use the decimal form the other fifteen ports use. The runtime value does
not change -- 0x80000001 converted to int was already -2147483647 -- so
this is the type and nothing else. FP_ILOGBNAN goes with it for
symmetry; 0x7fffffff fits in an int and was never wrong.
Built for sh4 and run under qemu-sh4: the test passes at both
optimisation levels with the change and, with the old macro put back into
the installed header, fails with exactly the two lines above.
Signed-off-by: Ramin Moussavi <lordrasmus@gmail.com>