]> git.ipfire.org Git - thirdparty/glibc.git/commit
soft-fp: Refine FP_EX_DENORM handling for comparisons.
authorJoseph Myers <joseph@codesourcery.com>
Fri, 6 Feb 2015 15:41:49 +0000 (15:41 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Fri, 6 Feb 2015 15:41:49 +0000 (15:41 +0000)
commit61f006c12d8ff3a80a95a36fed81c908a2e39650
treeb669c8f9c4ef70907f386bf034f5567fcded7ba7
parent639e42eb901b69d3a4d6414751c60fab0ca25119
soft-fp: Refine FP_EX_DENORM handling for comparisons.

In <https://sourceware.org/ml/libc-alpha/2014-09/msg00488.html>, I
noted that comparisons in soft-fp did not set FP_EX_DENORM unless
denormal operands were flushed to zero.

This patch fixes soft-fp to check for denormal operands for
comparisons and set that exception whenever FP_EX_DENORM is not zero.
In particular, for the one architecture for which the Linux kernel
defines FP_EX_DENORM (alpha), this corresponds to the existing logic
for comparisons and so allows that logic to be replaced by a simple
call to FP_CMP_D when soft-fp is updated in the kernel.

Tested for powerpc (e500) that installed stripped shared libraries are
unchanged by this patch.

* soft-fp/op-common.h (_FP_CMP_CHECK_DENORM): New macro.
(_FP_CMP_CHECK_FLUSH_ZERO): Likewise.
(_FP_CMP): Use_FP_CMP_CHECK_DENORM and _FP_CMP_CHECK_FLUSH_ZERO.
(_FP_CMP_EQ): Likewise.
(_FP_CMP_UNORD): Use _FP_CMP_CHECK_DENORM.
ChangeLog
soft-fp/op-common.h