From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 121621 invoked by alias); 29 Sep 2019 16:12:07 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Received: (qmail 121484 invoked by uid 89); 29 Sep 2019 16:12:00 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.8 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=proprietary, H*F:D*eu, mandated, business X-HELO: server28.superhosting.bg Received: from server28.superhosting.bg (HELO server28.superhosting.bg) (217.174.156.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 29 Sep 2019 16:11:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dinux.eu; s=default; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=EOKVkr1vGIOZ/AgSe6xV0dSQDXVBe3WXTQ6/n8FvwKc=; b=WmIuTD8zlLzuml09auaS9BvGqU Fy33Uulp+ZHycz2Gds7cCJ9rYw1bPI9yzVaWU2QAmZRKh8smHajdYO1LCEDHULGg4cxDYawXIEqNK qa6TqxOwQ3vyL+Fa0urbouur7bwQ4uOm5Uvqyk4ldlJ6GYfgXTGn9ZxsptKnunpjjJalFMPFDy6EZ rlO+ES8yV3pZsQjxGDa8k54X20rzL9puCZbK8hbxBjBlNiF6tS1tD6bxmSZOGSl6VnPV0wJixdaw+ IzLEDn3ZqGQ97m0hlVqJpoE+q8u/JtvZ2In8PSzRv0rWZBApbbBULHzonrZ9yzwvOWCJsQDEUQnSR XuYLG5jg==; Received: from [95.87.234.74] (port=50520 helo=localhost.localdomain) by server28.superhosting.bg with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92) (envelope-from ) id 1iEbnX-0001Hp-9q; Sun, 29 Sep 2019 19:11:50 +0300 From: Dimitar Dimitrov To: newlib@sourceware.org Cc: Dimitar Dimitrov Subject: [PATCH v3 2/2] PRU: Align libmath to PRU ABI Date: Sun, 29 Sep 2019 16:12:00 -0000 Message-Id: <20190929161135.24139-3-dimitar@dinux.eu> In-Reply-To: <20190929161135.24139-1-dimitar@dinux.eu> References: <20190929161135.24139-1-dimitar@dinux.eu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-OutGoing-Spam-Status: No, score=-1.0 X-IsSubscribed: yes X-SW-Source: 2019/txt/msg00586.txt.bz2 The TI proprietary toolchain uses nonstandard names for some math library functions. In order to achieve ABI compatibility between GNU and TI toolchains, add support for the TI function names. Signed-off-by: Dimitar Dimitrov --- newlib/configure.host | 1 + newlib/libm/machine/configure.in | 1 + newlib/libm/machine/pru/Makefile.am | 19 ++++++++++++++ newlib/libm/machine/pru/configure.in | 11 ++++++++ newlib/libm/machine/pru/fpclassify.c | 36 +++++++++++++++++++++++++++ newlib/libm/machine/pru/fpclassifyf.c | 36 +++++++++++++++++++++++++++ newlib/libm/machine/pru/isfinite.c | 36 +++++++++++++++++++++++++++ newlib/libm/machine/pru/isfinitef.c | 36 +++++++++++++++++++++++++++ newlib/libm/machine/pru/isinf.c | 36 +++++++++++++++++++++++++++ newlib/libm/machine/pru/isinff.c | 36 +++++++++++++++++++++++++++ newlib/libm/machine/pru/isnan.c | 36 +++++++++++++++++++++++++++ newlib/libm/machine/pru/isnanf.c | 36 +++++++++++++++++++++++++++ newlib/libm/machine/pru/isnormal.c | 36 +++++++++++++++++++++++++++ newlib/libm/machine/pru/isnormalf.c | 36 +++++++++++++++++++++++++++ 14 files changed, 392 insertions(+) create mode 100644 newlib/libm/machine/pru/Makefile.am create mode 100644 newlib/libm/machine/pru/configure.in create mode 100644 newlib/libm/machine/pru/fpclassify.c create mode 100644 newlib/libm/machine/pru/fpclassifyf.c create mode 100644 newlib/libm/machine/pru/isfinite.c create mode 100644 newlib/libm/machine/pru/isfinitef.c create mode 100644 newlib/libm/machine/pru/isinf.c create mode 100644 newlib/libm/machine/pru/isinff.c create mode 100644 newlib/libm/machine/pru/isnan.c create mode 100644 newlib/libm/machine/pru/isnanf.c create mode 100644 newlib/libm/machine/pru/isnormal.c create mode 100644 newlib/libm/machine/pru/isnormalf.c diff --git a/newlib/configure.host b/newlib/configure.host index 6a6066bb2..6ee32ca3d 100644 --- a/newlib/configure.host +++ b/newlib/configure.host @@ -296,6 +296,7 @@ case "${host_cpu}" in default_newlib_nano_malloc="yes" default_newlib_atexit_dynamic_alloc="no" machine_dir=pru + libm_machine_dir=pru ;; riscv*) libm_machine_dir=riscv diff --git a/newlib/libm/machine/configure.in b/newlib/libm/machine/configure.in index 55e2d35c3..5a58b6bed 100644 --- a/newlib/libm/machine/configure.in +++ b/newlib/libm/machine/configure.in @@ -29,6 +29,7 @@ if test -n "${libm_machine_dir}"; then arm) AC_CONFIG_SUBDIRS(arm) ;; i386) AC_CONFIG_SUBDIRS(i386) ;; nds32) AC_CONFIG_SUBDIRS(nds32) ;; + pru) AC_CONFIG_SUBDIRS(pru) ;; spu) AC_CONFIG_SUBDIRS(spu) ;; riscv) AC_CONFIG_SUBDIRS(riscv) ;; esac; diff --git a/newlib/libm/machine/pru/Makefile.am b/newlib/libm/machine/pru/Makefile.am new file mode 100644 index 000000000..69facdf34 --- /dev/null +++ b/newlib/libm/machine/pru/Makefile.am @@ -0,0 +1,19 @@ +## Process this file with automake to generate Makefile.in + +INCLUDES = -I $(newlib_basedir)/../newlib/libm/common $(NEWLIB_CFLAGS) \ + $(CROSS_CFLAGS) $(TARGET_CFLAGS) + +LIB_SOURCES = \ + fpclassify.c fpclassifyf.c isfinite.c isfinitef.c isinf.c \ + isinff.c isnan.c isnanf.c isnormal.c isnormalf.c + +noinst_LIBRARIES = lib.a +lib_a_SOURCES = $(LIB_SOURCES) +lib_a_CFLAGS = $(AM_CFLAGS) +lib_a_CCASFLAGS = $(AM_CCASFLAGS) +noinst_DATA = + +include $(srcdir)/../../../Makefile.shared + +ACLOCAL_AMFLAGS = -I ../../.. -I ../../../.. +CONFIG_STATUS_DEPENDENCIES = $(newlib_basedir)/configure.host diff --git a/newlib/libm/machine/pru/configure.in b/newlib/libm/machine/pru/configure.in new file mode 100644 index 000000000..7a22fa31c --- /dev/null +++ b/newlib/libm/machine/pru/configure.in @@ -0,0 +1,11 @@ + +AC_PREREQ(2.59) +AC_INIT([newlib],[NEWLIB_VERSION]) +AC_CONFIG_SRCDIR([Makefile.am]) + +AC_CONFIG_AUX_DIR(../../../..) + +NEWLIB_CONFIGURE(../../..) + +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/newlib/libm/machine/pru/fpclassify.c b/newlib/libm/machine/pru/fpclassify.c new file mode 100644 index 000000000..3556f6532 --- /dev/null +++ b/newlib/libm/machine/pru/fpclassify.c @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018-2019 Dimitar Dimitrov + * All rights reserved. + * + * 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 AUTHOR ``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 AUTHOR 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 + +/* GCC will not generate code calling this function, since the corresponding + builtin will produce code that uses simple ops only. In order to support + linking against TI CLPRU objects, though, provide the function mandated + by TI ABI. */ +int __pruabi_fpclassify(double a) +{ + return fpclassify(a); +} diff --git a/newlib/libm/machine/pru/fpclassifyf.c b/newlib/libm/machine/pru/fpclassifyf.c new file mode 100644 index 000000000..f4dd201d9 --- /dev/null +++ b/newlib/libm/machine/pru/fpclassifyf.c @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018-2019 Dimitar Dimitrov + * All rights reserved. + * + * 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 AUTHOR ``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 AUTHOR 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 + +/* GCC will not generate code calling this function, since the corresponding + builtin will produce code that uses simple ops only. In order to support + linking against TI CLPRU objects, though, provide the function mandated + by TI ABI. */ +int __pruabi_fpclassifyf(float a) +{ + return fpclassifyf(a); +} diff --git a/newlib/libm/machine/pru/isfinite.c b/newlib/libm/machine/pru/isfinite.c new file mode 100644 index 000000000..2e61877e9 --- /dev/null +++ b/newlib/libm/machine/pru/isfinite.c @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018-2019 Dimitar Dimitrov + * All rights reserved. + * + * 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 AUTHOR ``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 AUTHOR 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 + +/* GCC will not generate code calling this function, since the corresponding + builtin will produce code that uses simple ops only. In order to support + linking against TI CLPRU objects, though, provide the function mandated + by TI ABI. */ +int __pruabi_isfinite(double a) +{ + return isfinite(a); +} diff --git a/newlib/libm/machine/pru/isfinitef.c b/newlib/libm/machine/pru/isfinitef.c new file mode 100644 index 000000000..be88157de --- /dev/null +++ b/newlib/libm/machine/pru/isfinitef.c @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018-2019 Dimitar Dimitrov + * All rights reserved. + * + * 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 AUTHOR ``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 AUTHOR 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 + +/* GCC will not generate code calling this function, since the corresponding + builtin will produce code that uses simple ops only. In order to support + linking against TI CLPRU objects, though, provide the function mandated + by TI ABI. */ +int __pruabi_isfinitef(float a) +{ + return isfinite(a); +} diff --git a/newlib/libm/machine/pru/isinf.c b/newlib/libm/machine/pru/isinf.c new file mode 100644 index 000000000..bd2d883b0 --- /dev/null +++ b/newlib/libm/machine/pru/isinf.c @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018-2019 Dimitar Dimitrov + * All rights reserved. + * + * 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 AUTHOR ``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 AUTHOR 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 + +/* GCC will not generate code calling this function, since the corresponding + builtin will produce code that uses simple ops only. In order to support + linking against TI CLPRU objects, though, provide the function mandated + by TI ABI. */ +int __pruabi_isinf(double a) +{ + return isinf(a); +} diff --git a/newlib/libm/machine/pru/isinff.c b/newlib/libm/machine/pru/isinff.c new file mode 100644 index 000000000..094371050 --- /dev/null +++ b/newlib/libm/machine/pru/isinff.c @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018-2019 Dimitar Dimitrov + * All rights reserved. + * + * 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 AUTHOR ``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 AUTHOR 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 + +/* GCC will not generate code calling this function, since the corresponding + builtin will produce code that uses simple ops only. In order to support + linking against TI CLPRU objects, though, provide the function mandated + by TI ABI. */ +int __pruabi_isinff(float a) +{ + return isinf(a); +} diff --git a/newlib/libm/machine/pru/isnan.c b/newlib/libm/machine/pru/isnan.c new file mode 100644 index 000000000..4d2f4dc1f --- /dev/null +++ b/newlib/libm/machine/pru/isnan.c @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018-2019 Dimitar Dimitrov + * All rights reserved. + * + * 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 AUTHOR ``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 AUTHOR 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 + +/* GCC will not generate code calling this function, since the corresponding + builtin will produce code that uses simple ops only. In order to support + linking against TI CLPRU objects, though, provide the function mandated + by TI ABI. */ +int __pruabi_isnan(double a) +{ + return isnan(a); +} diff --git a/newlib/libm/machine/pru/isnanf.c b/newlib/libm/machine/pru/isnanf.c new file mode 100644 index 000000000..21a2f04ea --- /dev/null +++ b/newlib/libm/machine/pru/isnanf.c @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018-2019 Dimitar Dimitrov + * All rights reserved. + * + * 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 AUTHOR ``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 AUTHOR 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 + +/* GCC will not generate code calling this function, since the corresponding + builtin will produce code that uses simple ops only. In order to support + linking against TI CLPRU objects, though, provide the function mandated + by TI ABI. */ +int __pruabi_isnanf(float a) +{ + return isnan(a); +} diff --git a/newlib/libm/machine/pru/isnormal.c b/newlib/libm/machine/pru/isnormal.c new file mode 100644 index 000000000..915ec0277 --- /dev/null +++ b/newlib/libm/machine/pru/isnormal.c @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018-2019 Dimitar Dimitrov + * All rights reserved. + * + * 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 AUTHOR ``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 AUTHOR 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 + +/* GCC will not generate code calling this function, since the corresponding + builtin will produce code that uses simple ops only. In order to support + linking against TI CLPRU objects, though, provide the function mandated + by TI ABI. */ +int __pruabi_isnormal(double a) +{ + return isnormal(a); +} diff --git a/newlib/libm/machine/pru/isnormalf.c b/newlib/libm/machine/pru/isnormalf.c new file mode 100644 index 000000000..b0e9a45fc --- /dev/null +++ b/newlib/libm/machine/pru/isnormalf.c @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018-2019 Dimitar Dimitrov + * All rights reserved. + * + * 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 AUTHOR ``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 AUTHOR 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 + +/* GCC will not generate code calling this function, since the corresponding + builtin will produce code that uses simple ops only. In order to support + linking against TI CLPRU objects, though, provide the function mandated + by TI ABI. */ +int __pruabi_isnormalf(float a) +{ + return isnormal(a); +} -- 2.20.1