public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Mikael Morin <morin-mikael@orange.fr>
Cc: Harald Anlauf <anlauf@gmx.de>,
	gcc-patches@gcc.gnu.org,
	"Joseph S. Myers" <joseph@codesourcery.com>,
	fortran@gcc.gnu.org
Subject: Re: [PATCH] fortran, libgfortran, v2: Avoid using libquadmath for glibc 2.26+
Date: Mon, 27 Jun 2022 09:54:13 +0200	[thread overview]
Message-ID: <YrliJXK79C/R2TSo@tucnak> (raw)
In-Reply-To: <70657edb-4055-e183-7e09-5e1321beb7f5@orange.fr>

On Sun, Jun 26, 2022 at 08:45:28PM +0200, Mikael Morin wrote:
> I don’t like the _Float128 vs __float128 business, it’s confusing.
> And accordinog to https://gcc.gnu.org/onlinedocs/gcc/Floating-Types.html
> they seem to be basically the same thing, so it’s also redundant.

I thought __float128 and _Float128 are distinct and incompatible in the FEs
and equivalent in middle-end and back-end, but apparently they are
considered equivalent even for _Generic.
Still, using __float128 when the APIs are declared for __float128 and
_Float128 when the APIs are declared for _Float128 can be better for
consistency.

But if you feel strongly that we should use _Float128 and F128/f128
suffixes on floating point constants everywhere, we'd need more work
(e.g. because we use those same suffixes also for the functions where
we need to differentiate, or on macros like M_PI etc. where it is
significant too), and we'd need to come up with new macros to differentiate
which API set to use.
In the patch I've posted,
HAVE_FLOAT128 and GFC_REAL_16_IS_FLOAT128 defines stand for
__float128 + libquadmath APIs,
HAVE__FLOAT128 and GFC_REAL_16_IS__FLOAT128 stand for
_Float128 and C *f128 APIs.
If HAVE_FLOAT128 and GFC_REAL_16_IS_FLOAT128 stand for
_Float128 and libquadmath or *f128 APIs, we'd need some macro
to tell which APIs to use, say
USE_LIBQUADMATH and USE_IEC_60559.
And the hardest part would be that we that GFC_REAL_{16,17}_LITERAL{,_SUFFIX}
is currently used everywhere while for library APIs and M_* constants
we need to differentiate.  Perhaps we could just use *q suffixes even when
using _Float128 when USE_LIBQUADMATH.

	Jakub


  reply	other threads:[~2022-06-27  7:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-23 12:04 [PATCH] fortran, libgfortran: " Jakub Jelinek
2022-06-23 20:49 ` Harald Anlauf
2022-06-23 21:17   ` Jakub Jelinek
2022-06-24 10:29     ` [PATCH] fortran, libgfortran, v2: " Jakub Jelinek
2022-06-24 21:06       ` Harald Anlauf
2022-06-26 18:45       ` Mikael Morin
2022-06-27  7:54         ` Jakub Jelinek [this message]
2022-06-27 11:56           ` Mikael Morin
2022-06-27 13:30             ` [PATCH] fortran, libgfortran, v3: " Jakub Jelinek
2022-06-28  7:01               ` Jakub Jelinek
2022-06-28  8:35               ` Tobias Burnus
2022-06-28 10:57                 ` Jakub Jelinek
2022-06-27 20:54           ` [PATCH] fortran, libgfortran, v2: " Joseph Myers

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=YrliJXK79C/R2TSo@tucnak \
    --to=jakub@redhat.com \
    --cc=anlauf@gmx.de \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=joseph@codesourcery.com \
    --cc=morin-mikael@orange.fr \
    /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).