glibc/sysdeps
Szabolcs Nagy 505b5b2922 Fix powf overflow handling in non-nearest rounding mode [BZ #23961]
The threshold value at which powf overflows depends on the rounding mode
and the current check did not take this into account. So when the result
was rounded away from zero it could become infinity without setting
errno to ERANGE.

Example: pow(0x1.7ac7cp+5, 23) is 0x1.fffffep+127 + 0.1633ulp

If the result goes above 0x1.fffffep+127 + 0.5ulp then errno is set,
which is fine in nearest rounding mode, but

  powf(0x1.7ac7cp+5, 23) is inf in upward rounding mode
  powf(-0x1.7ac7cp+5, 23) is -inf in downward rounding mode

and the previous implementation did not set errno in these cases.

The fix tries to avoid affecting the common code path or calling a
function that may introduce a stack frame, so float arithmetics is used
to check the rounding mode and the threshold is selected accordingly.

	[BZ #23961]
	* math/auto-libm-test-in: Add new test case.
	* math/auto-libm-test-out-pow: Regenerated.
	* sysdeps/ieee754/flt-32/e_powf.c (__powf): Fix overflow check.
2018-12-11 10:01:43 +00:00
..
aarch64
alpha
arm
generic Use PRINTF_LDBL_IS_DBL instead of __ldbl_is_dbl. 2018-12-05 18:15:43 -02:00
gnu
hppa
htl htl: Fix comparing attr with default values 2018-12-01 21:42:12 +01:00
hurd
i386
ia64
ieee754 Fix powf overflow handling in non-nearest rounding mode [BZ #23961] 2018-12-11 10:01:43 +00:00
init_array
m68k
mach hurd: Fix linknamespace of spawni 2018-12-07 20:21:45 +01:00
microblaze
mips
nios2
nptl Use PRINTF_FORTIFY instead of _IO_FLAGS2_FORTIFY (bug 11319) 2018-12-05 18:15:43 -02:00
posix posix: New function posix_spawn_file_actions_addfchdir_np [BZ #17405] 2018-12-07 16:04:05 +01:00
powerpc Move *-le.abilist to le/*.abilist 2018-12-10 14:30:05 +01:00
pthread
riscv
s390 S390: Regenerate ULPs. 2018-11-28 15:20:18 +01:00
sh
sparc
unix Move tst-signal-numbers to Python. 2018-12-10 22:27:13 +00:00
wordsize-32
wordsize-64
x86 x86: Extend CPUID support in struct cpu_features 2018-12-03 05:54:56 -08:00
x86_64 x86: Extend CPUID support in struct cpu_features 2018-12-03 05:54:56 -08:00