From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-f178.google.com (mail-qt1-f178.google.com [209.85.160.178]) by sourceware.org (Postfix) with ESMTPS id 0F1553857C71 for ; Mon, 22 Aug 2022 22:50:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0F1553857C71 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-qt1-f178.google.com with SMTP id e28so9139683qts.1 for ; Mon, 22 Aug 2022 15:50:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=iItT7cFWyeZMArHahAFoNnu/DtE3NORgQihbLsH2uUY=; b=2LiNMQU5Jh8ZX/qW2R2Y/nytmJhAbToGExB1TXV82Nvh4sMX3gayyRrzzm5cXEyUTu KOAC+fDNM4N+kS2+UtnuJm5MW4pr5L2/ysU/c77L1g8piQVJpgCjm9gjZAzV0SWjG1YD 2D/JkIjg/84OfNM7JrzNQkeGb0iw+eDSjjJkyiTpyoJqR+e6VwhmqfV09kLp3uogJ4pN gEyI7A5dxT9e1ZVv4P2PNxau3C4zv607aluUd6yKhjYTURAhJTx7UbYm+wdnnK4EsS7s rmLqgxiTijMiy3n51nrM2zkFbHpsy4gTE4Ftxwr7048ZUhx9spgRK7iS+Q8rA7vNrncj XZ2A== X-Gm-Message-State: ACgBeo2duOt6DlWbjV/Y5eVs7GhSrfH0Qhzn2JwpKEu3CK4Qgestb70o SgwL/hy574KBphjMr07KruWGbtAHjRg= X-Google-Smtp-Source: AA6agR7ELxVQO5/r85esMn6AFEPypQ0zht+XoLFfUTcHOoApHVNTcUzjeP2PW5SG1R6JLTrKQN2hUg== X-Received: by 2002:ac8:5b91:0:b0:344:55f7:da72 with SMTP id a17-20020ac85b91000000b0034455f7da72mr17529868qta.542.1661208629147; Mon, 22 Aug 2022 15:50:29 -0700 (PDT) Received: from devel.oarcorp.com (d27-96-189-151.evv.wideopenwest.com. [96.27.151.189]) by smtp.gmail.com with ESMTPSA id dm47-20020a05620a1d6f00b006b8fb2a1145sm11681237qkb.124.2022.08.22.15.50.27 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Aug 2022 15:50:28 -0700 (PDT) From: Joel Sherrill To: newlib@sourceware.org Subject: [PATCH newlib v1 3/4] Split libm/common/frexpl.c into LDBL_EQ_DBL and long double versions Date: Mon, 22 Aug 2022 17:50:21 -0500 Message-Id: <20220822225022.32209-4-joel@rtems.org> X-Mailer: git-send-email 2.24.4 In-Reply-To: <20220822225022.32209-1-joel@rtems.org> References: <20220822225022.32209-1-joel@rtems.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3039.0 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: Mon, 22 Aug 2022 22:50:32 -0000 This resulted in the contents of libm/common/frexpl.c being split into libm/common/ldbl/s_frexpl.c and libm/common/ldbl_eq_dbl/s_frexpl.c. --- newlib/Makefile.am | 2 +- newlib/libm/common/Makefile.inc | 6 +-- .../libm/common/{frexpl.c => ldbl/s_frexpl.c} | 9 ---- newlib/libm/common/ldbl_eq_dbl/s_frexpl.c | 42 +++++++++++++++++++ 4 files changed, 46 insertions(+), 13 deletions(-) rename newlib/libm/common/{frexpl.c => ldbl/s_frexpl.c} (94%) create mode 100644 newlib/libm/common/ldbl_eq_dbl/s_frexpl.c diff --git a/newlib/Makefile.am b/newlib/Makefile.am index 0108d8576..bd99c7b4f 100644 --- a/newlib/Makefile.am +++ b/newlib/Makefile.am @@ -116,7 +116,7 @@ MATHOBJS_IN_LIBC = \ libm_a-s_isnand.o libm_a-sf_isnanf.o \ libm_a-s_nan.o libm_a-sf_nan.o \ libm_a-s_ldexp.o libm_a-sf_ldexp.o \ - libm_a-s_frexp.o libm_a-sf_frexp.o libm_a-frexpl.o \ + libm_a-s_frexp.o libm_a-sf_frexp.o libm_a-s_frexpl.o \ libm_a-s_modf.o \ libm_a-sf_modf.o libm_a-s_scalbn.o \ libm_a-sf_scalbn.o \ diff --git a/newlib/libm/common/Makefile.inc b/newlib/libm/common/Makefile.inc index d08b8b21a..9ff1231e9 100644 --- a/newlib/libm/common/Makefile.inc +++ b/newlib/libm/common/Makefile.inc @@ -60,7 +60,7 @@ %D%/sinf.c %D%/cosf.c %D%/sincosf.c %D%/sincosf_data.c %D%/math_errf.c %C%_lsrc = \ - %D%/atanl.c %D%/cosl.c %D%/sinl.c %D%/tanl.c %D%/tanhl.c %D%/frexpl.c %D%/modfl.c %D%/ceill.c %D%/fabsl.c \ + %D%/atanl.c %D%/cosl.c %D%/sinl.c %D%/tanl.c %D%/tanhl.c %D%/modfl.c %D%/ceill.c %D%/fabsl.c \ %D%/floorl.c %D%/log1pl.c %D%/expm1l.c %D%/acosl.c %D%/asinl.c %D%/atan2l.c %D%/coshl.c %D%/sinhl.c \ %D%/expl.c %D%/ldexpl.c %D%/logl.c %D%/log10l.c %D%/powl.c %D%/sqrtl.c %D%/fmodl.c %D%/hypotl.c \ %D%/copysignl.c %D%/nanl.c %D%/ilogbl.c %D%/asinhl.c %D%/cbrtl.c %D%/nextafterl.c %D%/rintl.c \ @@ -70,9 +70,9 @@ %D%/logbl.c %D%/nexttowardf.c %D%/nexttoward.c %D%/nexttowardl.c %D%/log2l.c \ %D%/sl_finite.c -%C%_ldbl_eq_dbl_src = %D%/ldbl_eq_dbl/s_truncl.c +%C%_ldbl_eq_dbl_src = %D%/ldbl_eq_dbl/s_frexpl.c %D%/ldbl_eq_dbl/s_truncl.c -%C%_ldbl_src = %D%/ldbl/s_truncl.c +%C%_ldbl_src = %D%/ldbl/s_frexpl.c %D%/ldbl/s_truncl.c libm_a_CFLAGS_%C% = -fbuiltin -fno-math-errno diff --git a/newlib/libm/common/frexpl.c b/newlib/libm/common/ldbl/s_frexpl.c similarity index 94% rename from newlib/libm/common/frexpl.c rename to newlib/libm/common/ldbl/s_frexpl.c index 8da2823ca..63835c105 100644 --- a/newlib/libm/common/frexpl.c +++ b/newlib/libm/common/ldbl/s_frexpl.c @@ -32,14 +32,6 @@ POSSIBILITY OF SUCH DAMAGE. #include #include "local.h" -/* On platforms where long double is as wide as double. */ -#if defined(_LDBL_EQ_DBL) -long double -frexpl (long double x, int *eptr) -{ - return frexp(x, eptr); -} -#else /* !_DBL_EQ_DBL */ # if (LDBL_MANT_DIG == 53) /* 64-bit long double */ static const double scale = 0x1p54; @@ -149,4 +141,3 @@ frexpl (long double x, int *eptr) u.u32.exp = LDBL_MAX_EXP - 2; /* -1 */ return u.x; } -#endif /* !_LDBL_EQ_DBL */ diff --git a/newlib/libm/common/ldbl_eq_dbl/s_frexpl.c b/newlib/libm/common/ldbl_eq_dbl/s_frexpl.c new file mode 100644 index 000000000..90ae0153f --- /dev/null +++ b/newlib/libm/common/ldbl_eq_dbl/s_frexpl.c @@ -0,0 +1,42 @@ +/* +(C) Copyright IBM Corp. 2009 + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. +* Neither the name of IBM nor the names of its contributors may be +used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +#include +#include +#include "local.h" + +/* On platforms where long double is as wide as double. */ +#if defined(_LDBL_EQ_DBL) +long double +frexpl (long double x, int *eptr) +{ + return frexp(x, eptr); +} +#endif /* !_LDBL_EQ_DBL */ -- 2.24.4