From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by sourceware.org (Postfix) with ESMTPS id 14D1E384F490 for ; Fri, 18 Nov 2022 12:14:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 14D1E384F490 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-x630.google.com with SMTP id gv23so12609814ejb.3 for ; Fri, 18 Nov 2022 04:14:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:from:to:cc:subject:date:message-id :reply-to; bh=re50b/RPPGV3ckXklTcZ1Tz/zYSMcSmXoHiWnP1oSaA=; b=Vx3Iixn2TH3cniT7GlQ7PaergaWuGpePy/iEaNZJ3Tm3DIYbA6Xbx+JGMCyA8hAtq4 JhdL4hNeIRlSCQKMlNqH6VBRfjSK03cb6yQKfonyqJ05+LGAT/sAWS5niGvCow4hd8nT 86Ap2PQNfuaI2MYmHV4fMh5tZcsiN5nHaeyGW2+tItdtJIudbHJ4YxdsavqIm45bjIJ7 K01qTt4kowJ889cTy4yvjnXQw0E7L++Dur09a0/O4+Hn2ZfMnFAW8Hqn5HFxCZv2suzY r1FVVA5ffRdGjjObFeV903+wMK1IsqsT5h3tQQIOuFs7owR/o95nAgsjv3RH1ow7ywKi bbOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=re50b/RPPGV3ckXklTcZ1Tz/zYSMcSmXoHiWnP1oSaA=; b=l/yjZt7BXjYouMLG1YC5j5g8sHASKTk33npxyMaHGBMWzuXFTrCZnQIaT247rjUeGO MLt583an+sEoyQZP2B2fem1EaCBtSLExIvZ9yl1cUDNU2lPa8kfgMeDLz6qoQRKqL05m We+UWHMMCa9lBGyTsONIf5ZqWEQUM/KvBQ4U5HY3Eit2aQLQUY/Z6l+HOBPbkP5d1WU8 SgUWFd3JiTNirH4+yLZQugea22jybr2EbXUSdM/BG+X/nzGxk/IIBApLECOimsJIao0r skUOnuUfzGiGny4aihOZIhmSBoQByzKTtwGl3NYSjJwNjZj3Dq3/M2Cd3UhEnzLnt09d xiMQ== X-Gm-Message-State: ANoB5pmjnhk30r9jqAqGYaaE7PL7b09ccyRSiN4hLUr+HDvBpOBvkqKG YsJKhyAmvKeI1D9U++Dx+8A= X-Google-Smtp-Source: AA0mqf7nbZTIxj+FvKFxtW0RueLgoSt6DOHyhZZ0OZkR/GRl5WXcStuRhC0x7W76lTUuiD+rxnAk/w== X-Received: by 2002:a17:906:8613:b0:7a6:a48b:5e2a with SMTP id o19-20020a170906861300b007a6a48b5e2amr5656818ejx.338.1668773670615; Fri, 18 Nov 2022 04:14:30 -0800 (PST) Received: from smtpclient.apple (dynamic-092-225-231-214.92.225.pool.telefonica.de. [92.225.231.214]) by smtp.gmail.com with ESMTPSA id g18-20020a1709064e5200b0079800b8173asm1603086ejw.158.2022.11.18.04.14.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 18 Nov 2022 04:14:29 -0800 (PST) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Richard Biener Mime-Version: 1.0 (1.0) Subject: Re: [PATCH] [range-ops] Implement sqrt. Date: Fri, 18 Nov 2022 13:14:19 +0100 Message-Id: <81052E72-77B1-4381-A9A2-081F55DCEA5A@gmail.com> References: Cc: Aldy Hernandez , Joseph Myers , GCC patches , Andrew MacLeod In-Reply-To: To: Jakub Jelinek X-Mailer: iPhone Mail (20B101) X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_BARRACUDACENTRAL,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > Am 18.11.2022 um 11:44 schrieb Jakub Jelinek : >=20 > =EF=BB=BFOn Fri, Nov 18, 2022 at 11:37:42AM +0100, Aldy Hernandez wrote: >>> Practically strictly >>> preserving IEEE exceptions is only important for a very small audience, a= nd >>> for that even INEXACT will matter (but we still have -ftrapping-math >>> by default). >>> For that audience likely all constant / range propagation is futile and t= hus the >>> easiest thing might be to simply cut that off completely? >>>=20 >>> I'd say what ranger does is reasonable with -ftrapping-math given the cu= rrent >>> practice of handling this option. There's no point in trying to preserv= e the >>> (by accident) "better" handling without ranger. Instead as Joseph says s= omebody >>> would need to sit down, split -ftrapping-math, adjust the default and th= orougly >>> document things (also with -fnon-call-exceptions which magically makes >>> IEEE flag raising operations possibly throw exceptions). As there's cur= rently >>> no code motion barriers for FP code with respect to exception flag inspe= ction >>> any dead code we preserve is likely going to be unhelpful. >>>=20 >>> So for now simply amend the documentation as to what -ftrapping-math >>> currently means with respect to range/constant propagation? >>=20 >> So something like "Even in the presence of -ftrapping-math, VRP may fold >> operations that may cause exceptions For example, an addition that is >> guaranteed to produce a NAN, may be replaced with a NAN, thus eliding the= >> addition. This may cause any exception that may have been generated by t= he >> addition to not appear in the final program." >>=20 >> ?? >=20 > If we just adjust user expectations for -ftrapping-math, shouldn't we > introduce another option that will make sure we never optimize away floati= ng > point operations which can trap (and probably just disable frange for that= > mode)? I think it=E2=80=99s just like -frounding-math and Fenv access - the intent i= s there but the implementation is known buggy (and disabling optimizations d= oesn=E2=80=99t fully fix it). Richard=20 > Jakub >=20