From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) by sourceware.org (Postfix) with ESMTPS id 9130E396E848 for ; Wed, 2 Jun 2021 19:12:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9130E396E848 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rtems.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-f46.google.com with SMTP id r198so1673679lff.11 for ; Wed, 02 Jun 2021 12:12:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=r2W6cfGlMYTzyGjpmb+CzhIkI+o6TFS8KjhqEKc8ZEw=; b=clqjW7QHkA031fW5eWnjrBKXNZkNJWO3kkUK7bx4eu/ANvNmgRH2d7uA+3G1jwS+el Vzyu+4QTxLI1OmEaNk6Oby3RS5QL1DOq1NRi7ia05/ZuMTMYFIwTI2i784bYnwGeRsC/ lWFYOo3HWx6Omv/7D6gmHv2kCHuwfDapqZdnu2sKwpvA8mA6de6i3ymEq4izkwKqxK2V /osr9rtauHdA1ghsoaoiV3hmRnKKaABTBA6kuErXzGPAxVKPkfQVR4iDbei8+jj+hd5C Oajq/RJqhohA7ww7dFGRJAVg3u5T0qIx/hdwwNpYvnXv44QDbPhk4skfV+kX4gVxyQ/s Pi0Q== X-Gm-Message-State: AOAM531RHR501+tYAWqOqbWZDFaw2tP1EEAQixYOWkNxwerSAmXzUP/D n78qe/J/G20neUoNWucMIKlqzixClt3I5g== X-Google-Smtp-Source: ABdhPJyLj3/ptdfMR2WYRc495TQ2iAquYcaaRLjCi4sWB92pvzLTQqvodrvHUj5uWn1gr+6tJmiWbA== X-Received: by 2002:ac2:5d6b:: with SMTP id h11mr24136378lft.246.1622661140874; Wed, 02 Jun 2021 12:12:20 -0700 (PDT) Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com. [209.85.167.52]) by smtp.gmail.com with ESMTPSA id u27sm73848lfo.167.2021.06.02.12.12.20 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Jun 2021 12:12:20 -0700 (PDT) Received: by mail-lf1-f52.google.com with SMTP id r198so1673636lff.11 for ; Wed, 02 Jun 2021 12:12:20 -0700 (PDT) X-Received: by 2002:a19:5e0d:: with SMTP id s13mr23363121lfb.229.1622661140468; Wed, 02 Jun 2021 12:12:20 -0700 (PDT) MIME-Version: 1.0 References: <2f8796f4-f164-5734-16ca-9a392e788beb@gmail.com> In-Reply-To: <2f8796f4-f164-5734-16ca-9a392e788beb@gmail.com> Reply-To: joel@rtems.org From: Joel Sherrill Date: Wed, 2 Jun 2021 14:12:09 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: incorrectly rounded square root To: Marco Atzeri Cc: Newlib X-Spam-Status: No, score=-3031.9 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, HTML_MESSAGE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2021 19:12:24 -0000 On Wed, Jun 2, 2021, 2:08 PM Marco Atzeri wrote: > On 02.06.2021 20:43, Jeff Johnston wrote: > > On Wed, Jun 2, 2021 at 9:08 AM Joel Sherrill wrote: > > > >> > >> > >> On Wed, Jun 2, 2021 at 2:51 AM Paul Zimmermann < > Paul.Zimmermann@inria.fr> > >> wrote: > >> > > >> > > I'll second Joel's comment. The code is extremely close to the glibc > code > > both in sqrtf and fesetround. The only > > thing I can think of is that the glibc code does the x87 stuff first and > > does the set back into FPU state before doing the > > SSE stuff. The newlib code sets back the FPU state at the end after the > > SSE stuff. Don't know if this is relevant or not. > > > > Any Cygwin users out there who can verify that the code is working/not > > working for them? > > > > -- Jeff J. > > > > current Cygwin produces for both i686 and X86_64 > > $ gcc -DNEWLIB -fno-builtin test_sqrt.c -lm > > $ ./a.exe > RNDN: 0x1.ff83fp+63 > RNDZ: 0x1.ff83fp+63 > RNDU: 0x1.ff83fp+63 > RNDD: 0x1.ff83fp+63 > Does fegetround() return different values based on what mode was set? --joel > >