public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Joseph Myers <joseph@codesourcery.com>
To: Xi Ruoyao <xry111@xry111.site>
Cc: chenxiaolong <chenxiaolong@loongson.cn>,
	<gcc-patches@gcc.gnu.org>, <i@xen0n.name>,
	<xuchenghua@loongson.cn>, <chenglulu@loongson.cn>
Subject: Re: [PATCH v3] LoongArch:Implement 128-bit floating point functions in gcc.
Date: Thu, 17 Aug 2023 15:08:39 +0000	[thread overview]
Message-ID: <8e88bba4-377a-93fb-6e7b-fafcf1a6f028@codesourcery.com> (raw)
In-Reply-To: <bdfbff84286b02195c21fda75960a12cf64bb01f.camel@xry111.site>

On Thu, 17 Aug 2023, Xi Ruoyao via Gcc-patches wrote:

> So I guess we just need
> 
> builtin_define ("__builtin_fabsq=__builtin_fabsf128");
> builtin_define ("__builtin_nanq=__builtin_nanf128");
> 
> etc. to map the "q" builtins to "f128" builtins if we really need the
> "q" builtins.
> 
> Joseph: the problem here is many customers of LoongArch CPUs wish to
> compile their old code with minimal change.  Is it acceptable to add
> these builtin_define's like rs6000-c.cc?  Note "a new architecture" does
> not mean we'll only compile post-C2x-era programs onto it.

The powerpc support for __float128 started in GCC 6, predating the support 
for _FloatN type names, built-in functions etc. in GCC 7 - that's why 
there's such backwards compatibility support there.  That name only exists 
on a few architectures.

If people really want to compile code using the old __float128 names for 
LoongArch I suppose you could have such #defines, but it would be better 
for people to make their code use the standard names (as supported from 
GCC 7 onwards, though only from GCC 13 in C++) and then put backwards 
compatibility in their code for using the __float128 names if they want to 
support the type with older GCC (GCC 6 or before for C; GCC 12 or before 
for C++) on x86_64 / i386 / powerpc / ia64.  Such backwards compatibility 
in user code is more likely to be relevant for C++ than for C, given how 
the C++ support was added to GCC much more recently.  (Note: I haven't 
checked when other compilers added support for the _Float128 name or 
associated built-in functions, whether for C or for C++, which might also 
affect when user code wants such compatibility.)

-- 
Joseph S. Myers
joseph@codesourcery.com

  reply	other threads:[~2023-08-17 15:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-15 10:39 chenxiaolong
2023-08-15 10:48 ` Xi Ruoyao
2023-08-17  6:56   ` chenxiaolong
2023-08-15 20:03 ` Joseph Myers
2023-08-16 10:08   ` chenxiaolong
2023-08-16 13:16     ` Joseph Myers
2023-08-17  3:44   ` Xi Ruoyao
2023-08-17 15:08     ` Joseph Myers [this message]
2023-08-18  6:39       ` chenxiaolong
2023-08-18  6:58         ` Xi Ruoyao
2023-08-18  7:05           ` Xi Ruoyao
2023-08-18  7:19             ` Xi Ruoyao
2023-08-18  7:52               ` chenxiaolong

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=8e88bba4-377a-93fb-6e7b-fafcf1a6f028@codesourcery.com \
    --to=joseph@codesourcery.com \
    --cc=chenglulu@loongson.cn \
    --cc=chenxiaolong@loongson.cn \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=i@xen0n.name \
    --cc=xry111@xry111.site \
    --cc=xuchenghua@loongson.cn \
    /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: link
Be 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).