From: FX <fxcoudert@gmail.com>
To: gcc@gcc.gnu.org
Cc: Jakub Jelinek <jakub@redhat.com>,
"Joseph S. Myers" <joseph@codesourcery.com>,
FX via Fortran <fortran@gcc.gnu.org>
Subject: Floating-point comparisons in the middle-end
Date: Thu, 1 Sep 2022 10:04:58 +0200 [thread overview]
Message-ID: <8C6DDAA3-A40F-47C7-BE78-D56A3EC70C71@gmail.com> (raw)
Hi,
Fortran 2018 introduced intrinsic functions for all the IEEE-754 comparison operations, compareQuiet* and compareSignaling* I want to introduce those into the Fortran front-end, and make them emit the right code. But cannot find the correspondance between IEEE-754 nomenclature and GCC internal representation.
I understand that the middle-end representation was mostly created with C in mind, so I assume that the correspondance is that used by the C standard. That helps me to some extent, as I can find draft documents that seem to list the following table (page 8 of https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1615.pdf):
compareQuietEqual ==
compareQuietNotEqual !=
compareSignalingEqual iseqsig
compareSignalingGreater >
compareSignalingGreaterEqual >=
compareSignalingLess <
compareSignalingLessEqual <=
compareSignalingNotEqual !iseqsig
compareSignalingNotGreater !(x>y)
compareSignalingLessUnordered !(x=>y)
compareSignalingNotLess !(x<y)
compareSignalingGreaterUnorder !(x<=y)
compareQuietGreater isgreater
compareQuietGreaterEqual isgreaterequal
compareQuietLess isless
compareQuietLessEqual islessequal
compareQuietUnordered isunordered
compareQuietNotGreater !isgreater
compareQuietLessUnordered !isgreaterequal
compareQuietNotLess !isless
compareQuietGreaterUnordered !islessequal
compareQuietOrdered !isunordered
I have two questions:
1. Is this list normative, and was it modified later (I have only found a 2012 draft)?
2. All the functions are available as GCC type-generic built-ins (yeah!), except there is no __builtin_ iseqsig (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77928). Is there a fundamental problem with creating one, and could someone help there?
Thanks,
FX
next reply other threads:[~2022-09-01 8:05 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-01 8:04 FX [this message]
2022-09-01 8:19 ` Jakub Jelinek
2022-09-01 9:04 ` FX
2022-09-01 9:23 ` Jakub Jelinek
2022-09-01 10:06 ` FX
2022-09-01 15:21 ` Joseph Myers
2022-09-01 15:57 ` Marc Glisse
2022-09-01 16:22 ` Joseph Myers
2022-09-01 16:24 ` FX
2022-09-01 16:44 ` Joseph Myers
2022-09-01 18:15 ` FX
2022-09-01 14:32 ` Segher Boessenkool
2022-09-01 15:19 ` Joseph Myers
2022-09-01 18:38 ` FX
2022-09-01 19:13 ` Joseph Myers
2022-09-01 18:47 ` FX
2022-09-01 19:16 ` 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=8C6DDAA3-A40F-47C7-BE78-D56A3EC70C71@gmail.com \
--to=fxcoudert@gmail.com \
--cc=fortran@gcc.gnu.org \
--cc=gcc@gcc.gnu.org \
--cc=jakub@redhat.com \
--cc=joseph@codesourcery.com \
/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).