From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by sourceware.org (Postfix) with ESMTPS id DA69E39874C6 for ; Wed, 2 Jun 2021 19:07:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DA69E39874C6 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-x633.google.com with SMTP id g20so5526347ejt.0 for ; Wed, 02 Jun 2021 12:07:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=QCTZ9cP68vyYca/kPtoiE4GlUCWvuDdXcVQN7XFVTD8=; b=FU8CAURzRqt8sT02+fdAuEqVe5y166Ji5qVeWnjQu0JflyQ0tBwCl0rr6xpsZBtqjR rdpbI3drd2QX1A1Y5F/KP9pt6MxytzWpU92GNgQuR6exTHnYJSOUj9BmB28KoWtWcT31 gp7zqxidIqZEeRV5uXSXkMU4ORpyVgYDqr1lrhsqObD1lQ7YrFQ7fXiXzf93pLGaSJ6T PdQ5D9hYBR82NfeIfI52OnxAHv+lvEl/9o5/lAofA72lxEONVCFXE1fM4cAHKbIBhdFL fmEedS8oU89r+HXyee6nH+hbeSivJepzwqSc0BAJPftRzTQPJNuVD3r1na8hLOxOIJO4 mKrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=QCTZ9cP68vyYca/kPtoiE4GlUCWvuDdXcVQN7XFVTD8=; b=W/JHR6tHFfpHubg/NTn8gS7TkUOTju6H4ZgYT+ka8t0bMdpIcUDXn2UyI1jQQdFZFb f7oeKojOyCgMcgXQLPU6gXqvBXQJYpzl6edbcCQsNOpQQcPrnMWLeo7G9pBTWPG5R26+ SPg2VpmI0rsiNGWzusVltW1OwQjKWb5z4UpVcstijIooKMLQxqZexwx617V4fvUOoZUb kAoybsh0SW2lOzCWJI3EJheoE7axQGso8XO5/zJKsus3mwNsVIisNNWLAUaCNC1KTNLN lVNB98in4jv/qe8ILndtjpjh634dP1f0poKaz8KNT2qp8nfiACBPmriRrkTDDFk8nOAA LyxA== X-Gm-Message-State: AOAM53363VRt98GtVq9yuNN1KTuCa7VRXtO2kQ8Mj6ecZWLYFw2zDOrx ZMwueN1QgS+3LUet8cSDg1eX6fxhhPo= X-Google-Smtp-Source: ABdhPJy7R42XHEJFb89wIgNAul6Nv3Bz+CUWfORmTIejF8Zfr5TrOZaRyFpoluvsn6vQmAUdYwgAgA== X-Received: by 2002:a17:906:d297:: with SMTP id ay23mr27786619ejb.418.1622660867028; Wed, 02 Jun 2021 12:07:47 -0700 (PDT) Received: from ?IPv6:2003:cc:9f0d:8659:9150:698e:9a47:7e34? (p200300cc9f0d86599150698e9a477e34.dip0.t-ipconnect.de. [2003:cc:9f0d:8659:9150:698e:9a47:7e34]) by smtp.gmail.com with ESMTPSA id n15sm413263ejz.36.2021.06.02.12.07.46 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Jun 2021 12:07:46 -0700 (PDT) Subject: Re: incorrectly rounded square root To: newlib@sourceware.org References: From: Marco Atzeri Message-ID: <2f8796f4-f164-5734-16ca-9a392e788beb@gmail.com> Date: Wed, 2 Jun 2021 21:07:45 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: it Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org 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:07:49 -0000 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 >> 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