From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-f179.google.com (mail-qk1-f179.google.com [209.85.222.179]) by sourceware.org (Postfix) with ESMTPS id 0C9B83858D3C for ; Mon, 22 Aug 2022 22:50:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0C9B83858D3C 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-qk1-f179.google.com with SMTP id g16so9064014qkl.11 for ; Mon, 22 Aug 2022 15:50:26 -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:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc; bh=R1WyE2aCgbonWMWF3gLj6nXg7LZtQjTExsyffYAei7I=; b=8G2VwnS2A1vRg9/PGrEE8exUz/i/7puXYDoh4z9yaoHyJmQ8qOF8DkTDp1l8JT6QgR OgCiJWDEAAmnBi5Z6DHbacc8sGj1e162+nCTSBMipMPYhXWmZOAGVeNBR4nQrMDrIO4p Sz6If6PmSRdcH+YEc8VCuOzOkMB8wZ66D2RwedULrcO+HiR8BB2A6zvbY1TkwCjLLCZG HNolZgv70kWz7wOOwmjeDtMTI2TOcXpueJSocF/zGgKjUmJAjrlpJzuFUA2/GiY6ntUG 9K1Y+kJzQAUftO6dZRN7tsYes4Siyx3eDApaS6lvK5WpjFIBk5aASOg1y+KLahM6ZEZP UtIw== X-Gm-Message-State: ACgBeo0Y4PGjeG3AvgvtiMV4eMzV0MobLj3PJgss5rFYzf4KjTtvEqnW yd1ogOSlhjnq4JulQuSWoU1b030WHYQ= X-Google-Smtp-Source: AA6agR7d1s4Do0E3B8CWtjjqf6O3FuBQjb6alwbqNPgnvx8oDZ3j/5vc8jHS+jFpP0LzOAJasKf+Dg== X-Received: by 2002:a05:620a:2894:b0:6b6:53c1:5ad4 with SMTP id j20-20020a05620a289400b006b653c15ad4mr13956076qkp.94.1661208625118; Mon, 22 Aug 2022 15:50:25 -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.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Aug 2022 15:50:24 -0700 (PDT) From: Joel Sherrill To: newlib@sourceware.org Subject: [PATCH newlib v1 0/4] Add FreeBSD long double functions Date: Mon, 22 Aug 2022 17:50:18 -0500 Message-Id: <20220822225022.32209-1-joel@rtems.org> X-Mailer: git-send-email 2.24.4 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3033.0 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no 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:27 -0000 Hi To be clear, this is a V1 for review. It actually does **NOT** add every long double math method from FreeBSD. That would add unnecessary bulk to this patch set at this point. The FreeBSD long double code requires there to be an architecture specific _fpmath.h file. This is only available for a handful of architestures. Further, LDBL does EQ DBL on many architectures. The FreeBSD long double code will **NOT** compile if there isn't an _fpmath.h file. Thus, the overall approach is: if architecture has _fpmath.h use FreeBSD long double code in libm/common/ldbl else use existing long double code As each FreeBSD long double function is added, the existing implementation will be moved from libm/common/FUNC.c to libm/common/ldbl_eq_dbl/s_FUNC.c. This is a first round patch which includes only: + changes to build infrastructure + addition of all architecture specific _fpmath.h + addition of FreeBSD s_truncl.c and move of truncl.c Additionally, the existing libm/common/frexpl.c already had code for long double and LDBL_EQ_DBL so I went ahead and split that up. Every file with LDBL_EQ_DBL conditional left in libm/common should not have an implementation when there is a real long double type. These will be easy to mechanically move into libm/common/ldbl_eq_dbl while adding their mate from FreeBSD. Feedback appreciated. Thanks. --joel Joel Sherrill (4): Add infrastructure for incorporating FreeBSD long double methods Makefile.in and configure: Regenerated Split libm/common/frexpl.c into LDBL_EQ_DBL and long double versions Makefile.in: Regenerated newlib/Makefile.am | 2 +- newlib/Makefile.in | 256 +++++++++++------- newlib/configure | 15 + newlib/libc/acinclude.m4 | 2 + newlib/libc/include/math.h | 14 - newlib/libc/include/sys/endian.h | 207 ++++++++++++++ newlib/libc/machine/aarch64/machine/_fpmath.h | 64 +++++ newlib/libc/machine/arm/machine/_fpmath.h | 69 +++++ newlib/libc/machine/i386/machine/_fpmath.h | 56 ++++ newlib/libc/machine/mips/machine/_fpmath.h | 58 ++++ newlib/libc/machine/powerpc/machine/_fpmath.h | 101 +++++++ newlib/libc/machine/riscv/machine/_fpmath.h | 71 +++++ newlib/libc/machine/sparc64/machine/_fpmath.h | 59 ++++ newlib/libc/machine/x86_64/machine/_fpmath.h | 57 ++++ newlib/libm/common/Makefile.inc | 16 +- newlib/libm/common/ldbl/fpmath.h | 82 ++++++ .../libm/common/{frexpl.c => ldbl/s_frexpl.c} | 9 - newlib/libm/common/ldbl/s_truncl.c | 68 +++++ newlib/libm/common/ldbl_eq_dbl/s_frexpl.c | 42 +++ .../{truncl.c => ldbl_eq_dbl/s_truncl.c} | 0 20 files changed, 1126 insertions(+), 122 deletions(-) create mode 100644 newlib/libc/include/sys/endian.h create mode 100644 newlib/libc/machine/aarch64/machine/_fpmath.h create mode 100644 newlib/libc/machine/arm/machine/_fpmath.h create mode 100644 newlib/libc/machine/i386/machine/_fpmath.h create mode 100644 newlib/libc/machine/mips/machine/_fpmath.h create mode 100644 newlib/libc/machine/powerpc/machine/_fpmath.h create mode 100644 newlib/libc/machine/riscv/machine/_fpmath.h create mode 100644 newlib/libc/machine/sparc64/machine/_fpmath.h create mode 100644 newlib/libc/machine/x86_64/machine/_fpmath.h create mode 100644 newlib/libm/common/ldbl/fpmath.h rename newlib/libm/common/{frexpl.c => ldbl/s_frexpl.c} (94%) create mode 100644 newlib/libm/common/ldbl/s_truncl.c create mode 100644 newlib/libm/common/ldbl_eq_dbl/s_frexpl.c rename newlib/libm/common/{truncl.c => ldbl_eq_dbl/s_truncl.c} (100%) -- 2.24.4