public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Michael Meissner <meissner@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/meissner/heads/work100)] Update ChangeLog.meissner. Date: Fri, 9 Sep 2022 21:07:19 +0000 (GMT) [thread overview] Message-ID: <20220909210719.965343858429@sourceware.org> (raw) https://gcc.gnu.org/g:1958caeba256da4615eeffc83f71380a1f4772ba commit 1958caeba256da4615eeffc83f71380a1f4772ba Author: Michael Meissner <meissner@linux.ibm.com> Date: Fri Sep 9 17:04:49 2022 -0400 Update ChangeLog.meissner. 2022-09-09 Michael Meissner <meissner@linux.ibm.com> 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 <meissner@linux.ibm.com> + +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.
next reply other threads:[~2022-09-09 21:07 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-09-09 21:07 Michael Meissner [this message] -- strict thread matches above, loose matches on Subject: below -- 2022-09-09 18:34 Michael Meissner
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220909210719.965343858429@sourceware.org \ --to=meissner@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).