aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/powerpcspe
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/powerpcspe')
-rw-r--r--lib/libc/powerpcspe/Makefile.inc1
-rw-r--r--lib/libc/powerpcspe/_fpmath.h56
-rw-r--r--lib/libc/powerpcspe/gen/Makefile.inc1
-rw-r--r--lib/libc/powerpcspe/gen/flt_rounds.c1
-rw-r--r--lib/libc/powerpcspe/gen/fpgetmask.c1
-rw-r--r--lib/libc/powerpcspe/gen/fpgetround.c1
-rw-r--r--lib/libc/powerpcspe/gen/fpgetsticky.c5
-rw-r--r--lib/libc/powerpcspe/gen/fpsetmask.c1
-rw-r--r--lib/libc/powerpcspe/gen/fpsetround.c1
-rw-r--r--lib/libc/powerpcspe/sys/Makefile.inc3
10 files changed, 56 insertions, 15 deletions
diff --git a/lib/libc/powerpcspe/Makefile.inc b/lib/libc/powerpcspe/Makefile.inc
index 6962e107ed4d..0b5879574480 100644
--- a/lib/libc/powerpcspe/Makefile.inc
+++ b/lib/libc/powerpcspe/Makefile.inc
@@ -1,4 +1,3 @@
-
CFLAGS+= -I${LIBC_SRCTOP}/powerpc
# Long double is 64-bits
diff --git a/lib/libc/powerpcspe/_fpmath.h b/lib/libc/powerpcspe/_fpmath.h
new file mode 100644
index 000000000000..9bc7450aacaf
--- /dev/null
+++ b/lib/libc/powerpcspe/_fpmath.h
@@ -0,0 +1,56 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2003 David Schultz <das@FreeBSD.ORG>
+ * 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 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 AUTHOR 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.
+ */
+
+union IEEEl2bits {
+ long double e;
+ struct {
+#if _BYTE_ORDER == _LITTLE_ENDIAN
+ unsigned int manl :32;
+ unsigned int manh :20;
+ unsigned int exp :11;
+ unsigned int sign :1;
+#else /* _BYTE_ORDER == _LITTLE_ENDIAN */
+ unsigned int sign :1;
+ unsigned int exp :11;
+ unsigned int manh :20;
+ unsigned int manl :32;
+#endif
+ } bits;
+};
+
+#define mask_nbit_l(u) ((void)0)
+#define LDBL_IMPLICIT_NBIT
+#define LDBL_NBIT 0
+
+#define LDBL_MANH_SIZE 20
+#define LDBL_MANL_SIZE 32
+
+#define LDBL_TO_ARRAY32(u, a) do { \
+ (a)[0] = (uint32_t)(u).bits.manl; \
+ (a)[1] = (uint32_t)(u).bits.manh; \
+} while(0)
diff --git a/lib/libc/powerpcspe/gen/Makefile.inc b/lib/libc/powerpcspe/gen/Makefile.inc
index efdc778e8999..502f3dc231bf 100644
--- a/lib/libc/powerpcspe/gen/Makefile.inc
+++ b/lib/libc/powerpcspe/gen/Makefile.inc
@@ -1,4 +1,3 @@
-
.include "${LIBC_SRCTOP}/powerpc/gen/Makefile.common"
SRCS += fabs.S flt_rounds.c fpgetmask.c fpgetround.c \
diff --git a/lib/libc/powerpcspe/gen/flt_rounds.c b/lib/libc/powerpcspe/gen/flt_rounds.c
index eec1d3a05693..26dfca0e0e3a 100644
--- a/lib/libc/powerpcspe/gen/flt_rounds.c
+++ b/lib/libc/powerpcspe/gen/flt_rounds.c
@@ -31,7 +31,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
#include <sys/types.h>
#include <machine/float.h>
#include <machine/spr.h>
diff --git a/lib/libc/powerpcspe/gen/fpgetmask.c b/lib/libc/powerpcspe/gen/fpgetmask.c
index b46a52fae220..f7679be4ca54 100644
--- a/lib/libc/powerpcspe/gen/fpgetmask.c
+++ b/lib/libc/powerpcspe/gen/fpgetmask.c
@@ -30,7 +30,6 @@
*
*/
-#include <sys/cdefs.h>
#include <sys/types.h>
#include <machine/spr.h>
#include <ieeefp.h>
diff --git a/lib/libc/powerpcspe/gen/fpgetround.c b/lib/libc/powerpcspe/gen/fpgetround.c
index 1021a1ad4cc6..9c01bcbaf327 100644
--- a/lib/libc/powerpcspe/gen/fpgetround.c
+++ b/lib/libc/powerpcspe/gen/fpgetround.c
@@ -30,7 +30,6 @@
*
*/
-#include <sys/cdefs.h>
#include <sys/types.h>
#include <machine/spr.h>
#include <ieeefp.h>
diff --git a/lib/libc/powerpcspe/gen/fpgetsticky.c b/lib/libc/powerpcspe/gen/fpgetsticky.c
index abe83bb2da31..a97c27296cab 100644
--- a/lib/libc/powerpcspe/gen/fpgetsticky.c
+++ b/lib/libc/powerpcspe/gen/fpgetsticky.c
@@ -29,7 +29,6 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
#include "namespace.h"
@@ -38,10 +37,6 @@
#include <ieeefp.h>
#ifndef _SOFT_FLOAT
-#ifdef __weak_alias
-__weak_alias(fpgetsticky,_fpgetsticky)
-#endif
-
fp_except_t
fpgetsticky()
{
diff --git a/lib/libc/powerpcspe/gen/fpsetmask.c b/lib/libc/powerpcspe/gen/fpsetmask.c
index 0563da982c2e..a7a2569df905 100644
--- a/lib/libc/powerpcspe/gen/fpsetmask.c
+++ b/lib/libc/powerpcspe/gen/fpsetmask.c
@@ -30,7 +30,6 @@
*
*/
-#include <sys/cdefs.h>
#include <sys/types.h>
#include <machine/spr.h>
#include <ieeefp.h>
diff --git a/lib/libc/powerpcspe/gen/fpsetround.c b/lib/libc/powerpcspe/gen/fpsetround.c
index 85b55087935a..2280e190b2f9 100644
--- a/lib/libc/powerpcspe/gen/fpsetround.c
+++ b/lib/libc/powerpcspe/gen/fpsetround.c
@@ -30,7 +30,6 @@
*
*/
-#include <sys/cdefs.h>
#include <sys/types.h>
#include <machine/spr.h>
#include <ieeefp.h>
diff --git a/lib/libc/powerpcspe/sys/Makefile.inc b/lib/libc/powerpcspe/sys/Makefile.inc
deleted file mode 100644
index 8f48df0d6021..000000000000
--- a/lib/libc/powerpcspe/sys/Makefile.inc
+++ /dev/null
@@ -1,3 +0,0 @@
-
-.PATH: ${LIBC_SRCTOP}/powerpc/sys
-.sinclude "${LIBC_SRCTOP}/powerpc/sys/Makefile.inc"