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.133.124]) by sourceware.org (Postfix) with ESMTPS id 53ABC3858401 for ; Thu, 1 Sep 2022 08:20:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 53ABC3858401 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=1662020407; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=XZIKACNaOKtSWvi47HuluUyB0HPipUFbGSQ0Spc1bNY=; b=OCBZuhP+tnekFNGGJusyzVatILjXdALr1Lc2b3JPvy4tRzo6epq4usrTr8g5j+DvO6iUJW Gd1tjWZ44teBwnmLwciSCHSoSnZ/okrxcuD7zOYikYDFJqbE5cthGlBioYnAJSYZhlg9Ly OYzQm3zck9ZrGExyXwfBCGfcjXYmi2E= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-170-kpAQ1H6hNEGZhd2QTJC7CQ-1; Thu, 01 Sep 2022 04:20:04 -0400 X-MC-Unique: kpAQ1H6hNEGZhd2QTJC7CQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 90D5229AB453; Thu, 1 Sep 2022 08:20:04 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3BA9F40C141D; Thu, 1 Sep 2022 08:20:04 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 2818K0M92082411 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 1 Sep 2022 10:20:01 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 2818JxtR2082410; Thu, 1 Sep 2022 10:19:59 +0200 Date: Thu, 1 Sep 2022 10:19:59 +0200 From: Jakub Jelinek To: FX Cc: gcc@gcc.gnu.org, "Joseph S. Myers" , FX via Fortran Subject: Re: Floating-point comparisons in the middle-end Message-ID: Reply-To: Jakub Jelinek References: <8C6DDAA3-A40F-47C7-BE78-D56A3EC70C71@gmail.com> MIME-Version: 1.0 In-Reply-To: <8C6DDAA3-A40F-47C7-BE78-D56A3EC70C71@gmail.com> X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE 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: 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 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 >= SAVE_EXPR && SAVE_EXPR <= SAVE_EXPR 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