summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/msun/Makefile11
-rw-r--r--lib/msun/src/math_private.h14
-rw-r--r--lib/msun/src/s_copysignf.c2
3 files changed, 21 insertions, 6 deletions
diff --git a/lib/msun/Makefile b/lib/msun/Makefile
index 1fb2169..de814b3 100644
--- a/lib/msun/Makefile
+++ b/lib/msun/Makefile
@@ -42,7 +42,6 @@
#
.if ${MACHINE_ARCH} == "alpha"
-.PATH: ${.CURDIR)/alpha
ARCH= alpha
ARCH_SRCS = s_copysign.S s_copysignf.S
# XXX Comment from NetBSD/Alpha:
@@ -52,7 +51,6 @@ ARCH_SRCS = s_copysign.S s_copysignf.S
#CFLAGS += -mtrap-precision=i -mfp-trap-mode=su
.elif ${MACHINE_ARCH} == "i386"
ARCH= i387
-ARCH_PREFIX= ${ARCH}_
ARCH_SRCS = e_acos.S e_asin.S e_atan2.S e_exp.S e_fmod.S e_log.S e_log10.S \
e_remainder.S e_scalb.S e_sqrt.S s_atan.S s_ceil.S s_copysign.S \
s_cos.S s_finite.S s_floor.S s_ilogb.S s_logb.S \
@@ -62,11 +60,16 @@ ARCH_SRCS = e_acos.S e_asin.S e_atan2.S e_exp.S e_fmod.S e_log.S e_log10.S \
# Broken
# ARCH_SRCS+= s_log1p.S
+.if defined(ARCH)
+.PATH: ${.CURDIR)/${ARCH}
+ARCH_PREFIX= ${ARCH}_
+.endif
+
.PATH: ${.CURDIR}/bsdsrc
.PATH: ${.CURDIR}/man
.PATH: ${.CURDIR}/src
-CFLAGS+= -D_IEEE_LIBM -D_ARCH_INDIRECT=${ARCH_PREFIX}
+CFLAGS+= -D_IEEE_LIBM
LIB= m
COMMON_SRCS= b_exp.c b_log.c b_tgamma.c \
@@ -103,9 +106,9 @@ COMMON_SRCS= b_exp.c b_log.c b_tgamma.c \
# FreeBSD's C library supplies these functions:
#COMMON_SRCS+= s_fabs.c s_frexp.c s_isnan.c s_ldexp.c s_modf.c
-CLEANFILES+= ${RENAMED_ARCH_SRCS}
RENAMED_ARCH_SRCS= ${ARCH_SRCS:S/^/${ARCH_PREFIX}/g}
SRCS= ${COMMON_SRCS} ${RENAMED_ARCH_SRCS}
+CLEANFILES+= ${RENAMED_ARCH_SRCS}
# Generate rules to rename arch-specific sources to avoid conflicts.
# The path to the arch-specific sources is given explicitly instead of
diff --git a/lib/msun/src/math_private.h b/lib/msun/src/math_private.h
index c4a7d2b..d9d854e 100644
--- a/lib/msun/src/math_private.h
+++ b/lib/msun/src/math_private.h
@@ -225,6 +225,19 @@ float __kernel_cosf(float,float);
float __kernel_tanf(float,float,int);
int __kernel_rem_pio2f(float*,float*,int,int,int,const int*);
+/* alpha and i386 provide arch specific copysign() */
+#if defined(__ia64__) || defined(__sparc64__) || \
+ defined(__powerpc__) || defined(__amd64__)
+#define __generic_copysign copysign
+#endif
+
+/* alpha provides arch specific copysignf() */
+#if defined(__i386__) || defined(__ia64__) || defined(__sparc64__) || \
+ defined(__powerpc__) || defined(__amd64__)
+#define __generic_copysignf copysignf
+#endif
+
+/* i386 provides lots of arch specific functions */
#if defined(__alpha__) || defined(__ia64__) || defined(__sparc64__) || \
defined(__powerpc__) || defined(__amd64__)
#define __generic___ieee754_acos __ieee754_acos
@@ -239,7 +252,6 @@ int __kernel_rem_pio2f(float*,float*,int,int,int,const int*);
#define __generic___ieee754_sqrt __ieee754_sqrt
#define __generic_atan atan
#define __generic_ceil ceil
-#define __generic_copysign copysign
#define __generic_cos cos
#define __generic_finite finite
#define __generic_floor floor
diff --git a/lib/msun/src/s_copysignf.c b/lib/msun/src/s_copysignf.c
index df5304f..2bcc055 100644
--- a/lib/msun/src/s_copysignf.c
+++ b/lib/msun/src/s_copysignf.c
@@ -27,7 +27,7 @@ static char rcsid[] = "$FreeBSD$";
#include "math_private.h"
float
-copysignf(float x, float y)
+__generic_copysignf(float x, float y)
{
u_int32_t ix,iy;
GET_FLOAT_WORD(ix,x);
OpenPOWER on IntegriCloud