diff options
author | 2011-08-19 15:44:36 +0000 | |
---|---|---|
committer | 2011-08-19 15:44:36 +0000 | |
commit | e30e335c553edf6c29af9c80dd46e1c09e058c47 (patch) | |
tree | 3934dc94e0cb24223701424f653c4b345d49ea70 | |
parent | Don't mention loadable streams modules are lacking. (diff) | |
download | wireguard-openbsd-e30e335c553edf6c29af9c80dd46e1c09e058c47.tar.xz wireguard-openbsd-e30e335c553edf6c29af9c80dd46e1c09e058c47.zip |
Bring libc and libm in line with the compiler now that we no longer have a
128-bit long double. Diff committed on behalf of martynas@
-rw-r--r-- | lib/libc/arch/hppa64/gen/Makefile.inc | 3 | ||||
-rw-r--r-- | lib/libc/arch/hppa64/gen/fabs.c | 6 | ||||
-rw-r--r-- | lib/libc/arch/hppa64/gen/fpclassifyl.c | 44 | ||||
-rw-r--r-- | lib/libc/arch/hppa64/gen/isfinitel.c | 28 | ||||
-rw-r--r-- | lib/libc/arch/hppa64/gen/isinfl.c | 30 | ||||
-rw-r--r-- | lib/libc/arch/hppa64/gen/isnanl.c | 30 | ||||
-rw-r--r-- | lib/libc/arch/hppa64/gen/isnormall.c | 28 | ||||
-rw-r--r-- | lib/libc/arch/hppa64/gen/signbitl.c | 28 | ||||
-rw-r--r-- | lib/libm/Makefile | 5 | ||||
-rw-r--r-- | sys/arch/hppa64/include/float.h | 20 | ||||
-rw-r--r-- | sys/arch/hppa64/include/ieee.h | 30 |
11 files changed, 19 insertions, 233 deletions
diff --git a/lib/libc/arch/hppa64/gen/Makefile.inc b/lib/libc/arch/hppa64/gen/Makefile.inc index 5fc7f14de70..3e3e1040b1c 100644 --- a/lib/libc/arch/hppa64/gen/Makefile.inc +++ b/lib/libc/arch/hppa64/gen/Makefile.inc @@ -1,10 +1,9 @@ -# $OpenBSD: Makefile.inc,v 1.9 2011/07/08 22:28:33 martynas Exp $ +# $OpenBSD: Makefile.inc,v 1.10 2011/08/19 15:44:36 kettenis Exp $ SRCS+= setjmp.S SRCS+= fabs.c SRCS+= infinity.c ldexp.c modf.c nan.c setjmp.S SRCS+= flt_rounds.c fpgetmask.c fpgetround.c fpgetsticky.c fpsetmask.c \ fpsetround.c fpsetsticky.c -SRCS+= fpclassifyl.c isfinitel.c isinfl.c isnanl.c isnormall.c signbitl.c SRCS+= alloca.c diff --git a/lib/libc/arch/hppa64/gen/fabs.c b/lib/libc/arch/hppa64/gen/fabs.c index 2a31ff0b12c..dbf1d8eea2d 100644 --- a/lib/libc/arch/hppa64/gen/fabs.c +++ b/lib/libc/arch/hppa64/gen/fabs.c @@ -1,9 +1,11 @@ -/* $OpenBSD: fabs.c,v 1.3 2011/07/08 22:28:33 martynas Exp $ */ +/* $OpenBSD: fabs.c,v 1.4 2011/08/19 15:44:36 kettenis Exp $ */ /* * Written by Miodrag Vallat. Public domain */ +#include <sys/cdefs.h> + double fabs(double val) { @@ -11,3 +13,5 @@ fabs(double val) __asm__ __volatile__("fabs,dbl %0,%0" : "+f" (val)); return (val); } + +__weak_alias(fabsl, fabs); diff --git a/lib/libc/arch/hppa64/gen/fpclassifyl.c b/lib/libc/arch/hppa64/gen/fpclassifyl.c deleted file mode 100644 index 030e9c8aac4..00000000000 --- a/lib/libc/arch/hppa64/gen/fpclassifyl.c +++ /dev/null @@ -1,44 +0,0 @@ -/* $OpenBSD: fpclassifyl.c,v 1.1 2008/09/07 20:36:07 martynas Exp $ */ -/* - * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include <sys/types.h> -#include <machine/ieee.h> -#include <math.h> - -int -__fpclassifyl(long double e) -{ - struct ieee_ext *p = (struct ieee_ext *)&e; - - if (p->ext_exp == 0) { - if (p->ext_frach == 0 && p->ext_frachm == 0 && - p->ext_fraclm == 0 && p->ext_fracl == 0) - return FP_ZERO; - else - return FP_SUBNORMAL; - } - - if (p->ext_exp == EXT_EXP_INFNAN) { - if (p->ext_frach == 0 && p->ext_frachm == 0 && - p->ext_fraclm == 0 && p->ext_fracl == 0) - return FP_INFINITE; - else - return FP_NAN; - } - - return FP_NORMAL; -} diff --git a/lib/libc/arch/hppa64/gen/isfinitel.c b/lib/libc/arch/hppa64/gen/isfinitel.c deleted file mode 100644 index 02a5602ea84..00000000000 --- a/lib/libc/arch/hppa64/gen/isfinitel.c +++ /dev/null @@ -1,28 +0,0 @@ -/* $OpenBSD: isfinitel.c,v 1.2 2008/12/09 19:52:33 martynas Exp $ */ -/* - * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include <sys/types.h> -#include <machine/ieee.h> -#include <math.h> - -int -__isfinitel(long double e) -{ - struct ieee_ext *p = (struct ieee_ext *)&e; - - return (p->ext_exp != EXT_EXP_INFNAN); -} diff --git a/lib/libc/arch/hppa64/gen/isinfl.c b/lib/libc/arch/hppa64/gen/isinfl.c deleted file mode 100644 index f83502e8c89..00000000000 --- a/lib/libc/arch/hppa64/gen/isinfl.c +++ /dev/null @@ -1,30 +0,0 @@ -/* $OpenBSD: isinfl.c,v 1.2 2008/12/09 19:52:33 martynas Exp $ */ -/* - * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include <sys/types.h> -#include <machine/ieee.h> -#include <math.h> - -int -__isinfl(long double e) -{ - struct ieee_ext *p = (struct ieee_ext *)&e; - - return (p->ext_exp == EXT_EXP_INFNAN && - p->ext_frach == 0 && p->ext_frachm == 0 && - p->ext_fraclm == 0 && p->ext_fracl == 0); -} diff --git a/lib/libc/arch/hppa64/gen/isnanl.c b/lib/libc/arch/hppa64/gen/isnanl.c deleted file mode 100644 index 85139ade7e8..00000000000 --- a/lib/libc/arch/hppa64/gen/isnanl.c +++ /dev/null @@ -1,30 +0,0 @@ -/* $OpenBSD: isnanl.c,v 1.2 2008/12/09 19:52:33 martynas Exp $ */ -/* - * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include <sys/types.h> -#include <machine/ieee.h> -#include <math.h> - -int -__isnanl(long double e) -{ - struct ieee_ext *p = (struct ieee_ext *)&e; - - return (p->ext_exp == EXT_EXP_INFNAN && - (p->ext_frach != 0 || p->ext_frachm != 0 || - p->ext_fraclm != 0 || p->ext_fracl != 0)); -} diff --git a/lib/libc/arch/hppa64/gen/isnormall.c b/lib/libc/arch/hppa64/gen/isnormall.c deleted file mode 100644 index 97ce382671b..00000000000 --- a/lib/libc/arch/hppa64/gen/isnormall.c +++ /dev/null @@ -1,28 +0,0 @@ -/* $OpenBSD: isnormall.c,v 1.2 2008/12/09 19:52:33 martynas Exp $ */ -/* - * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include <sys/types.h> -#include <machine/ieee.h> -#include <math.h> - -int -__isnormall(long double e) -{ - struct ieee_ext *p = (struct ieee_ext *)&e; - - return (p->ext_exp != 0 && p->ext_exp != EXT_EXP_INFNAN); -} diff --git a/lib/libc/arch/hppa64/gen/signbitl.c b/lib/libc/arch/hppa64/gen/signbitl.c deleted file mode 100644 index 1f9f7ab332d..00000000000 --- a/lib/libc/arch/hppa64/gen/signbitl.c +++ /dev/null @@ -1,28 +0,0 @@ -/* $OpenBSD: signbitl.c,v 1.1 2008/12/09 19:52:33 martynas Exp $ */ -/* - * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include <sys/types.h> -#include <machine/ieee.h> -#include <math.h> - -int -__signbitl(long double e) -{ - struct ieee_ext *p = (struct ieee_ext *)&e; - - return p->ext_sign; -} diff --git a/lib/libm/Makefile b/lib/libm/Makefile index 9cfe9d3f39f..be71bea7260 100644 --- a/lib/libm/Makefile +++ b/lib/libm/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.96 2011/07/24 19:25:50 martynas Exp $ +# $OpenBSD: Makefile,v 1.97 2011/08/19 15:44:36 kettenis Exp $ # $NetBSD: Makefile,v 1.28 1995/11/20 22:06:19 jtc Exp $ # # @(#)Makefile 5.1beta 93/09/24 @@ -165,8 +165,7 @@ SRCS= ${COMMON_SRCS} CPPFLAGS+= -I${.CURDIR}/src -I${.CURDIR}/src/ld80 SRCS+= ${LONG_SRCS} .endif -.if (${MACHINE_ARCH} == "hppa64") || (${MACHINE_CPU} == "mips64") || \ - (${MACHINE_ARCH} == "sparc64") +.if (${MACHINE_CPU} == "mips64") || (${MACHINE_ARCH} == "sparc64") .PATH: ${.CURDIR}/src/ld128 CPPFLAGS+= -I${.CURDIR}/src -I${.CURDIR}/src/ld128 SRCS+= ${LONG_SRCS} diff --git a/sys/arch/hppa64/include/float.h b/sys/arch/hppa64/include/float.h index 8c7b4e7abb0..26f275082b8 100644 --- a/sys/arch/hppa64/include/float.h +++ b/sys/arch/hppa64/include/float.h @@ -1,4 +1,4 @@ -/* $OpenBSD: float.h,v 1.3 2011/03/23 16:54:35 pirofti Exp $ */ +/* $OpenBSD: float.h,v 1.4 2011/08/19 15:44:36 kettenis Exp $ */ /* * Copyright (c) 1989 Regents of the University of California. @@ -64,14 +64,14 @@ __END_DECLS #define DBL_MAX 1.7976931348623157E+308 #define DBL_MAX_10_EXP 308 -#define LDBL_MANT_DIG 113 -#define LDBL_EPSILON 1.9259299443872358530559779425849273E-34L -#define LDBL_DIG 33 -#define LDBL_MIN_EXP (-16381) -#define LDBL_MIN 3.3621031431120935062626778173217526026E-4932L -#define LDBL_MIN_10_EXP (-4931) -#define LDBL_MAX_EXP 16384 -#define LDBL_MAX 1.1897314953572317650857593266280070162E4932L -#define LDBL_MAX_10_EXP 4932 +#define LDBL_MANT_DIG DBL_MANT_DIG +#define LDBL_EPSILON DBL_EPSILON +#define LDBL_DIG DBL_DIG +#define LDBL_MIN_EXP DBL_MIN_EXP +#define LDBL_MIN DBL_MIN +#define LDBL_MIN_10_EXP DBL_MIN_10_EXP +#define LDBL_MAX_EXP DBL_MAX_EXP +#define LDBL_MAX DBL_MAX +#define LDBL_MAX_10_EXP DBL_MAX_10_EXP #endif /* _MACHINE_FLOAT_H_ */ diff --git a/sys/arch/hppa64/include/ieee.h b/sys/arch/hppa64/include/ieee.h index f61c962b11a..18386cec0c9 100644 --- a/sys/arch/hppa64/include/ieee.h +++ b/sys/arch/hppa64/include/ieee.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee.h,v 1.2 2008/09/07 20:36:06 martynas Exp $ */ +/* $OpenBSD: ieee.h,v 1.3 2011/08/19 15:44:36 kettenis Exp $ */ /* * Copyright (c) 1992, 1993 @@ -87,22 +87,6 @@ #define E80_FRACBITS 64 #endif -#define EXT_EXPBITS 15 -#define EXT_FRACHBITS 16 -#define EXT_FRACHMBITS 32 -#define EXT_FRACLMBITS 32 -#define EXT_FRACLBITS 32 -#define EXT_FRACBITS 112 - -#define EXT_IMPLICIT_NBIT - -#define EXT_TO_ARRAY32(p, a) do { \ - (a)[0] = (uint32_t)(p)->ext_fracl; \ - (a)[1] = (uint32_t)(p)->ext_fraclm; \ - (a)[2] = (uint32_t)(p)->ext_frachm; \ - (a)[3] = (uint32_t)(p)->ext_frach; \ -} while(0) - struct ieee_single { u_int sng_sign:1; u_int sng_exp:8; @@ -116,15 +100,6 @@ struct ieee_double { u_int dbl_fracl; }; -struct ieee_ext { - u_int ext_sign:1; - u_int ext_exp:15; - u_int ext_frach:16; - u_int ext_frachm; - u_int ext_fraclm; - u_int ext_fracl; -}; - /* * Floats whose exponent is in [1..INFNAN) (of whatever type) are * `normal'. Floats whose exponent is INFNAN are either Inf or NaN. @@ -136,12 +111,10 @@ struct ieee_ext { */ #define SNG_EXP_INFNAN 255 #define DBL_EXP_INFNAN 2047 -#define EXT_EXP_INFNAN 32767 #if 0 #define SNG_QUIETNAN (1 << 22) #define DBL_QUIETNAN (1 << 19) -#define EXT_QUIETNAN (1 << 15) #endif /* @@ -149,4 +122,3 @@ struct ieee_ext { */ #define SNG_EXP_BIAS 127 #define DBL_EXP_BIAS 1023 -#define EXT_EXP_BIAS 16383 |