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 B1ECD3851891 for ; Fri, 18 Nov 2022 11:20:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B1ECD3851891 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=1668770430; 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=TevP3SmZXW0oNjjCT5rQuUPfTNZC34cGvIiu71naN5M=; b=J1b0fwcVz8qEy9Rf7wmJnKdlhdgQmN6lwUXSKuvnGNSc5dbWONH9MW3u0XnB+pS+Xulkjf 1bZDa3X0VNbdLA4W0C8LwIRjDAduxiZlf6h0OGhpW71uthO/KEsdlFaRb1kPnNLcWsOMKX K1mDT/jLrLMtrgDWji08s6STNrRtoAs= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-494-ZePP-ndlOaOu_UjANi45vg-1; Fri, 18 Nov 2022 06:20:29 -0500 X-MC-Unique: ZePP-ndlOaOu_UjANi45vg-1 Received: by mail-wm1-f72.google.com with SMTP id bi19-20020a05600c3d9300b003cf9d6c4016so4306233wmb.8 for ; Fri, 18 Nov 2022 03:20:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=TevP3SmZXW0oNjjCT5rQuUPfTNZC34cGvIiu71naN5M=; b=22cMyv4RO5GO+ztXuLl5G6wDrITvCt/Y8K4FmE4vC4+bf2N8fUKwHcp+VAIKB+okLX W830YVv+OGTzuL5pvZQeWEHyOeTH6FpGPPT8avig4535NQVJNu3/M35qdSwHtWq1gmd9 +hCRSaMJSiLSWW/VaOoRO+Qh+RKbPThDaHZ0Sq1Tv3D2cFFQbpd/bCh2dlijjCZBJ7Yr NHbaz4ewrjr4q637zsOD1wI4/E/Mz4BMGHaiRIgGrGBhETwInqcoi1KvPZlttlvPn4WU CmLT1QJFK8HtXe8lUqm5umn5JewVDbiWdt/NATe5yQzt5TUpsdJTpdemPSKFzvDAll7K xX3A== X-Gm-Message-State: ANoB5pmRqAKgVYlqhF67yHBVRFA9sIMIgCFw9B0SS7y5kQeST+ot0aR8 Peq1JShSJ4xFIa1ubLaCLbd+XwPeZKRAJc8WaqxzSI7U7mk3NaiuR0dKqLQsO0E5ufmjCZ1xdao FBhgQA8TQhKgSX7Akyg== X-Received: by 2002:adf:f843:0:b0:241:bcae:987f with SMTP id d3-20020adff843000000b00241bcae987fmr2960650wrq.619.1668770427985; Fri, 18 Nov 2022 03:20:27 -0800 (PST) X-Google-Smtp-Source: AA0mqf5x+zgvm3EXRbT0PFmMlOORIFYL4CSvH8+E5pZIOdEQSGRT851SsBNhL1tn3+JhWy2ZehaeUg== X-Received: by 2002:adf:f843:0:b0:241:bcae:987f with SMTP id d3-20020adff843000000b00241bcae987fmr2960637wrq.619.1668770427744; Fri, 18 Nov 2022 03:20:27 -0800 (PST) Received: from [192.168.1.2] ([139.47.33.22]) by smtp.gmail.com with ESMTPSA id t13-20020a05600c198d00b003cf75f56105sm5440666wmq.41.2022.11.18.03.20.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 18 Nov 2022 03:20:26 -0800 (PST) Message-ID: <80f2ee68-8ec9-b3d8-82ea-88a1f12421e7@redhat.com> Date: Fri, 18 Nov 2022 12:20:25 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: [PATCH] [range-ops] Implement sqrt. To: Jakub Jelinek Cc: Richard Biener , Joseph Myers , GCC patches , Andrew MacLeod References: <20221113200553.440728-1-aldyh@redhat.com> <6150f7fd-5a57-c138-f65e-8dc3bf13d11a@codesourcery.com> <4441fc8a-e9e1-6fdd-20d1-473d10122426@codesourcery.com> From: Aldy Hernandez In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,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: On 11/18/22 11:44, Jakub Jelinek wrote: > On 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, and >>> 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 thus the >>> easiest thing might be to simply cut that off completely? >>> >>> I'd say what ranger does is reasonable with -ftrapping-math given the current >>> practice of handling this option. There's no point in trying to preserve the >>> (by accident) "better" handling without ranger. Instead as Joseph says somebody >>> would need to sit down, split -ftrapping-math, adjust the default and thorougly >>> document things (also with -fnon-call-exceptions which magically makes >>> IEEE flag raising operations possibly throw exceptions). As there's currently >>> no code motion barriers for FP code with respect to exception flag inspection >>> any dead code we preserve is likely going to be unhelpful. >>> >>> So for now simply amend the documentation as to what -ftrapping-math >>> currently means with respect to range/constant propagation? >> >> 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 the >> addition to not appear in the final program." >> >> ?? > > If we just adjust user expectations for -ftrapping-math, shouldn't we > introduce another option that will make sure we never optimize away floating > point operations which can trap (and probably just disable frange for that > mode)? That seems like a big hammer, but sure. We could change frange::supports_p() to return false for flag_severely_limiting_option :). Aldy