From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1005) id 965343858429; Fri, 9 Sep 2022 21:07:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 965343858429 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1662757639; bh=R0hI1XE1tUWTkAOp5NpV1RhMEXHU4U//si1bximbbV0=; h=From:To:Subject:Date:From; b=xQd7SvSeyWwRU6XaIL5WZnTIvdwPpV8I99jQY+pyobe7SjRuVAwT6Zcd6KD4Rw93T 9me50iM20Cp3SSQmuTYxUHS1+QEHzwRHCzXX8Eoe6FDMwIg1X+F32ZPPqsEjSLfQhv 8W+zmH5Biv7HSz3153plMcoAhA8APnuMHnrNtMIg= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Michael Meissner To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/meissner/heads/work100)] Update ChangeLog.meissner. X-Act-Checkin: gcc X-Git-Author: Michael Meissner X-Git-Refname: refs/users/meissner/heads/work100 X-Git-Oldrev: 651ab7ff8527f7e9aaaff92277af1c275e92cef7 X-Git-Newrev: 1958caeba256da4615eeffc83f71380a1f4772ba Message-Id: <20220909210719.965343858429@sourceware.org> Date: Fri, 9 Sep 2022 21:07:19 +0000 (GMT) List-Id: https://gcc.gnu.org/g:1958caeba256da4615eeffc83f71380a1f4772ba commit 1958caeba256da4615eeffc83f71380a1f4772ba Author: Michael Meissner Date: Fri Sep 9 17:04:49 2022 -0400 Update ChangeLog.meissner. 2022-09-09 Michael Meissner gcc/ * ChangeLog.meissner: Update. Diff: --- gcc/ChangeLog.meissner | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/gcc/ChangeLog.meissner b/gcc/ChangeLog.meissner index 726276a9168..fa224a0d206 100644 --- a/gcc/ChangeLog.meissner +++ b/gcc/ChangeLog.meissner @@ -1,3 +1,79 @@ +==================== work100, patch #6 + +Make __float128 use the _Float128 type. + +Currently GCC uses the long double type node for __float128 if long double is +IEEE 128-bit. It did not use the node for _Float128. + +Problems showed up if you call the nansq function to make a signaling NaN (nansq +is mapped to nansf128). Because the type node for _Float128 is different from +__float128, the machine independent code converts signaling NaNs to quiet NaNs +if the types are not compatible. The following tests used to fail when run on +a system where long double is IEEE 128-bit: + + gcc.dg/torture/float128-nan.c + gcc.target/powerpc/nan128-1.c + +This patch makes both __float128 and _Float128 use the same type node. + +One side effect of not using the long double type node for __float128 is that we +must only use KFmode for _Float128/__float128. The libstdc++ library won't +build if we use TFmode for _Float128 and __float128 when long double is IEEE +128-bit. + +Another minor side effect is that the f128 round to odd fused multiply-add +function will not merge negatition with the FMA operation when the type is long +double. If the type is __float128 or _Float128, then it will continue to do the +optimization. The round to odd functions are defined in terms of __float128 +arguments. For example: + + long double + do_fms (long double a, long double b, long double c) + { + return __builtin_fmaf128_round_to_odd (a, b, -c); + } + +will generate (assuming -mabi=ieeelongdouble): + + xsnegqp 4,4 + xsmaddqpo 4,2,3 + xxlor 34,36,36 + +while: + + __float128 + do_fms (__float128 a, __float128 b, __float128 c) + { + return __builtin_fmaf128_round_to_odd (a, b, -c); + } + +will generate: + + xsmsubqpo 4,2,3 + xxlor 34,36,36 + +2022-09-09 Michael Meissner + +gcc/ + + * config/rs6000/rs6000-builtin.cc (rs6000_init_builtins): Always use the + _Float128 type for __float128. + (rs6000_expand_builtin): Only change a KFmode built-in to TFmode, if the + built-in passes or returns TFmode. If the predicate failed because the + modes were different, use convert_move to load up the value instead of + copy_to_mode_reg. + * config/rs6000/rs6000.cc (rs6000_translate_mode_attribute): Don't + translate __float128 modes to long double modes (TFmode or TCmode). + (rs6000_libgcc_floating_mode_supported_p): Support KFmode all of the + time if we support IEEE 128-bit floating point. + (rs6000_floatn_mode): _Float128 and _Float128x always uses KFmode. + +gcc/testsuite/ + + * gcc.target/powerpc/float128-hw12.c: New test. + * gcc.target/powerpc/float128-hw13.c: Likewise. + * gcc.target/powerpc/float128-hw4.c: Update insns. + ==================== work100, patch #5 Rework 128-bit complex multiply and divide.