On Thu, Sep 01, 2022 at 10:04:58AM +0200, FX wrote:
> 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?

IMHO until that one is implemented you can just use
tx = x, ty = y, tx>=ty && tx<=ty
(in GENERIC just SAVE_EXPR<x> >= SAVE_EXPR<y> && SAVE_EXPR<x> <= SAVE_EXPR<y>
PowerPC backend is still broken, not just for that but for most other cases
above, it doesn't violate just Fortran requirements, but C too.

        Jakub

Reply via email to