public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: chenxiaolong <chenxiaolong@loongson.cn>
To: Joseph Myers <joseph@codesourcery.com>
Cc: gcc-patches@gcc.gnu.org, xry111@xry111.site, i@xen0n.name,
	 xuchenghua@loongson.cn, chenglulu@loongson.cn
Subject: Re: [PATCH v3] LoongArch:Implement 128-bit floating point functions in gcc.
Date: Wed, 16 Aug 2023 18:08:57 +0800	[thread overview]
Message-ID: <d75ca4a887abb545a9548a8189a8267bc2145912.camel@loongson.cn> (raw)
In-Reply-To: <4a405457-2c5b-9a2f-fdfe-686ad9c7e956@codesourcery.com>

Thanks for the tip! Similar functions (e.g. __builtin_fabsf128
(_Float128 a) are already supported by the compiler and can be handled
correctly, but functions that can be implemented on the LoongArch
architecture directly using the "bstrins" directive (e.g. fabsq,
copysignq, etc.) are better optimized because they generate fewer
assembly instructions. copysignq, etc.) on the LoongArch architecture
are better optimized because they generate fewer assembly instructions.

Translated with www.DeepL.com/Translator (free version)

在 2023-08-15二的 20:03 +0000,Joseph Myers写道:
> On Tue, 15 Aug 2023, chenxiaolong wrote:
> 
> > 	In the implementation process, the "q" suffix function is
> >         Re-register and associate the "__float128" type with the
> >         "long double" type so that the compiler can handle the
> >         corresponding function correctly. The functions implemented
> >         include __builtin_{huge_valq infq, fabsq, copysignq,
> > nanq,nansq}.
> >         On the LoongArch architecture, __builtin_{fabsq,copysignq}
> > can
> >         be implemented with the instruction "bstrins.d", so that
> > its
> >         optimization effect reaches the optimal value.
> 
> Why?  If long double has binary128 format, you shouldn't need any of
> these 
> functions at all; if it doesn't, just the C23 _Float128 type name and
> f128 
> constant suffix, and associated built-in functions defined in 
> builtins.def, should suffice (and since we now have _FloatN support
> for 
> C++, C++ no longer provides a reason for adding __float128 either).  
> __float128 is a legacy type name and feature and shouldn't be needed
> on 
> any new architectures, which can just use the standard type name from
> the 
> start.
> 


  reply	other threads:[~2023-08-16 10:09 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 [this message]
2023-08-16 13:16     ` Joseph Myers
2023-08-17  3:44   ` Xi Ruoyao
2023-08-17 15:08     ` Joseph Myers
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=d75ca4a887abb545a9548a8189a8267bc2145912.camel@loongson.cn \
    --to=chenxiaolong@loongson.cn \
    --cc=chenglulu@loongson.cn \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=i@xen0n.name \
    --cc=joseph@codesourcery.com \
    --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).