From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by sourceware.org (Postfix) with ESMTPS id ACF553858032; Mon, 20 Feb 2023 11:57:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ACF553858032 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-pg1-x529.google.com with SMTP id 132so428342pgh.13; Mon, 20 Feb 2023 03:57:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1676894260; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=MsmDxF1IqmP1Xjvm9CKJR2FnRGUrl/3yjR83izIm3Mw=; b=XdjQSjZvm+D1UJC8duPNqldqBfGDsBJEkM9BKazW2R50DrKf9eTkaKdyoVEXHuThl0 22iNImr1T5SInTQVpAFzO/VjKN4X2w8vBmYNdRJTa/V0j8m+0Jg0s5fdVm3f4BvihlIL M3Zd9qd4dJEsIsg0cpTSRWJOADUTnedFr/IvGfn2Idct54s73GUn5nXrjYMTXSg9y8rX hVk8hs7WuSLOJooUpQdfM1mul7XQlOvteqYaS8GPfoNTL/DXGluCu7Gavw+mGaqM+kIO QJ9LtpbO9DvRbsn0dwYrRP7/HPb7fwo1/DrrPXR1Mb6A9t03UCJUO8RtncTxavL2k0bF ++nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1676894260; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=MsmDxF1IqmP1Xjvm9CKJR2FnRGUrl/3yjR83izIm3Mw=; b=FbDm1Lt5stZtyJXeTH4c+viIwizmKQE98zBLMYJhIEwRKkYfZdOey/9E89F3j1xsqX zOP7KwzLayzQHgE8h9qkb85t/IkQBJnN7JSZW8GeR+DOfqt+2Nwn2X9dkBaXAEeXBGGU ykzsRLiI+MdXH/MVbIEQwvMMVVs5KnMZ6w5VuU3Dx6itDr+uDU0PN52hcvvGboXOicRs N4I5VlrHFvHxxCmye8cNnWwFESU20V60eXdvGAYSy/AnOFzESRRPaOieeVjvbd4FNXpb EJVryQ2bI7kQ+00QzoEIq5zY54b1dCVjqZVvEuBSB7zQCEB3nZfpsrdZI/St+qVLx/v1 gqZw== X-Gm-Message-State: AO0yUKUKFOCMBLZ7SMWxx9jl7F0u+rLlOATt3wCYV0QCnRIdS82Q1rcf IpczlD63Qhf4+s64b+FEFfXMdwHH2WQ0A37L4ww= X-Google-Smtp-Source: AK7set+XdqaKpSI3SD9npk5ulwESic1osGyqLg18TaZHhji7QTiOK10mrvSRVFl5dNYhPMZyRWn0SWMBCy/6pCslFHM= X-Received: by 2002:a05:6a00:bdc:b0:5a8:ba8e:5dd6 with SMTP id x28-20020a056a000bdc00b005a8ba8e5dd6mr468332pfu.19.1676894260543; Mon, 20 Feb 2023 03:57:40 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Nathaniel Shead Date: Mon, 20 Feb 2023 22:57:28 +1100 Message-ID: Subject: Re: [PATCH] libstdc++: Add missing functions to [PR79700] To: Jonathan Wakely Cc: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 Mon, Feb 20, 2023 at 10:30 PM Jonathan Wakely wrote: > > On Mon, 20 Feb 2023 at 11:23, Nathaniel Shead via Libstdc++ > wrote: > > > > The comments on PR79700 mentioned that it was somewhat ambiguous whether > > these functions were supposed to exist for C++11 or not. I chose to add > > them there, since other resources (such as cppreference) seem to think > > that C++11 should be the standard these functions were introduced, and I > > don't know of any reason to do otherwise. > > > > Tested on x86_64-linux. > > Thanks for the patch, but this needs tests for the new declarations > (which are tedious to write, which is the main reason I haven't > already pushed my own very similar patch). > Ah OK, fair enough. Where should the tests go? The only tests I could find for the existing (non -f/l) functions was just tests for their existence in testsuite/26_numerics/headers/cmath/functions_std_c++17.cc which I just added the new functions to - I guess I'll add a new file here and test that all the functions can be called and give the same results as the relevant overloaded variants? > > > > > -- 8< -- > > > > This patch adds the -f and -l variants of the C89 functions to > > under namespace std (so std::sqrtf, std::fabsl, etc.) for C++11 > > and up. > > > > libstdc++-v3/ChangeLog: > > > > PR libstdc++/79700 > > * include/c_global/cmath (acosf, acosl, asinf, asinl, atanf, > > atanl, atan2f, atan2l, ceilf, ceill, cosf, cosl, coshf, coshl, > > expf, expl, fabsf, fabsl, floorf, floorl, fmodf, fmodl, frexpf, > > frexpl, ldexpf, ldexpl, logf, logl, log10f, log10l, modff, > > modfl, powf, powl, sinf, sinl, sinhf, sinhl, sqrtf, sqrtl, tanf, > > tanl, tanhf, tanhl): Add aliases in namespace std. > > * testsuite/26_numerics/headers/cmath/functions_std_c++17.cc: > > Add checks for existence of above names. > > > > Signed-off-by: Nathaniel Shead > > --- > > libstdc++-v3/include/c_global/cmath | 111 ++++++++++++++++++ > > .../headers/cmath/functions_std_c++17.cc | 45 +++++++ > > 2 files changed, 156 insertions(+) > > > > diff --git a/libstdc++-v3/include/c_global/cmath b/libstdc++-v3/include/c_global/cmath > > index 568eb354c2d..eaebde33dee 100644 > > --- a/libstdc++-v3/include/c_global/cmath > > +++ b/libstdc++-v3/include/c_global/cmath > > @@ -1767,6 +1767,117 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > > > #if __cplusplus >= 201103L > > > > +#undef acosf > > +#undef acosl > > +#undef asinf > > +#undef asinl > > +#undef atanf > > +#undef atanl > > +#undef atan2f > > +#undef atan2l > > +#undef ceilf > > +#undef ceill > > +#undef cosf > > +#undef cosl > > +#undef coshf > > +#undef coshl > > +#undef expf > > +#undef expl > > +#undef fabsf > > +#undef fabsl > > +#undef floorf > > +#undef floorl > > +#undef fmodf > > +#undef fmodl > > +#undef frexpf > > +#undef frexpl > > +#undef ldexpf > > +#undef ldexpl > > +#undef logf > > +#undef logl > > +#undef log10f > > +#undef log10l > > +#undef modff > > +#undef modfl > > +#undef powf > > +#undef powl > > +#undef sinf > > +#undef sinl > > +#undef sinhf > > +#undef sinhl > > +#undef sqrtf > > +#undef sqrtl > > +#undef tanf > > +#undef tanl > > +#undef tanhf > > +#undef tanhl > > + > > + using ::acosf; > > + using ::acosl; > > + > > + using ::asinf; > > + using ::asinl; > > + > > + using ::atanf; > > + using ::atanl; > > + > > + using ::atan2f; > > + using ::atan2l; > > + > > + using ::ceilf; > > + using ::ceill; > > + > > + using ::cosf; > > + using ::cosl; > > + > > + using ::coshf; > > + using ::coshl; > > + > > + using ::expf; > > + using ::expl; > > + > > + using ::fabsf; > > + using ::fabsl; > > + > > + using ::floorf; > > + using ::floorl; > > + > > + using ::fmodf; > > + using ::fmodl; > > + > > + using ::frexpf; > > + using ::frexpl; > > + > > + using ::ldexpf; > > + using ::ldexpl; > > + > > + using ::logf; > > + using ::logl; > > + > > + using ::log10f; > > + using ::log10l; > > + > > + using ::modff; > > + using ::modfl; > > + > > + using ::powf; > > + using ::powl; > > + > > + using ::sinf; > > + using ::sinl; > > + > > + using ::sinhf; > > + using ::sinhl; > > + > > + using ::sqrtf; > > + using ::sqrtl; > > + > > + using ::tanf; > > + using ::tanl; > > + > > + using ::tanhf; > > + using ::tanhl; > > + > > #ifdef _GLIBCXX_USE_C99_MATH_TR1 > > > > #undef acosh > > diff --git a/libstdc++-v3/testsuite/26_numerics/headers/cmath/functions_std_c++17.cc b/libstdc++-v3/testsuite/26_numerics/headers/cmath/functions_std_c++17.cc > > index 3b4ada1a756..c6ec636c183 100644 > > --- a/libstdc++-v3/testsuite/26_numerics/headers/cmath/functions_std_c++17.cc > > +++ b/libstdc++-v3/testsuite/26_numerics/headers/cmath/functions_std_c++17.cc > > @@ -44,6 +44,51 @@ namespace gnu > > using std::tan; > > using std::tanh; > > > > + using std::acosf; > > + using std::acosl; > > + using std::asinf; > > + using std::asinl; > > + using std::atanf; > > + using std::atanl; > > + using std::atan2f; > > + using std::atan2l; > > + using std::ceilf; > > + using std::ceill; > > + using std::cosf; > > + using std::cosl; > > + using std::coshf; > > + using std::coshl; > > + using std::expf; > > + using std::expl; > > + using std::fabsf; > > + using std::fabsl; > > + using std::floorf; > > + using std::floorl; > > + using std::fmodf; > > + using std::fmodl; > > + using std::frexpf; > > + using std::frexpl; > > + using std::ldexpf; > > + using std::ldexpl; > > + using std::logf; > > + using std::logl; > > + using std::log10f; > > + using std::log10l; > > + using std::modff; > > + using std::modfl; > > + using std::powf; > > + using std::powl; > > + using std::sinf; > > + using std::sinl; > > + using std::sinhf; > > + using std::sinhl; > > + using std::sqrtf; > > + using std::sqrtl; > > + using std::tanf; > > + using std::tanl; > > + using std::tanhf; > > + using std::tanhl; > > + > > using std::assoc_laguerre; > > using std::assoc_laguerref; > > using std::assoc_laguerrel; > > -- > > 2.34.1 > > >