Fix ldbl-128ibm roundl for non-default rounding modes (bug 19594).
commitb9a76339be2514c700d801e179ef9b6c910eaedf
authorJoseph Myers <joseph@codesourcery.com>
Thu, 18 Feb 2016 22:24:32 +0000 (18 22:24 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Thu, 18 Feb 2016 22:24:32 +0000 (18 22:24 +0000)
treea297f70bbf3c8a8713b11ab593b71e9acd59f245
parente2310a27bede834c7b63a8bd1d659c376b6388df
Fix ldbl-128ibm roundl for non-default rounding modes (bug 19594).

The ldbl-128ibm implementation of roundl is only correct in
round-to-nearest mode (in other modes, there are incorrect results and
overflow exceptions in some cases).  This patch reimplements it along
the lines used for floorl, ceill and truncl, using __round on the high
part, and on the low part if the high part is an integer, and then
adjusting in the cases where this is incorrect.

Tested for powerpc.

[BZ #19594]
* sysdeps/ieee754/ldbl-128ibm/s_roundl.c (__roundl): Use __round
on high and low parts then adjust result and use
ldbl_canonicalize_int if needed.
ChangeLog
sysdeps/ieee754/ldbl-128ibm/s_roundl.c