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 DB6A83837684 for ; Thu, 17 Nov 2022 16:48:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DB6A83837684 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=1668703723; 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=ta1AETMARaxhMxyOdFPDvjOKWYvaIWEcX5reW/Mlojg=; b=g+hg1SkcHYPC9eREvPmifcbMaQ+ubOKAw0+BfbDWjjz4tWxuVSjp4Q1f3qAfWZxQ6QPUX4 pE7GnOnK/cCIB9jdT9xtjhHqe4jPOrEIdisCMVAGYaEJ4MG9mvgbPa9dmoCDczfF6zQqMQ PESTW8Rlrljl3K25EhUGKjjPI26+C7o= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-582-cLVLjV3TP02V4iTJRSJ8mg-1; Thu, 17 Nov 2022 11:48:41 -0500 X-MC-Unique: cLVLjV3TP02V4iTJRSJ8mg-1 Received: by mail-wr1-f71.google.com with SMTP id s11-20020adfbc0b000000b0023659af24a8so908481wrg.14 for ; Thu, 17 Nov 2022 08:48:41 -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:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ta1AETMARaxhMxyOdFPDvjOKWYvaIWEcX5reW/Mlojg=; b=BZJHx11YH7NyBEm/HWH9C9Bhxlwf8ykzRlmzjrrBeyq8+WiBObAPqFZppsFm07nOuO Nmgxd8bHX0s8VSLsQ9lHY4Olnm0i164wwS2DI7gUKt9DkyZVQdID0ikFz8hqr+DunNYb F/+mcx6y9PUKDs1F/BvrDKzCACCJBbR24s4oUmSHerV+nnQ9CL+JsDPlVncIAtWmswh+ WRJMf2UrxMKfChRiiTpjYc1mEu8iE6+dZDYuTmphjTCKR9e1aogKdOrDV3AmKKXVVLsC M3maC8l09waArzbBd0isIbt1RHXhhuGrJdjfSn7y8/BFLNharKq6Y5+2K3Cxj3Sh7O1Z L9Zg== X-Gm-Message-State: ANoB5pkRbZ4dzR7aubvg4/QPfrN3F0904gUm+Tg06lSwhXOIN9qRFCRf uNXJB5tClE+ShBYero8ImLPhiGN0e4qlRgGAy4QDR/h+98AL8qd82vmJHMxUK9niSBuXzdTnqAq aG0VsagWJ5sHiI7QVzQ== X-Received: by 2002:a5d:69d0:0:b0:236:6580:da06 with SMTP id s16-20020a5d69d0000000b002366580da06mr2018078wrw.627.1668703719989; Thu, 17 Nov 2022 08:48:39 -0800 (PST) X-Google-Smtp-Source: AA0mqf5CK0TMO7g5ta8Qx5wphrSq8OJ5h8TcTTGs8I2pZ82xIuLn67gOozWY5Fv2z9RlndClHROJQw== X-Received: by 2002:a5d:69d0:0:b0:236:6580:da06 with SMTP id s16-20020a5d69d0000000b002366580da06mr2018072wrw.627.1668703719773; Thu, 17 Nov 2022 08:48:39 -0800 (PST) Received: from [192.168.1.2] ([139.47.33.22]) by smtp.gmail.com with ESMTPSA id w12-20020a05600c474c00b003b435c41103sm7659810wmo.0.2022.11.17.08.48.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Nov 2022 08:48:39 -0800 (PST) Message-ID: <29dcbe58-7400-472f-ef22-d416dc18b8a3@redhat.com> Date: Thu, 17 Nov 2022 17:48:37 +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. From: Aldy Hernandez To: Jakub Jelinek Cc: Joseph Myers , GCC patches , Andrew MacLeod References: <20221113200553.440728-1-aldyh@redhat.com> <6150f7fd-5a57-c138-f65e-8dc3bf13d11a@codesourcery.com> 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=-5.0 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/17/22 17:40, Aldy Hernandez wrote: > To go along with whatever magic we're gonna tack along to the > range-ops sqrt implementation, here is another revision addressing the > VARYING issue you pointed out. > > A few things... > > Instead of going through trees, I decided to call do_mpfr_arg1 > directly. Let's not go the wide int <-> tree rat hole in this one. > > The function do_mpfr_arg1 bails on +INF, so I had to handle it manually. > > There's a regression in gfortran.dg/ieee/ieee_6.f90, which I'm not > sure how to handle. We are failing because we are calculating > sqrt(-1) and expecting certain IEEE flags set. These flags aren't > set, presumably because we folded sqrt(-1) into a NAN directly: > > // All negatives. > if (real_compare (LT_EXPR, &lh_ub, &dconst0)) > { > real_nan (&lb, "", 0, TYPE_MODE (type)); > ub = lb; > maybe_nan = true; > return; > } FWIW, we could return [-0.0, +INF] +-NAN which would keep us from eliding the sqrt, but it'd be a pity to keep the sqrt unless it's mandated by some IEEE canon. Aldy