From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 4BE8738582BB for ; Mon, 10 Oct 2022 12:49:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4BE8738582BB Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665406197; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=H9xotp2tC9KJQ959W4ACZFpentrM/s8+XmGvy3DDWtI=; b=eHlXJvbPl5JEj6kn8ghqITGO5mU/CwWcIcrO5dHEvEW/hGjaKusZFCf7JqUGLwtZ8tqcxa D3TLErit5+y7/9Ka91vwzxlgzF2YIFDQ4zD3vi8xJ+huhBWhSF9Tz8qlYSKvZXbDzRne7n fbk4hY5r7R/xm47gXCSIpWx8OwKT5aI= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-249-I0WnJG7XPXqL4W8QwnLUHQ-1; Mon, 10 Oct 2022 08:49:56 -0400 X-MC-Unique: I0WnJG7XPXqL4W8QwnLUHQ-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 41372811E67 for ; Mon, 10 Oct 2022 12:49:56 +0000 (UTC) Received: from abulafia.quesejoda.com (unknown [10.39.193.126]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C62D249BB62; Mon, 10 Oct 2022 12:49:55 +0000 (UTC) Received: from abulafia.quesejoda.com (localhost [127.0.0.1]) by abulafia.quesejoda.com (8.17.1/8.17.1) with ESMTPS id 29ACnrTP154178 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 10 Oct 2022 14:49:53 +0200 Received: (from aldyh@localhost) by abulafia.quesejoda.com (8.17.1/8.17.1/Submit) id 29ACnra7154177; Mon, 10 Oct 2022 14:49:53 +0200 From: Aldy Hernandez To: GCC patches Cc: Andrew MacLeod , Aldy Hernandez Subject: [COMMITTED] x UNORD x should set NAN on the TRUE side (and !NAN on the FALSE side). Date: Mon, 10 Oct 2022 14:49:43 +0200 Message-Id: <20221010124946.154152-2-aldyh@redhat.com> In-Reply-To: <20221010124946.154152-1-aldyh@redhat.com> References: <20221010124946.154152-1-aldyh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: gcc/ChangeLog: * range-op-float.cc (foperator_unordered::op1_range): Set NAN when operands are equal and result is TRUE. --- gcc/range-op-float.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gcc/range-op-float.cc b/gcc/range-op-float.cc index 68578aa6fe7..91833d3f855 100644 --- a/gcc/range-op-float.cc +++ b/gcc/range-op-float.cc @@ -1026,23 +1026,27 @@ bool foperator_unordered::op1_range (frange &r, tree type, const irange &lhs, const frange &op2, - relation_kind) const + relation_kind rel) const { switch (get_bool_state (r, lhs, type)) { case BRS_TRUE: + if (rel == VREL_EQ) + r.set_nan (type); // Since at least one operand must be NAN, if one of them is // not, the other must be. - if (!op2.maybe_isnan ()) + else if (!op2.maybe_isnan ()) r.set_nan (type); else r.set_varying (type); break; case BRS_FALSE: + if (rel == VREL_EQ) + r.clear_nan (); // A false UNORDERED means both operands are !NAN, so it's // impossible for op2 to be a NAN. - if (op2.known_isnan ()) + else if (op2.known_isnan ()) r.set_undefined (); else { -- 2.37.3