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.129.124]) by sourceware.org (Postfix) with ESMTPS id 87B35386C58D for ; Mon, 27 Jun 2022 11:01:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 87B35386C58D Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-467-2fee-ecBMb2Rk6N3O90uog-1; Mon, 27 Jun 2022 07:01:47 -0400 X-MC-Unique: 2fee-ecBMb2Rk6N3O90uog-1 Received: by mail-ed1-f70.google.com with SMTP id x21-20020a05640226d500b00435bd7f9367so6903677edd.8 for ; Mon, 27 Jun 2022 04:01:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=FvIIqOdGUOb/9wWfWGnefWqEfop5iSRM20U16woyx20=; b=gfmNEbjqjsoghTHswSLlk0GfynK5d0CgdbE6p5DB7vcszD4QFR4QFzlQeCsc8Y06b9 7E/6TD7YXTT2uyxW81mXnT0+vp1ncTDJfkivAUY9vachzHib5Pw0ju+xolDrSbEwM0DL XcKjp/YsFcu5Q5RzxEc1n8KZMemDpthKefBP+alWFRQlj/VXAQrxhWkAaKcuu1n1qFAa DGiNd72CQKEOndgff7mkjKDmCENcsJ5S6BRqCiaqxCEFpkY6oaSxlW6vZ4GCaTKrV0OU /FcD1UFxqIdQXTzFK6bf79eZo5a6GjJDimJNyR92eqhyIAS3SlifQ+eY2tNVwEJdNRlW FCTg== X-Gm-Message-State: AJIora+cAGCoY77L4j6KY+4r8FzCtOg1YFrPdjyALOpe8YoOPQY6q/bO 9wfi36aU7cGMK9dnzZ/SNj4Y/eyYozMxGNkMNSFE/raon6HADANSXf7+bkf8PKE83D1gpW//nfo N8JQEXrR2UdAx2UkCNaheCY+YaTHix7U= X-Received: by 2002:a17:906:779c:b0:722:e65f:cdfd with SMTP id s28-20020a170906779c00b00722e65fcdfdmr12082130ejm.109.1656327706795; Mon, 27 Jun 2022 04:01:46 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t3+JRFj/3KsvC9ifKP0eouUCcBAt1ZSzUxyeFbuaorB030TNEqTGTZAXPfrCeC2vOLDyrrHCg7EdT0ntACu0Q= X-Received: by 2002:a17:906:779c:b0:722:e65f:cdfd with SMTP id s28-20020a170906779c00b00722e65fcdfdmr12082103ejm.109.1656327706475; Mon, 27 Jun 2022 04:01:46 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Wakely Date: Mon, 27 Jun 2022 12:01:35 +0100 Message-ID: Subject: Re: [PATCH] libstdc++: testsuite: use cmath long double overloads To: Alexandre Oliva Cc: gcc Patches , "libstdc++" X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-14.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jun 2022 11:01:50 -0000 On Tue, 21 Jun 2022 at 06:39, Alexandre Oliva via Libstdc++ wrote: > > > In case we need to supplement the C standard library with additional > definitions for float and long double, the declarations expected to be > in the C headers may not be there. Rely on the cmath overloads > instead. > > Regstrapped on x86_64-linux-gnu, also tested with a cross to > aarch64-rtems6. Ok to install? OK > > > for libstdc++-v3/ChangeLog > > * testsuite/20_util/to_chars/long_double.cc: Use cmath > long double overloads for nexttoward and ldexp. > --- > .../testsuite/20_util/to_chars/long_double.cc | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/libstdc++-v3/testsuite/20_util/to_chars/long_double.cc b/libstdc++-v3/testsuite/20_util/to_chars/long_double.cc > index 0b1c2c2936fdc..498388110b179 100644 > --- a/libstdc++-v3/testsuite/20_util/to_chars/long_double.cc > +++ b/libstdc++-v3/testsuite/20_util/to_chars/long_double.cc > @@ -54,11 +54,11 @@ namespace detail > { > long double > nextupl(long double x) > - { return nexttowardl(x, numeric_limits::infinity()); } > + { return nexttoward(x, numeric_limits::infinity()); } > > long double > nextdownl(long double x) > - { return nexttowardl(x, -numeric_limits::infinity()); } > + { return nexttoward(x, -numeric_limits::infinity()); } > } > > // The long double overloads of std::to_chars currently just go through printf > @@ -138,7 +138,7 @@ test01() > for (int exponent : {-11000, -3000, -300, -50, -7, 0, 7, 50, 300, 3000, 11000}) > for (long double testcase : hex_testcases) > { > - testcase = ldexpl(testcase, exponent); > + testcase = ldexp(testcase, exponent); > if (testcase == 0.0L || isinf(testcase)) > continue; > > > -- > Alexandre Oliva, happy hacker https://FSFLA.org/blogs/lxo/ > Free Software Activist GNU Toolchain Engineer > Disinformation flourishes because many people care deeply about injustice > but very few check the facts. Ask me about >