From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2113.outbound.protection.outlook.com [40.107.244.113]) by sourceware.org (Postfix) with ESMTPS id C4AE5385700F for ; Thu, 20 Apr 2023 21:23:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C4AE5385700F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=oarcorp.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=OARcorp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ENp8qFidgQG4SsB+lqgqh4oxnv6xYEKzzdZuNIYeSXsh3i4XGmCJg4teB0EXfz0SYq7vzZqHoDb4kNnwjBZaewHjLxemgS01hoK21q1sJ+2HuDVxX0rkgRFZBXJU/69sNFl3MH9rt+CjicOQIqYV6OI9Y8pO0YH+HnrRn91oHbPA7UDUEMZxmaXtarf0JGscT9WGxTdENKfnj1BJigP506zqIs1NUuvSU+PI/QHnK0gT8OHu2v49BUT6X7F9NwseynJtt/6MRv/mIlVYClhNmY3ytWP/3zmqtmAPabAs93bj915meymaxTwvjzN/OIa2RMwxgcYLU4DNV7706ButHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=tT9YGTb1ibTilFxmvK/4gsLGkh3n2T1/ULIvt31KIMo=; b=JW9U3cnWdu2k2pikOIymSBZYDl5DPwHMqlCj1Ydvk00NWhdLylrW+M5w+0PQbKoC4UpgtjtAdRymwGofkXQwdj1V0IzXHJ9fZM2dt0h+tSwGHDAgPDrHmvxy0L8q4PGB097FCHXYMP8qouOETDFQrQi28lV6xL2H54srFQKU8V5zcmcLr3hWtsfaGdQQ3iFPTSoJ74SwSgq0FzKedCBJ62AVp957GN01RE3+g025j+nXENTlM/gLe8idl2KzCKTw0LDnPVGk+2cG0hmB7+WvUIK2eALPD6cZsVRH4MI6ESpVQ51MrQVrmwzek8umLU5WRgSSHmfAMrsG9/GuuSLmiA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oarcorp.com; dmarc=pass action=none header.from=oarcorp.com; dkim=pass header.d=oarcorp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oarcorp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tT9YGTb1ibTilFxmvK/4gsLGkh3n2T1/ULIvt31KIMo=; b=FHX4INW2fq0tmfwie8hxWQA8pViDhtn4Utu1aPgIMeDe6LgHvIryWYnZSVVHbFcKWoMS51fVjHjOWUgLLvASWnvXTu49Yzky2zLkMflOLanjr9+RyFnWNMbnkkfaGHNGeKqYjj5KUQpnR1KgA7IIh/g98tUw0GgJNbxX40gs9HM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oarcorp.com; Received: from BN6PR19MB0098.namprd19.prod.outlook.com (2603:10b6:405:69::34) by CY8PR19MB7692.namprd19.prod.outlook.com (2603:10b6:930:7a::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.22; Thu, 20 Apr 2023 21:23:43 +0000 Received: from BN6PR19MB0098.namprd19.prod.outlook.com ([fe80::bfa3:12b3:89c5:491c]) by BN6PR19MB0098.namprd19.prod.outlook.com ([fe80::bfa3:12b3:89c5:491c%6]) with mapi id 15.20.6298.045; Thu, 20 Apr 2023 21:23:43 +0000 From: Jennifer Averett To: newlib@sourceware.org Cc: Jennifer Averett Subject: [PATCH v2 2/3] newlib: Add non LDBL_EQ_DBL math support for aarch64, i386, and x86_64 Date: Thu, 20 Apr 2023 16:23:08 -0500 Message-Id: <20230420212309.2375488-3-jennifer.averett@oarcorp.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230420212309.2375488-1-jennifer.averett@oarcorp.com> References: <20230420212309.2375488-1-jennifer.averett@oarcorp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: BN0PR04CA0101.namprd04.prod.outlook.com (2603:10b6:408:ec::16) To BN6PR19MB0098.namprd19.prod.outlook.com (2603:10b6:405:69::34) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN6PR19MB0098:EE_|CY8PR19MB7692:EE_ X-MS-Office365-Filtering-Correlation-Id: 7cee870c-baff-4594-055a-08db41e584e8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tjftVn7Ay32ItrxuCAW0HwZzQOxNUzLvwwplreoGiXY+1N0DrF10w7B+wg96HIyJJcP2HQ47s52Aj0guRNSCAOuueXHetsYgt334x7q3ALiuZYJ1JrxuvS7+Cp8RxUdL/GHJ4HoK+jGhF4wdYQKbCAs8Le5M1bDxihdwD2nKopg1q4uG0P/Ba1tcJrq0elr2TBIbcn/vPAkMjM8uzTodSQoItmURopKRvyHNHe7JFhBifjj2li9ig6Hc05EwPCCkqr44Gt1qjxGBMsMOx2/RQwQWe2Zpf0PPsszMbfEEQeUIlpTLlcIIH9QnCxbBsajdF5h07VDogHH6hLx4C+13hc2EaZKyzRwiDzMT92j7agmZ3+fpCjy9DFgac1BJpAoigl2z56JoiPU5n5+YWny6PWH2fBL8XRB13+axE3khfKJRplg7QzGZPQmRGkrF2HMOVaBuMYRiSaAx97uxYMcy7nXgq/HL0SOEevSCFwvvv8zk6SiMaJn5PGp1qUANeA/Uc+Fn0qyI1hZ0+72ozEiY0LDFduQbtZer+98K+a/yh1MnCVFeFmsN/8ZkOKu15YmdufZLlLHEYckW1SjoqymyWR/xzUd0H/nmvgyfbiELckccZHQaeXpmALDLSWtAqvgSquAEc6KRTb/FNmrzu6FSHQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN6PR19MB0098.namprd19.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(396003)(346002)(39830400003)(42606007)(366004)(376002)(451199021)(186003)(38100700002)(107886003)(45080400002)(6666004)(36756003)(478600001)(86362001)(6512007)(38350700002)(1076003)(26005)(2616005)(6506007)(6486002)(4326008)(6916009)(316002)(66476007)(66946007)(52116002)(66556008)(41300700001)(8936002)(8676002)(44832011)(83380400001)(5660300002)(30864003)(2906002)(21314003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?JwOwc99cDxanrPksE+S+8l0WhIxbGspU8ttucYiOPkzkPJK78jnCZ/O5LbV8?= =?us-ascii?Q?Ug00kmyxjoU4tf21rxXTkCDhQupqekZWvFWwB0M2B+p+NlFZWYl3TdCAAMk+?= =?us-ascii?Q?OxTmtLlyDiSb97U6qwuQ81qg9HxD/8PTOcrTLYYwYx+eqATXxBkLIpSB6+0H?= =?us-ascii?Q?DqQnytFsit+q7TjhPlN5+ZK/DYKaCkXcBlM+nf0JtOb365pX9yWRH495TjG+?= =?us-ascii?Q?LScolFIhkyyXUyU0M8vbVypm5bEOos0jikEAZWTBp6dQ7MN42autdDMBzj8D?= =?us-ascii?Q?R85dBBHhcIV1bnnXzmE0yq1n95r0dX8mwyh4TGnPizSTmnBGJNf5V79zuaq0?= =?us-ascii?Q?dvfvd0Km5p9CWmIdL+IH5fnqhyYwbagLn/ZJeTUpHbplfKVHhLdEK3T9oPQj?= =?us-ascii?Q?iH79nwT8vADQH0lLNx+vqgK6UABdvZEyLADZ2IJU3Om8rVUTaTIo62q8eN17?= =?us-ascii?Q?b5JUZQKNWqnguGrCVrZjHsXBKOS9xvWuvqMqinzJmJr2ZIChSCI40ani8Qeo?= =?us-ascii?Q?tsjkPJlSsRwy0bJi4H7UMREG/WEeOTxiPzDQFv/Wt0yVKexd2bHvFvN2EkpM?= =?us-ascii?Q?2ApdtjocZPl0yb27AIIUEbEnzHQONED7lAaFbH0J8aM2ZNjrj3fRDV1t3Mn/?= =?us-ascii?Q?/dWY2zDfYiUJdyo2SxiwwopM9V+usFpEZo3TsW5ofxumCYaIvkfLz8i7BibL?= =?us-ascii?Q?cjK6/NinNkGLf1Ui71ZCL6S0mmFO7dtEIQ3dTE0jtTLz6r0KMruKxg0cHwDx?= =?us-ascii?Q?c9vRETuo0FJddjVbzR0o33SLuEKR9h+7SHpps1eJKDUTGLd8hQLpkfn7kxyd?= =?us-ascii?Q?/Nb/zaerVJ3GaQIEvDvGbChvx2hX4hjcdc3Cbq7Y/SNR6uhjS8Butf+3qchi?= =?us-ascii?Q?cIHYYsTIy/PaJiN1jCQ87J5lYcHNFgYxy83Qn1oOFJlShw8CH1tDNwDLQsRN?= =?us-ascii?Q?Y1zBRgMoXjLvC4CbtbLI9yHYPhADXShpd2bZvc3U5yr8vYrzxJaFPPcGblPW?= =?us-ascii?Q?Iw/SJS0heIDgBt6O20Gafho64mrHGgdOHUDU4TKhIPSJMG6tU//64ZHoDMUv?= =?us-ascii?Q?exmqJ96zxo5xEF6fTw9yb+cW5brBptZ8Abiok16q9G4D4VsAVUXHsyYbreXc?= =?us-ascii?Q?rCtoNtbWuSSKCl9ClBgC7v5h4JnRSuTy6jmWVOgc09pBj9q/yVoZiz7vYlBj?= =?us-ascii?Q?98J5zNn0cqjLdQ8vYyhWSAA/jIx/DTY1JnysNwMuV/4S3RCwNZLCromk2yI1?= =?us-ascii?Q?tWWe/vHcOerQ3pE/zIRgDYt5XRqh2GhSCEsSe707Yp8j5/Mdgb5XKSIxkQSW?= =?us-ascii?Q?PssMF3kEAcay3F79ogavxOBOxVIesVF2MTkEZU+o2XLmZbWZECwHo0TnyPAw?= =?us-ascii?Q?CNvYVNn63A9dbpG0WoJ7goI2Ahah7nPbFUDW6Q0PQwfxY7aaIlOOuOEyfVpl?= =?us-ascii?Q?BeCBgNm0p9ck8Op+5q2RMZHc7exKXoXgAyKJjpk7n6JITsf6tTuHtDtP2Xvc?= =?us-ascii?Q?r4vjdjZMunhisWHOjb8IdXyjnPrDDoQJ9N8yveAb+iBjuEjj1BpniwaZ0+Hq?= =?us-ascii?Q?1q6/lWMLLRa3tzAcP2uSDVTV0mgSI0CYpZ/+Fpgk?= X-OriginatorOrg: oarcorp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7cee870c-baff-4594-055a-08db41e584e8 X-MS-Exchange-CrossTenant-AuthSource: BN6PR19MB0098.namprd19.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Apr 2023 21:23:43.8046 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 7bdf32a6-03de-4c70-a71b-8665ba1294e3 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: t6lHZuvhoPaqyrw/O5nXXx4dwPBy20WphcUUEfzKSiG0Np5W7LP4yLY5uZ/OH9eeXsTnKjlgeUx1h1GD1bxRCA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR19MB7692 X-Spam-Status: No, score=-10.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,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 List-Id: Rename s_nearbyint.c, s_fdim.c and s_scalbln.c to remove conflicts Remove functions that are not needed from above files Modify include paths Add missing types Create Makefiles Create header files to resolve dependencies between directories Modify some instances of unsigned long to uint64_t for 32 bit platforms Add HAVE_FPMATH_H --- newlib/libc/acinclude.m4 | 3 + newlib/libc/include/{sys => }/endian.h | 42 ++++++++++++-- newlib/libc/include/math.h | 3 +- newlib/libc/machine/aarch64/machine/_fpmath.h | 20 ++++--- newlib/libm/Makefile.inc | 8 +++ newlib/libm/ld/Makefile.inc | 56 +++++++++++++++++++ newlib/libm/ld/e_lgammal.c | 2 + newlib/libm/ld/{s_fdim.c => fdiml.c} | 7 +++ newlib/libm/ld/fpmath.h | 4 +- newlib/libm/ld/invtrig.h | 34 +++++++++++ newlib/libm/ld/k_expl.h | 33 +++++++++++ newlib/libm/ld/math_private.h | 21 ++++++- newlib/libm/ld/s_ilogbl.c | 6 +- newlib/libm/ld/s_logbl.c | 6 +- newlib/libm/ld/s_lround.c | 2 +- .../libm/ld/{s_nearbyint.c => s_nearbyintl.c} | 7 +++ newlib/libm/ld/{s_scalbln.c => scalblnl.c} | 7 +++ newlib/libm/ld128/Makefile.inc | 14 +++++ newlib/libm/ld128/e_lgammal_r.c | 4 +- newlib/libm/ld128/e_powl.c | 2 +- newlib/libm/ld128/e_rem_pio2l.h | 2 +- newlib/libm/ld128/invtrig.h | 2 +- newlib/libm/ld128/k_cosl.c | 4 +- newlib/libm/ld128/k_sinl.c | 4 +- newlib/libm/ld128/s_erfl.c | 4 +- newlib/libm/ld128/s_exp2l.c | 2 +- newlib/libm/ld128/s_expl.c | 4 +- newlib/libm/ld128/s_logl.c | 4 +- newlib/libm/ld80/Makefile.inc | 15 +++++ newlib/libm/ld80/b_expl.c | 4 +- newlib/libm/ld80/b_tgammal.c | 7 ++- newlib/libm/ld80/e_lgammal_r.c | 4 +- newlib/libm/ld80/e_powl.c | 4 +- newlib/libm/ld80/e_rem_pio2l.h | 2 +- newlib/libm/ld80/invtrig.h | 2 +- newlib/libm/ld80/k_cosl.c | 4 +- newlib/libm/ld80/k_sinl.c | 4 +- newlib/libm/ld80/s_cospil.c | 4 +- newlib/libm/ld80/s_erfl.c | 4 +- newlib/libm/ld80/s_exp2l.c | 4 +- newlib/libm/ld80/s_expl.c | 4 +- newlib/libm/ld80/s_logl.c | 4 +- newlib/libm/ld80/s_sinpil.c | 4 +- 43 files changed, 310 insertions(+), 67 deletions(-) rename newlib/libc/include/{sys => }/endian.h (78%) create mode 100644 newlib/libm/ld/Makefile.inc rename newlib/libm/ld/{s_fdim.c => fdiml.c} (93%) create mode 100644 newlib/libm/ld/invtrig.h create mode 100644 newlib/libm/ld/k_expl.h rename newlib/libm/ld/{s_nearbyint.c => s_nearbyintl.c} (94%) rename newlib/libm/ld/{s_scalbln.c => scalblnl.c} (93%) create mode 100644 newlib/libm/ld128/Makefile.inc create mode 100644 newlib/libm/ld80/Makefile.inc diff --git a/newlib/libc/acinclude.m4 b/newlib/libc/acinclude.m4 index 7cba7db39..42662669f 100644 --- a/newlib/libc/acinclude.m4 +++ b/newlib/libc/acinclude.m4 @@ -62,4 +62,7 @@ m4_foreach_w([MACHINE], [ z8k ], [AM_CONDITIONAL([HAVE_LIBC_MACHINE_]m4_toupper(MACHINE), test "${machine_dir}" = MACHINE)]) +AM_CONDITIONAL(HAVE_FPMATH_H, test -r "${srcdir}/libc/machine/${machine_dir}/machine/_fpmath.h") + + AM_CONDITIONAL(MACH_ADD_SETJMP, test "x$mach_add_setjmp" = "xtrue") diff --git a/newlib/libc/include/sys/endian.h b/newlib/libc/include/endian.h similarity index 78% rename from newlib/libc/include/sys/endian.h rename to newlib/libc/include/endian.h index d91c442e9..d070d09ad 100644 --- a/newlib/libc/include/sys/endian.h +++ b/newlib/libc/include/endian.h @@ -55,12 +55,6 @@ typedef __uint64_t uint64_t; #define _UINT64_T_DECLARED #endif -/* - * Note: While tempting to try to avoid namespace pollution from this file, - * several software packages assume these marcos are defined, even when it - * defines _POSIX_C_SOURCE to request an unpolluted namespace. - */ - /* * General byte order swapping functions. */ @@ -68,7 +62,42 @@ typedef __uint64_t uint64_t; #define bswap32(x) __bswap32(x) #define bswap64(x) __bswap64(x) +/* + * Host to big endian, host to little endian, big endian to host, and little + * endian to host byte order functions as detailed in byteorder(9). + */ +#if _BYTE_ORDER == _LITTLE_ENDIAN +#define htobe16(x) bswap16((x)) +#define htobe32(x) bswap32((x)) +#define htobe64(x) bswap64((x)) +#define htole16(x) ((uint16_t)(x)) +#define htole32(x) ((uint32_t)(x)) +#define htole64(x) ((uint64_t)(x)) + +#define be16toh(x) bswap16((x)) +#define be32toh(x) bswap32((x)) +#define be64toh(x) bswap64((x)) +#define le16toh(x) ((uint16_t)(x)) +#define le32toh(x) ((uint32_t)(x)) +#define le64toh(x) ((uint64_t)(x)) +#else /* _BYTE_ORDER != _LITTLE_ENDIAN */ +#define htobe16(x) ((uint16_t)(x)) +#define htobe32(x) ((uint32_t)(x)) +#define htobe64(x) ((uint64_t)(x)) +#define htole16(x) bswap16((x)) +#define htole32(x) bswap32((x)) +#define htole64(x) bswap64((x)) + +#define be16toh(x) ((uint16_t)(x)) +#define be32toh(x) ((uint32_t)(x)) +#define be64toh(x) ((uint64_t)(x)) +#define le16toh(x) bswap16((x)) +#define le32toh(x) bswap32((x)) +#define le64toh(x) bswap64((x)) +#endif /* _BYTE_ORDER == _LITTLE_ENDIAN */ + /* Alignment-agnostic encode/decode bytestream to/from little/big endian. */ + static __inline uint16_t be16dec(const void *pp) { @@ -174,4 +203,5 @@ le64enc(void *pp, uint64_t u) le32enc(p, (uint32_t)(u & 0xffffffffU)); le32enc(p + 4, (uint32_t)(u >> 32)); } + #endif /* _SYS_ENDIAN_H_ */ diff --git a/newlib/libc/include/math.h b/newlib/libc/include/math.h index 54e30ef82..dabde9a7d 100644 --- a/newlib/libc/include/math.h +++ b/newlib/libc/include/math.h @@ -445,7 +445,8 @@ extern float hypotf (float, float); simply call the double functions. On Cygwin the long double functions are implemented independently from newlib to be able to use optimized assembler functions despite using the Microsoft x86_64 ABI. */ -#if defined (_LDBL_EQ_DBL) || defined (__CYGWIN__) +#if defined (_LDBL_EQ_DBL) || defined (__CYGWIN__) || \ + defined(__aarch64__) || defined(__i386__) || defined(__x86_64__) /* Reentrant ANSI C functions. */ #ifndef __math_68881 extern long double atanl (long double); diff --git a/newlib/libc/machine/aarch64/machine/_fpmath.h b/newlib/libc/machine/aarch64/machine/_fpmath.h index 71d0a7152..fa62ae81c 100644 --- a/newlib/libc/machine/aarch64/machine/_fpmath.h +++ b/newlib/libc/machine/aarch64/machine/_fpmath.h @@ -27,19 +27,25 @@ * $FreeBSD$ */ +/* + * Change unsigned int/long used by FreeBSD to fixed width types because + * ilp32 has a different size for unsigned long. --joel (20 Aug 2022) + */ +#include + union IEEEl2bits { long double e; struct { - unsigned long manl :64; - unsigned long manh :48; - unsigned int exp :15; - unsigned int sign :1; + uint64_t manl :64; + uint64_t manh :48; + uint32_t exp :15; + uint32_t sign :1; } bits; /* TODO andrew: Check the packing here */ struct { - unsigned long manl :64; - unsigned long manh :48; - unsigned int expsign :16; + uint64_t manl :64; + uint64_t manh :48; + uint32_t expsign :16; } xbits; }; diff --git a/newlib/libm/Makefile.inc b/newlib/libm/Makefile.inc index 9d1469555..075693a73 100644 --- a/newlib/libm/Makefile.inc +++ b/newlib/libm/Makefile.inc @@ -44,12 +44,18 @@ else include %D%/math/Makefile.inc endif include %D%/common/Makefile.inc + +if HAVE_FPMATH_H +include %D%/ld/Makefile.inc +endif # HAVE_FPMATH_H + include %D%/complex/Makefile.inc include %D%/fenv/Makefile.inc include %D%/test/Makefile.inc if HAVE_LIBM_MACHINE_AARCH64 include %D%/machine/aarch64/Makefile.inc +include %D%/ld128/Makefile.inc endif if HAVE_LIBM_MACHINE_AMDGCN include %D%/machine/amdgcn/Makefile.inc @@ -59,6 +65,7 @@ include %D%/machine/arm/Makefile.inc endif if HAVE_LIBM_MACHINE_I386 include %D%/machine/i386/Makefile.inc +include %D%/ld80/Makefile.inc endif if HAVE_LIBM_MACHINE_MIPS include %D%/machine/mips/Makefile.inc @@ -83,6 +90,7 @@ include %D%/machine/riscv/Makefile.inc endif if HAVE_LIBM_MACHINE_X86_64 include %D%/machine/x86_64/Makefile.inc +include %D%/ld80/Makefile.inc endif CLEANFILES += \ diff --git a/newlib/libm/ld/Makefile.inc b/newlib/libm/ld/Makefile.inc new file mode 100644 index 000000000..891a89cc5 --- /dev/null +++ b/newlib/libm/ld/Makefile.inc @@ -0,0 +1,56 @@ +%C%_lsrc = \ + %D%/e_acoshl.c \ + %D%/e_acosl.c \ + %D%/e_asinl.c \ + %D%/e_atan2l.c \ + %D%/e_atanhl.c \ + %D%/e_coshl.c \ + %D%/e_fmodl.c \ + %D%/e_lgammal.c \ + %D%/e_remainderl.c \ + %D%/e_sinhl.c \ + %D%/s_asinhl.c \ + %D%/s_atanl.c \ + %D%/s_cbrtl.c \ + %D%/s_ceill.c \ + %D%/s_copysignl.c \ + %D%/s_cosl.c \ + %D%/s_fabsl.c \ + %D%/fdiml.c \ + %D%/s_floorl.c \ + %D%/s_fmal.c \ + %D%/s_fmaxl.c \ + %D%/s_fminl.c \ + %D%/s_frexpl.c \ + %D%/s_ilogbl.c \ + %D%/s_llrintl.c \ + %D%/s_llroundl.c \ + %D%/s_logbl.c \ + %D%/s_lrint.c \ + %D%/s_lrintl.c \ + %D%/s_lround.c \ + %D%/s_lroundl.c \ + %D%/s_modfl.c \ + %D%/s_nearbyintl.c \ + %D%/s_nextafterl.c \ + %D%/s_nexttoward.c \ + %D%/s_nexttowardf.c \ + %D%/s_remquol.c \ + %D%/s_rintl.c \ + %D%/s_roundl.c \ + %D%/scalblnl.c \ + %D%/s_scalbnl.c \ + %D%/s_sinl.c \ + %D%/s_tanhl.c \ + %D%/s_tanl.c \ + %D%/s_truncl.c + +libm_a_CFLAGS_%C% = -fbuiltin -fno-math-errno + +if HAVE_LONG_DOUBLE +libm_a_SOURCES += $(%C%_lsrc) +endif # HAVE_LONG_DOUBLE + +LIBM_CHEWOUT_FILES += + +LIBM_CHAPTERS += diff --git a/newlib/libm/ld/e_lgammal.c b/newlib/libm/ld/e_lgammal.c index ebc2fc78c..0e6a0c39b 100644 --- a/newlib/libm/ld/e_lgammal.c +++ b/newlib/libm/ld/e_lgammal.c @@ -16,6 +16,8 @@ __FBSDID("$FreeBSD$"); #include "math.h" #include "math_private.h" +long double lgammal_r(long double x, int *signp); + extern int signgam; long double diff --git a/newlib/libm/ld/s_fdim.c b/newlib/libm/ld/fdiml.c similarity index 93% rename from newlib/libm/ld/s_fdim.c rename to newlib/libm/ld/fdiml.c index c40c3e9d3..dfdb4e63d 100644 --- a/newlib/libm/ld/s_fdim.c +++ b/newlib/libm/ld/fdiml.c @@ -43,6 +43,13 @@ fn(type x, type y) \ return (x > y ? x - y : 0.0); \ } +/* + * fdim and fdimf are defined elsewhere in + * newlib. Ignore the freebsd versions and only compile + * fdiml. + */ +#if 0 DECL(double, fdim) DECL(float, fdimf) +#endif DECL(long double, fdiml) diff --git a/newlib/libm/ld/fpmath.h b/newlib/libm/ld/fpmath.h index ce935eb40..517960b10 100644 --- a/newlib/libm/ld/fpmath.h +++ b/newlib/libm/ld/fpmath.h @@ -32,8 +32,8 @@ #ifndef _FPMATH_H_ #define _FPMATH_H_ -#include -#include "_fpmath.h" +#include +#include "machine/_fpmath.h" /* changed to machine for newlib */ #ifndef _IEEE_WORD_ORDER #define _IEEE_WORD_ORDER _BYTE_ORDER diff --git a/newlib/libm/ld/invtrig.h b/newlib/libm/ld/invtrig.h new file mode 100644 index 000000000..028807f86 --- /dev/null +++ b/newlib/libm/ld/invtrig.h @@ -0,0 +1,34 @@ +/* + * COPYRIGHT (c) 1989-1999. + * On-Line Applications Research Corporation (OAR). + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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. + * + * 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. + */ + +#if LDBL_MANT_DIG == 64 +#include "../ld80/invtrig.h" +#elif LDBL_MANT_DIG == 113 +#include "../ld128/invtrig.h" +#else +#error "Unsupported long double format" +#endif + diff --git a/newlib/libm/ld/k_expl.h b/newlib/libm/ld/k_expl.h new file mode 100644 index 000000000..721a91280 --- /dev/null +++ b/newlib/libm/ld/k_expl.h @@ -0,0 +1,33 @@ +/* + * COPYRIGHT (c) 1989-1999. + * On-Line Applications Research Corporation (OAR). + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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. + * + * 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. + */ + +#if LDBL_MANT_DIG == 64 +#include "../ld80/k_expl.h" +#elif LDBL_MANT_DIG == 113 +#include "../ld128/k_expl.h" +#else +#error "Unsupported long double format" +#endif diff --git a/newlib/libm/ld/math_private.h b/newlib/libm/ld/math_private.h index df526e71e..28c4d1304 100644 --- a/newlib/libm/ld/math_private.h +++ b/newlib/libm/ld/math_private.h @@ -20,6 +20,23 @@ #include #include +/* + * __double_t and __float_t are defined elsewhere in + * freebsd and used to define double_t and float_t. + * Newlib has already went through the process of + * defining double_t and float_t so we should be able + * to use them to define __double_t and __float_t for + * this file. + */ +typedef double_t __double_t; +typedef float_t __float_t; + +/* + * Necessary to disable Protection Enabled specific + * Free-bsd source. + */ +#define NO_FPSETPREC + /* * The original fdlibm code used statements like: * n0 = ((*(int*)&one)>>29)^1; * index of high word * @@ -644,7 +661,7 @@ rnintl(long double x) * return type provided their arg is a floating point integer. They can * sometimes be more efficient because no rounding is required. */ -#if defined(amd64) || defined(__i386__) +#if defined(amd64) || (defined(__i386__) && (!defined _SOFT_FLOAT)) #define irint(x) \ (sizeof(x) == sizeof(float) && \ sizeof(__float_t) == sizeof(long double) ? irintf(x) : \ @@ -677,7 +694,7 @@ irintd(double x) } #endif -#if defined(__amd64__) || defined(__i386__) +#if defined(__amd64__) || (defined(__i386__) && (!defined _SOFT_FLOAT)) static __inline int irintl(long double x) { diff --git a/newlib/libm/ld/s_ilogbl.c b/newlib/libm/ld/s_ilogbl.c index 3211f4409..37e6f7ba6 100644 --- a/newlib/libm/ld/s_ilogbl.c +++ b/newlib/libm/ld/s_ilogbl.c @@ -23,7 +23,7 @@ int ilogbl(long double x) { union IEEEl2bits u; - unsigned long m; + uint64_t m; int b; u.e = x; @@ -32,11 +32,11 @@ ilogbl(long double x) return (FP_ILOGB0); /* denormalized */ if (u.bits.manh == 0) { - m = 1lu << (LDBL_MANL_SIZE - 1); + m = 1llu << (LDBL_MANL_SIZE - 1); for (b = LDBL_MANH_SIZE; !(u.bits.manl & m); m >>= 1) b++; } else { - m = 1lu << (LDBL_MANH_SIZE - 1); + m = 1llu << (LDBL_MANH_SIZE - 1); for (b = 0; !(u.bits.manh & m); m >>= 1) b++; } diff --git a/newlib/libm/ld/s_logbl.c b/newlib/libm/ld/s_logbl.c index ee1a91fd8..90ce6ec04 100644 --- a/newlib/libm/ld/s_logbl.c +++ b/newlib/libm/ld/s_logbl.c @@ -23,7 +23,7 @@ long double logbl(long double x) { union IEEEl2bits u; - unsigned long m; + uint64_t m; int b; u.e = x; @@ -34,11 +34,11 @@ logbl(long double x) } /* denormalized */ if (u.bits.manh == 0) { - m = 1lu << (LDBL_MANL_SIZE - 1); + m = 1llu << (LDBL_MANL_SIZE - 1); for (b = LDBL_MANH_SIZE; !(u.bits.manl & m); m >>= 1) b++; } else { - m = 1lu << (LDBL_MANH_SIZE - 1); + m = 1llu << (LDBL_MANH_SIZE - 1); for (b = 0; !(u.bits.manh & m); m >>= 1) b++; } diff --git a/newlib/libm/ld/s_lround.c b/newlib/libm/ld/s_lround.c index 1dd8e697f..f67f9fbeb 100644 --- a/newlib/libm/ld/s_lround.c +++ b/newlib/libm/ld/s_lround.c @@ -27,7 +27,7 @@ */ #include -#include +#include #include #include diff --git a/newlib/libm/ld/s_nearbyint.c b/newlib/libm/ld/s_nearbyintl.c similarity index 94% rename from newlib/libm/ld/s_nearbyint.c rename to newlib/libm/ld/s_nearbyintl.c index 796dbaf98..9befed4df 100644 --- a/newlib/libm/ld/s_nearbyint.c +++ b/newlib/libm/ld/s_nearbyintl.c @@ -56,6 +56,13 @@ fn(type x) \ return (ret); \ } +/* + * nearbyint and nearbyintf are defined elsewhere in + * newlib. Ignore the freebsd versions and only compile + * nearbyintl. + */ +#if 0 DECL(double, nearbyint, rint) DECL(float, nearbyintf, rintf) +#endif DECL(long double, nearbyintl, rintl) diff --git a/newlib/libm/ld/s_scalbln.c b/newlib/libm/ld/scalblnl.c similarity index 93% rename from newlib/libm/ld/s_scalbln.c rename to newlib/libm/ld/scalblnl.c index c27420c92..b0a0fc323 100644 --- a/newlib/libm/ld/s_scalbln.c +++ b/newlib/libm/ld/scalblnl.c @@ -34,6 +34,12 @@ __FBSDID("$FreeBSD$"); #define NMAX 65536 #define NMIN -65536 +/* + * scalbln and scalblnf are defined elsewhere in + * newlib. Ignore the freebsd versions and only compile + * scalblnl. + */ +#if 0 double scalbln(double x, long n) { @@ -47,6 +53,7 @@ scalblnf(float x, long n) return (scalbnf(x, (n > NMAX) ? NMAX : (n < NMIN) ? NMIN : (int)n)); } +#endif long double scalblnl(long double x, long n) diff --git a/newlib/libm/ld128/Makefile.inc b/newlib/libm/ld128/Makefile.inc new file mode 100644 index 000000000..43706c4e9 --- /dev/null +++ b/newlib/libm/ld128/Makefile.inc @@ -0,0 +1,14 @@ +%C%_lsrc = \ + %D%/e_powl.c %D%/s_erfl.c %D%/s_exp2l.c %D%/s_expl.c \ + %D%/s_logl.c %D%/b_tgammal.c %D%/invtrig.c \ + %D%/e_lgammal_r.c %D%/k_cosl.c %D%/k_sinl.c + +libm_a_CFLAGS_%C% = -fbuiltin -fno-math-errno + +if HAVE_LONG_DOUBLE +libm_a_SOURCES += $(%C%_lsrc) +endif # HAVE_LONG_DOUBLE + +LIBM_CHEWOUT_FILES += + +LIBM_CHAPTERS += diff --git a/newlib/libm/ld128/e_lgammal_r.c b/newlib/libm/ld128/e_lgammal_r.c index 53d3af17d..37e041aba 100644 --- a/newlib/libm/ld128/e_lgammal_r.c +++ b/newlib/libm/ld128/e_lgammal_r.c @@ -19,9 +19,9 @@ __FBSDID("$FreeBSD$"); * Converted to long double by Steven G. Kargl. */ -#include "fpmath.h" +#include "../ld/fpmath.h" #include "math.h" -#include "math_private.h" +#include "../ld/math_private.h" static const volatile double vzero = 0; diff --git a/newlib/libm/ld128/e_powl.c b/newlib/libm/ld128/e_powl.c index 12b92a1a9..ea68f87ba 100644 --- a/newlib/libm/ld128/e_powl.c +++ b/newlib/libm/ld128/e_powl.c @@ -65,7 +65,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include "math_private.h" +#include "../ld/math_private.h" static const long double bp[] = { 1.0L, diff --git a/newlib/libm/ld128/e_rem_pio2l.h b/newlib/libm/ld128/e_rem_pio2l.h index 7516ced49..be1410283 100644 --- a/newlib/libm/ld128/e_rem_pio2l.h +++ b/newlib/libm/ld128/e_rem_pio2l.h @@ -25,7 +25,7 @@ __FBSDID("$FreeBSD$"); #include #include "math.h" -#include "math_private.h" +#include "../ld/math_private.h" #include "../ld/fpmath.h" #define BIAS (LDBL_MAX_EXP - 1) diff --git a/newlib/libm/ld128/invtrig.h b/newlib/libm/ld128/invtrig.h index 423b56847..eaa801d43 100644 --- a/newlib/libm/ld128/invtrig.h +++ b/newlib/libm/ld128/invtrig.h @@ -30,7 +30,7 @@ #include -#include "fpmath.h" +#include "../ld/fpmath.h" #define BIAS (LDBL_MAX_EXP - 1) #define MANH_SIZE (LDBL_MANH_SIZE + 1) diff --git a/newlib/libm/ld128/k_cosl.c b/newlib/libm/ld128/k_cosl.c index 422357bf8..897180f1c 100644 --- a/newlib/libm/ld128/k_cosl.c +++ b/newlib/libm/ld128/k_cosl.c @@ -17,8 +17,8 @@ __FBSDID("$FreeBSD$"); /* * ld128 version of k_cos.c. See ../src/k_cos.c for most comments. */ - -#include "math_private.h" +#include +#include "../ld/math_private.h" /* * Domain [-0.7854, 0.7854], range ~[-1.17e-39, 1.19e-39]: diff --git a/newlib/libm/ld128/k_sinl.c b/newlib/libm/ld128/k_sinl.c index 09472d65f..a4a4d183f 100644 --- a/newlib/libm/ld128/k_sinl.c +++ b/newlib/libm/ld128/k_sinl.c @@ -17,8 +17,8 @@ __FBSDID("$FreeBSD$"); /* * ld128 version of k_sin.c. See ../src/k_sin.c for most comments. */ - -#include "math_private.h" +#include +#include "../ld/math_private.h" static const double half = 0.5; diff --git a/newlib/libm/ld128/s_erfl.c b/newlib/libm/ld128/s_erfl.c index e29c9691f..d9b17b59f 100644 --- a/newlib/libm/ld128/s_erfl.c +++ b/newlib/libm/ld128/s_erfl.c @@ -20,9 +20,9 @@ __FBSDID("$FreeBSD$"); */ #include -#include "fpmath.h" +#include "../ld/fpmath.h" #include "math.h" -#include "math_private.h" +#include "../ld/math_private.h" /* XXX Prevent compilers from erroneously constant folding these: */ static const volatile long double tiny = 0x1p-10000L; diff --git a/newlib/libm/ld128/s_exp2l.c b/newlib/libm/ld128/s_exp2l.c index ee3d2c782..da0d5f9e0 100644 --- a/newlib/libm/ld128/s_exp2l.c +++ b/newlib/libm/ld128/s_exp2l.c @@ -32,7 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include "fpmath.h" +#include "../ld/fpmath.h" #include "math.h" #define TBLBITS 7 diff --git a/newlib/libm/ld128/s_expl.c b/newlib/libm/ld128/s_expl.c index 5b786af49..29fcda350 100644 --- a/newlib/libm/ld128/s_expl.c +++ b/newlib/libm/ld128/s_expl.c @@ -37,9 +37,9 @@ __FBSDID("$FreeBSD$"); #include -#include "fpmath.h" +#include "../ld/fpmath.h" #include "math.h" -#include "math_private.h" +#include "../ld/math_private.h" #include "k_expl.h" /* XXX Prevent compilers from erroneously constant folding these: */ diff --git a/newlib/libm/ld128/s_logl.c b/newlib/libm/ld128/s_logl.c index 4774a271e..3b00d47ad 100644 --- a/newlib/libm/ld128/s_logl.c +++ b/newlib/libm/ld128/s_logl.c @@ -81,12 +81,12 @@ __FBSDID("$FreeBSD$"); #include #endif -#include "fpmath.h" +#include "../ld/fpmath.h" #include "math.h" #ifndef NO_STRUCT_RETURN #define STRUCT_RETURN #endif -#include "math_private.h" +#include "../ld/math_private.h" #if !defined(NO_UTAB) && !defined(NO_UTABL) #define USE_UTAB diff --git a/newlib/libm/ld80/Makefile.inc b/newlib/libm/ld80/Makefile.inc new file mode 100644 index 000000000..e87d00316 --- /dev/null +++ b/newlib/libm/ld80/Makefile.inc @@ -0,0 +1,15 @@ +%C%_lsrc = \ + %D%/b_tgammal.c %D%/e_powl.c %D%/s_erfl.c %D%/s_exp2l.c \ + %D%/s_expl.c %D%/s_logl.c %D%/s_sinpil.c %D%/s_cospil.c \ + %D%/invtrig.c %D%/e_lgammal_r.c %D%/k_cosl.c %D%/k_sinl.c + + +libm_a_CFLAGS_%C% = -fbuiltin -fno-math-errno + +if HAVE_LONG_DOUBLE +libm_a_SOURCES += $(%C%_lsrc) +endif # HAVE_LONG_DOUBLE + +LIBM_CHEWOUT_FILES += + +LIBM_CHAPTERS += diff --git a/newlib/libm/ld80/b_expl.c b/newlib/libm/ld80/b_expl.c index 21bacf449..502fb4720 100644 --- a/newlib/libm/ld80/b_expl.c +++ b/newlib/libm/ld80/b_expl.c @@ -35,8 +35,8 @@ * bsdrc/b_exp.c converted to long double by Steven G. Kargl. */ -#include "fpmath.h" -#include "math_private.h" +#include "../ld/fpmath.h" +#include "../ld/math_private.h" static const union IEEEl2bits p0u = LD80C(0xaaaaaaaaaaaaaaab, -3, 1.66666666666666666671e-01L), diff --git a/newlib/libm/ld80/b_tgammal.c b/newlib/libm/ld80/b_tgammal.c index 121248adb..e36557bcf 100644 --- a/newlib/libm/ld80/b_tgammal.c +++ b/newlib/libm/ld80/b_tgammal.c @@ -55,9 +55,12 @@ #include #endif -#include "fpmath.h" +#include "../ld/fpmath.h" #include "math.h" -#include "math_private.h" +#include "../ld/math_private.h" + +long double sinpil(long double x); +long double cospil(long double x); /* Used in b_log.c and below. */ struct Double { diff --git a/newlib/libm/ld80/e_lgammal_r.c b/newlib/libm/ld80/e_lgammal_r.c index f56758b18..4fcaa7445 100644 --- a/newlib/libm/ld80/e_lgammal_r.c +++ b/newlib/libm/ld80/e_lgammal_r.c @@ -23,9 +23,9 @@ __FBSDID("$FreeBSD$"); #include #endif -#include "fpmath.h" +#include "../ld/fpmath.h" #include "math.h" -#include "math_private.h" +#include "../ld/math_private.h" static const volatile double vzero = 0; diff --git a/newlib/libm/ld80/e_powl.c b/newlib/libm/ld80/e_powl.c index ea25354c2..6c11c73d0 100644 --- a/newlib/libm/ld80/e_powl.c +++ b/newlib/libm/ld80/e_powl.c @@ -19,7 +19,7 @@ __FBSDID("$FreeBSD$"); #include -#include "math_private.h" +#include "../ld/math_private.h" /* * Polynomial evaluator: @@ -122,7 +122,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include "math_private.h" +#include "../ld/math_private.h" /* Table size */ #define NXT 32 diff --git a/newlib/libm/ld80/e_rem_pio2l.h b/newlib/libm/ld80/e_rem_pio2l.h index b7ef5d983..00b0eb74d 100644 --- a/newlib/libm/ld80/e_rem_pio2l.h +++ b/newlib/libm/ld80/e_rem_pio2l.h @@ -25,7 +25,7 @@ __FBSDID("$FreeBSD$"); #include #include "math.h" -#include "math_private.h" +#include "../ld/math_private.h" #include "../ld/fpmath.h" #define BIAS (LDBL_MAX_EXP - 1) diff --git a/newlib/libm/ld80/invtrig.h b/newlib/libm/ld80/invtrig.h index be06a044b..4a2469ed6 100644 --- a/newlib/libm/ld80/invtrig.h +++ b/newlib/libm/ld80/invtrig.h @@ -30,7 +30,7 @@ #include -#include "fpmath.h" +#include "../ld/fpmath.h" #define BIAS (LDBL_MAX_EXP - 1) #define MANH_SIZE LDBL_MANH_SIZE diff --git a/newlib/libm/ld80/k_cosl.c b/newlib/libm/ld80/k_cosl.c index 6dde6adad..9430d5a1c 100644 --- a/newlib/libm/ld80/k_cosl.c +++ b/newlib/libm/ld80/k_cosl.c @@ -17,8 +17,8 @@ __FBSDID("$FreeBSD$"); /* * ld80 version of k_cos.c. See ../src/k_cos.c for most comments. */ - -#include "math_private.h" +#include +#include "../ld/math_private.h" /* * Domain [-0.7854, 0.7854], range ~[-2.43e-23, 2.425e-23]: diff --git a/newlib/libm/ld80/k_sinl.c b/newlib/libm/ld80/k_sinl.c index af5598dba..d88c89708 100644 --- a/newlib/libm/ld80/k_sinl.c +++ b/newlib/libm/ld80/k_sinl.c @@ -17,8 +17,8 @@ __FBSDID("$FreeBSD$"); /* * ld80 version of k_sin.c. See ../src/k_sin.c for most comments. */ - -#include "math_private.h" +#include +#include "../ld/math_private.h" static const double half = 0.5; diff --git a/newlib/libm/ld80/s_cospil.c b/newlib/libm/ld80/s_cospil.c index 199479e9e..75ec27d0c 100644 --- a/newlib/libm/ld80/s_cospil.c +++ b/newlib/libm/ld80/s_cospil.c @@ -33,9 +33,9 @@ #endif #include -#include "fpmath.h" +#include "../ld/fpmath.h" #include "math.h" -#include "math_private.h" +#include "../ld/math_private.h" static const double pi_hi = 3.1415926814079285e+00, /* 0x400921fb 0x58000000 */ diff --git a/newlib/libm/ld80/s_erfl.c b/newlib/libm/ld80/s_erfl.c index 1ae2f9092..06fca5d28 100644 --- a/newlib/libm/ld80/s_erfl.c +++ b/newlib/libm/ld80/s_erfl.c @@ -23,9 +23,9 @@ __FBSDID("$FreeBSD$"); #include #endif -#include "fpmath.h" +#include "../ld/fpmath.h" #include "math.h" -#include "math_private.h" +#include "../ld/math_private.h" /* XXX Prevent compilers from erroneously constant folding: */ static const volatile long double tiny = 0x1p-10000L; diff --git a/newlib/libm/ld80/s_exp2l.c b/newlib/libm/ld80/s_exp2l.c index 421d6e2e0..552956b8b 100644 --- a/newlib/libm/ld80/s_exp2l.c +++ b/newlib/libm/ld80/s_exp2l.c @@ -36,9 +36,9 @@ __FBSDID("$FreeBSD$"); #include #endif -#include "fpmath.h" +#include "../ld/fpmath.h" #include "math.h" -#include "math_private.h" +#include "../ld/math_private.h" #define TBLBITS 7 #define TBLSIZE (1 << TBLBITS) diff --git a/newlib/libm/ld80/s_expl.c b/newlib/libm/ld80/s_expl.c index e46e73f0c..81469e00f 100644 --- a/newlib/libm/ld80/s_expl.c +++ b/newlib/libm/ld80/s_expl.c @@ -47,9 +47,9 @@ __FBSDID("$FreeBSD$"); #include #endif -#include "fpmath.h" +#include "../ld/fpmath.h" #include "math.h" -#include "math_private.h" +#include "../ld/math_private.h" #include "k_expl.h" /* XXX Prevent compilers from erroneously constant folding these: */ diff --git a/newlib/libm/ld80/s_logl.c b/newlib/libm/ld80/s_logl.c index c74519caf..01e541b49 100644 --- a/newlib/libm/ld80/s_logl.c +++ b/newlib/libm/ld80/s_logl.c @@ -85,13 +85,13 @@ __FBSDID("$FreeBSD$"); #include #endif -#include "fpmath.h" +#include "../ld/fpmath.h" #include "math.h" #define i386_SSE_GOOD #ifndef NO_STRUCT_RETURN #define STRUCT_RETURN #endif -#include "math_private.h" +#include "../ld/math_private.h" #if !defined(NO_UTAB) && !defined(NO_UTABL) #define USE_UTAB diff --git a/newlib/libm/ld80/s_sinpil.c b/newlib/libm/ld80/s_sinpil.c index 4cefa9235..671a6a007 100644 --- a/newlib/libm/ld80/s_sinpil.c +++ b/newlib/libm/ld80/s_sinpil.c @@ -33,9 +33,9 @@ #endif #include -#include "fpmath.h" +#include "../ld/fpmath.h" #include "math.h" -#include "math_private.h" +#include "../ld/math_private.h" static const union IEEEl2bits pi_hi_u = LD80C(0xc90fdaa200000000, 1, 3.14159265346825122833e+00L), -- 2.31.1