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 CF84C3858C83 for ; Mon, 7 Nov 2022 15:41:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CF84C3858C83 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=1667835697; 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=tLIIQnL3xjQoklK9Decm8qOiwUSbwqPlgMdw6a/di9o=; b=Avz8eVjTqO2rFtb0gVc0c/JlF6kR8FREozlGIsyj9POeG8b3YHjtQMsz7HO/w/X293RjrV tUrvgdurqqEe7vrPmzSoZxyCsrQUwFkN/aPadyOJsHXTyF3AhWooCCD/v0/BS/g3cnQvjN +/Jz1PZb8Po9BfQRQGtwP4Jv7dcMyhg= Received: from mail-yb1-f197.google.com (mail-yb1-f197.google.com [209.85.219.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-267-Df1HqITQPGS_TWeLr9FBYw-1; Mon, 07 Nov 2022 10:41:35 -0500 X-MC-Unique: Df1HqITQPGS_TWeLr9FBYw-1 Received: by mail-yb1-f197.google.com with SMTP id e8-20020a5b0cc8000000b006bca0fa3ab6so11516426ybr.0 for ; Mon, 07 Nov 2022 07:41:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=tLIIQnL3xjQoklK9Decm8qOiwUSbwqPlgMdw6a/di9o=; b=gChbbopQ8tpbDYgjbh3cEwfgEWfXAOwhTKt0u8PIOvBdK3ULPgxUGS0SA4YUIlgxkh lOWlaWeLa+/oqTny1T2mmAXkYQf9hYgK4uBJWk57JVLnu1MikQGmldd1q+/N/MNhkXbv A1r1/XvSjwHE/jXs0e6OCz6xrBA+Szylcl2cIj7RlpItSbY5A1E3D1yGIbVSBpI0OXcm pC4vtzGThHoFfWSY3tw/Wgw1Uzny8AgfX2eAeecimNyDhE8uEHBbA8+b523pAyTPrIf+ nh8lbA9RmBAh+Lbl/1Vdx9hisDHr1kZbaweOKNWxc7Mb67GtY9wHGAJ9PzWMddHrsf+B qU2w== X-Gm-Message-State: ACrzQf2MxjtKwTien0ISXZIR69js8MIlPO8yJ1WfW5HJLfk/5h+wEZ69 5+0i9yA4UsanvvWxpaDpnka6qGaTNkJCE7OLP96FOtviIGr/Jh+f3e+71rIghUYoVgvA7nOFsI/ Ik9av0xvfTSH7Z7WUbkppidinkIGzpnzxNw== X-Received: by 2002:a0d:cdc2:0:b0:34d:101b:53c with SMTP id p185-20020a0dcdc2000000b0034d101b053cmr49613034ywd.444.1667835694429; Mon, 07 Nov 2022 07:41:34 -0800 (PST) X-Google-Smtp-Source: AMsMyM76MS3BxCVmLTgV4w+2+rhbtxXTJ+O4fQ3rNgzqp+FPE1YqqnBgSjBrCL9bnnEv5DLGfwhQTqOYvnh0IT5lcSs= X-Received: by 2002:a0d:cdc2:0:b0:34d:101b:53c with SMTP id p185-20020a0dcdc2000000b0034d101b053cmr49613012ywd.444.1667835694140; Mon, 07 Nov 2022 07:41:34 -0800 (PST) MIME-Version: 1.0 References: <20221013123649.474497-1-aldyh@redhat.com> In-Reply-To: From: Aldy Hernandez Date: Mon, 7 Nov 2022 16:41:23 +0100 Message-ID: Subject: Re: [PATCH] [PR24021] Implement PLUS_EXPR range-op entry for floats. To: Jakub Jelinek Cc: GCC patches , Andrew MacLeod X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/mixed; boundary="00000000000018386705ece3426b" 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_H2,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: --00000000000018386705ece3426b Content-Type: text/plain; charset="UTF-8" On Fri, Nov 4, 2022 at 8:14 PM Jakub Jelinek wrote: > > On Mon, Oct 17, 2022 at 08:21:01AM +0200, Aldy Hernandez wrote: > > +// Set VALUE to its next real value, or INF if the operation overflows. > > + > > +inline void > > +frange_nextafter (enum machine_mode mode, > > + REAL_VALUE_TYPE &value, > > + const REAL_VALUE_TYPE &inf) > > +{ > > + const real_format *fmt = REAL_MODE_FORMAT (mode); > > + REAL_VALUE_TYPE tmp; > > + bool overflow = real_nextafter (&tmp, fmt, &value, &inf); > > + if (overflow) > > + value = inf; > > + else > > + value = tmp; > > Please change the above 5 lines to just > real_nextafter (&tmp, fmt, &value, &inf); > value = tmp; Done. As suggested upthread, I have also adjusted update_nan_sign() to drop the NAN sign to VARYING if both operands are NAN. As an optimization I keep the sign if both operands are NAN and have the same sign. How's this? Tested on x86-64 Linux. LAPACK testing as well. Aldy --00000000000018386705ece3426b Content-Type: text/x-patch; charset="US-ASCII"; name="0002-PR24021-Implement-PLUS_EXPR-range-op-entry-for-float.patch" Content-Disposition: attachment; filename="0002-PR24021-Implement-PLUS_EXPR-range-op-entry-for-float.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_la6ya6ib0 RnJvbSA3NzE3YWQ1YzQ5NTkzNGZmMjhlYTJhYmQ2MzlhYjRkOTFiN2ZmY2FiIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQp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cCAoc2lnbjEpKTsKKyAgaWYgKG9wMV9uYW4gJiYgb3AyX25hbikKKyAgICB7CisgICAgICAvLyBJ ZiBib3RoIHNpZ25zIGFncmVlLCB1c2UgdGhhdC4gIE90aGVyd2lzZSBrZWVwIHNpZ24gVkFSWUlO Ry4KKyAgICAgIGlmIChvcDEubmFuX3NpZ25iaXRfcCAoc2lnbjEpICYmIG9wMi5uYW5fc2lnbmJp dF9wIChzaWduMikKKwkgICYmIHNpZ24xID09IHNpZ24yKQorCXIudXBkYXRlX25hbiAoc2lnbjEp OworICAgIH0KKyAgZWxzZSBpZiAob3AxX25hbikKKyAgICB7CisgICAgICBpZiAob3AxLm5hbl9z aWduYml0X3AgKHNpZ24xKSkKKwlyLnVwZGF0ZV9uYW4gKHNpZ24xKTsKKyAgICB9CisgIGVsc2Ug aWYgKG9wMl9uYW4pCisgICAgeworICAgICAgaWYgKG9wMi5uYW5fc2lnbmJpdF9wIChzaWduMikp CisJci51cGRhdGVfbmFuIChzaWduMik7CisgICAgfQorfQorCisvLyBJZiBlaXRoZXIgb3BlcmFu ZCBpcyBhIE5BTiwgc2V0IFIgdG8gdGhlIGNvbWJpbmF0aW9uIG9mIGJvdGggTkFOcworLy8gc2ln bndpc2UgYW5kIHJldHVybiBUUlVFLgorCitpbmxpbmUgYm9vbAorcHJvcGFnYXRlX25hbnMgKGZy YW5nZSAmciwgY29uc3QgZnJhbmdlICZvcDEsIGNvbnN0IGZyYW5nZSAmb3AyKQoreworICBpZiAo b3AxLmtub3duX2lzbmFuICgpIHx8IG9wMi5rbm93bl9pc25hbiAoKSkKKyAgICB7CisgICAgICBy LnNldF9uYW4gKG9wMS50eXBlICgpKTsKKyAgICAgIHVwZGF0ZV9uYW5fc2lnbiAociwgb3AxLCBv cDIpOworICAgICAgcmV0dXJuIHRydWU7CisgICAgfQorICByZXR1cm4gZmFsc2U7Cit9CisKKy8v IFNldCBWQUxVRSB0byBpdHMgbmV4dCByZWFsIHZhbHVlLCBvciBJTkYga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