public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Floating-point comparisons in the middle-end
@ 2022-09-01  8:04 FX
  2022-09-01  8:19 ` Jakub Jelinek
  2022-09-01 15:19 ` Joseph Myers
  0 siblings, 2 replies; 17+ messages in thread
From: FX @ 2022-09-01  8:04 UTC (permalink / raw)
  To: gcc; +Cc: Jakub Jelinek, Joseph S. Myers, FX via Fortran

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

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2022-09-01 19:16 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-01  8:04 Floating-point comparisons in the middle-end FX
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

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).