From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1005) id 3CBCE3858D1E; Fri, 2 Sep 2022 06:40:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3CBCE3858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1662100836; bh=PCLyo7Sb0j8p6D2W7ASgmq9g2jYfWiNurdcql+US+gg=; h=From:To:Subject:Date:From; b=fCXRaothwEz7826yDaUYOcNFOARnjfpslb+9gP8LRzFhsd+3Ks0PfZ/jGihBbHTU3 VTdeEpZOYMxdkAezYcjJQjsKmvcEI+QwbTAGY+fsMGTUdaeiwcrKP/uQB9nutF3lT6 Sh9HTHgen9u0wZGVnenaQcEbfmLcO/zluDuIUkso= 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/work099)] Update ChangeLog.meissner. X-Act-Checkin: gcc X-Git-Author: Michael Meissner X-Git-Refname: refs/users/meissner/heads/work099 X-Git-Oldrev: 864780ce60c312a8cb50a47c24500168775b9516 X-Git-Newrev: 13eb4c891ef90117b496abad6eaac30a781f3b04 Message-Id: <20220902064036.3CBCE3858D1E@sourceware.org> Date: Fri, 2 Sep 2022 06:40:36 +0000 (GMT) List-Id: https://gcc.gnu.org/g:13eb4c891ef90117b496abad6eaac30a781f3b04 commit 13eb4c891ef90117b496abad6eaac30a781f3b04 Author: Michael Meissner Date: Fri Sep 2 02:38:06 2022 -0400 Update ChangeLog.meissner. 2022-09-01 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 a898abbc61b..2491307b1b9 100644 --- a/gcc/ChangeLog.meissner +++ b/gcc/ChangeLog.meissner @@ -1,3 +1,79 @@ +==================== Work099, 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-02 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. + ==================== Work099, patch #5: Update float 128-bit conversions.