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 9E6FA3858D39 for ; Tue, 19 Sep 2023 19:17:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9E6FA3858D39 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=1695151073; 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: in-reply-to:in-reply-to:references:references; bh=n7B67scQ8Nx1jkkilq8aEraeeE7xqNHBWZ7OVw3Hezo=; b=WW6SyQQVvrSCCaTVfInREiq6JmseuFyPtHfzO01vdmlm4bi1XnuxDm+CaF7wEVOJym0GTg aWSIKFbicwFcqbmriWHxV9Ad9/54W8Vr0MJX2vGvJZcta3W2Hso8LRvYhx5gYLcagj1TZf agoi+r/AvCIFZFO6CjvU9WcpTfMMe6U= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-645-EijTgs8SOJuPyhbuPQD3xA-1; Tue, 19 Sep 2023 15:17:52 -0400 X-MC-Unique: EijTgs8SOJuPyhbuPQD3xA-1 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-99388334de6so439054966b.0 for ; Tue, 19 Sep 2023 12:17:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695151071; x=1695755871; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=n7B67scQ8Nx1jkkilq8aEraeeE7xqNHBWZ7OVw3Hezo=; b=j57+WktmqFGkrHlJAwiPpqT6okRr3Thb+UPolLNPjUPFV0w2gDQfD0wN1YMBDDGo7o M28zvfeqgW/1hbOEPDT1Q5ETAoByNh6EieBXRaspS+b6MaEvgabSOWbzwMukZ3HRY2t+ WRB4LGFR8p3MnqRwtMIY0xAsy2nhN5wIvPoXntcKdfqC5rOnBSyecLkJ2hMUe3ZNXZj9 +mT0wRQHr9JMhprRCgNbZZkB6a23A17868cHZ/4w1JN/5W4RP0eeQJoFIwOmyjiIllHn Fj0ybCyGDZzukQfTHnEpze7QiT6RBDpV+UvKM9GmIbh4qDWI2MGe6atH0I5KK86ySJ9n MxeA== X-Gm-Message-State: AOJu0YwboaLjGkLPN/ZJ9iYi7k4XucMtYGlgs/Lb45bO+D8Gr4cpfHfO CJM/YBlxTVYR5sPGQVKZ13jLTWtIXKJespByyzH/AnVBzpvcz2qcVK8nyYSbXekeQN+SedpOEI8 WaRuSS6FJkOZl+jOXi8+JdOIl7qhf/UMk8CkEYuL0ETCMI7A= X-Received: by 2002:a17:906:25b:b0:9a1:fe9c:eee6 with SMTP id 27-20020a170906025b00b009a1fe9ceee6mr231730ejl.43.1695151070899; Tue, 19 Sep 2023 12:17:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHAmrsuOVh9TK7nPv/mkvZu2FyT44OfJD6GzEEEAkTDPQmWEqPnP5Co8ZxQp427R/4lMoehX769xihNCQ2z9GQ= X-Received: by 2002:a17:906:25b:b0:9a1:fe9c:eee6 with SMTP id 27-20020a170906025b00b009a1fe9ceee6mr231717ejl.43.1695151070563; Tue, 19 Sep 2023 12:17:50 -0700 (PDT) MIME-Version: 1.0 References: <20230823152209.351604-1-aldyh@redhat.com> In-Reply-To: From: Aldy Hernandez Date: Tue, 19 Sep 2023 15:17:39 -0400 Message-ID: Subject: Re: [PATCH] [frange] Relax floating point relational folding. To: Jakub Jelinek Cc: GCC patches , Andrew MacLeod X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/mixed; boundary="00000000000067028d0605bb1d53" X-Spam-Status: No, score=-11.5 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_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,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: --00000000000067028d0605bb1d53 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Jakub. I wasn't ignoring you, just quietly thinking, making sure we weren't missing anything. In the process I cleaned everything, which hopefully makes it easier to see why we don't need relationals (the key is to look at frelop_early_resolve() and the op1/op2_range entries which clear the NAN bits). I am committing the patch below, and as I say in it: I don't mean this patch as a hard-no against implementing the unordered relations Jakub preferred, but seeing that it's looking cleaner and trivially simple without the added burden of more enums, I'd like to flesh it out completely and then discuss if we still think new codes are needed. At least now we have tests :). Please let me know if you have any test cases you think we may be missing. FYI, I'm still not done with the unordered folders. Tested on x86-64 Linux. Committed. Aldy On Mon, Aug 28, 2023 at 3:01=E2=80=AFAM Jakub Jelinek wr= ote: > > On Wed, Aug 23, 2023 at 05:22:00PM +0200, Aldy Hernandez via Gcc-patches = wrote: > > BTW, we batted some ideas on how to get this work, and it seems this > > is the cleaner route with the special cases nestled in the operators > > themselves. Another idea is to add unordered relations, but that > > would require bloating the various tables adding spots for VREL_UNEQ, > > VREL_UNLT, etc, plus adding relations for VREL_UNORDERED so the > > intersects work correctly. I'm not wed to either one, and we can > > certainly revisit this if it becomes burdensome to maintain (or to get > > right). > > My strong preference would be to have the full set of operations, > i.e. VREL_LTGT, VREL_{,UN}ORDERED, VREL_UN{LT,LE,GT,GE,EQ}, then everythi= ng > will fall out of this cleanly, not just some common special cases, but > also unions of them, intersections etc. > The only important question is if you want to differentiate VREL_* > for floating point comparisions with possible NANs vs. other comparisons > in the callers, then one needs effectively e.g. 2 sets of rr_* tables > in value-relation.cc and what exactly say VREL_EQ inverts to etc. is then > dependent on the context (this is what we do at the tree level normally, > e.g. fold-const.cc (invert_tree_comparison) has honor_nans argument), > or whether it would be a completely new set of value relations, so > even for EQ/NE etc. one would use VRELF_ or something similar. > > Jakub > --00000000000067028d0605bb1d53 Content-Type: text/x-patch; charset="US-ASCII"; name="0001-frange-Clean-up-floating-point-relational-folding.patch" Content-Disposition: attachment; filename="0001-frange-Clean-up-floating-point-relational-folding.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_lmqozbtd0 RnJvbSAyMjBhNThkOWFiYmIxZjQwM2U4Zjc5Y2Q0MmFkMDFiN2M5YjEwYWU5IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBBbGR5IEhlcm5hbmRleiA8YWxkeWhAcmVkaGF0LmNvbT4KRGF0 ZTogTW9uLCAxOCBTZXAgMjAyMyAyMTo0MTowOCAtMDQwMApTdWJqZWN0OiBbUEFUQ0hdIFtmcmFu Z2VdIENsZWFuIHVwIGZsb2F0aW5nIHBvaW50IHJlbGF0aW9uYWwgZm9sZGluZy4KClRoZSBmb2xs b3dpbmcgcGF0Y2ggcmVtb3ZlcyBhbGwgdGhlIHNwZWNpYWwgY2FzaW5nIGZyb20gdGhlIGZsb2F0 aW5nCnBvaW50IHJlbGF0aW9uYWwgZm9sZGluZyBjb2RlLiAgTm93IGFsbCB0aGUgY29kZSByZWxh dGluZyB0byBmb2xkaW5nCm9mIHJlbGF0aW9uYWxzIGlzIGluIGZyZWxvcF9lYXJseV9yZXNvbHZl KCkgYW5kIGluCm9wZXJhdG9yX25vdF9lcXVhbDo6Zm9sZF9yYW5nZSgpIHdoaWNoIHJlcXVpcmVz IGEgc21hbGwgdHdlYWsuCgpJIGhhdmUgd3JpdHRlbiBuZXcgcmVsYXRpb25h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