This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/8] Document signaling for min, max and ltgt operations


> Am 20.08.2019 um 17:50 schrieb Segher Boessenkool <segher@kernel.crashing.org>:
> 
> On Tue, Aug 20, 2019 at 11:18:38AM +0200, Ilya Leoshkevich wrote:
>> Currently it's not clear whether or not min, max and ltgt should raise
>> floating point exceptions when dealing with qNaNs.
>> 
>> Right now a lot of code assumes that LTGT is signaling: in particular,
>> it's generated for ((x < y) || (x > y)), which is signaling. The
>> behavior of MIN/MAX is (intentionally?) left unspecified, according to
>> commit 64dd117734d0 ("Unconditionally use MAX_EXPR/MIN_EXPR for MAX/MIN
>> intrinsics").
> 
> Btw, this is not the difference between LTGT and NE, which is exactly
> the same difference as that between LT and UNLT: if NaNs are allowed,
> the first is false for unordered, while the second is true.  If NaNs
> are not allowed, only one of the two is generated.
> 
> (0    UNORD)
> LT    UNLT
> EQ    UNEQ
> LE    UNLE
> GT    UNGT
> LTGT  NE
> GE    UNGE
> (ORD  1)

This matches my understanding (modulo signaling). cThis also doesn't
contradict the proposed manual update, right?

> There is currently no way to say (in trees or gimple or rtl) whether
> comparisons are signaling ("ordered", generate a trap on an unordered
> result).  I am working on this, but :-)

Isn't there?  This whole series is based on the following assumption:
LT, LE, GT, GE are definitely signaling; LTGT is most likely signaling
as well; the rest are not signaling.  This is based on gccint 11.6.3:
Unary and Binary Expressions.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]