diff options
59 files changed, 431 insertions, 73 deletions
diff --git a/lib/libc/arch/amd64/gen/Makefile.inc b/lib/libc/arch/amd64/gen/Makefile.inc index 85b61ffe27c..2d8fa9e3c0c 100644 --- a/lib/libc/arch/amd64/gen/Makefile.inc +++ b/lib/libc/arch/amd64/gen/Makefile.inc @@ -1,8 +1,8 @@ -# $OpenBSD: Makefile.inc,v 1.5 2008/09/07 20:36:07 martynas Exp $ +# $OpenBSD: Makefile.inc,v 1.6 2008/12/09 19:52:33 martynas Exp $ SRCS+= _setjmp.S fabs.S infinity.c ldexp.c modf.S nan.c setjmp.S \ sigsetjmp.S -SRCS+= fpclassifyl.c isfinitel.c isinfl.c isnanl.c isnormall.c +SRCS+= fpclassifyl.c isfinitel.c isinfl.c isnanl.c isnormall.c signbitl.c SRCS+= flt_rounds.S fpgetmask.S fpgetround.S fpgetsticky.S fpsetmask.S \ fpsetround.S fpsetsticky.S diff --git a/lib/libc/arch/amd64/gen/isfinitel.c b/lib/libc/arch/amd64/gen/isfinitel.c index c86b9309da4..02a5602ea84 100644 --- a/lib/libc/arch/amd64/gen/isfinitel.c +++ b/lib/libc/arch/amd64/gen/isfinitel.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isfinitel.c,v 1.1 2008/09/07 20:36:07 martynas Exp $ */ +/* $OpenBSD: isfinitel.c,v 1.2 2008/12/09 19:52:33 martynas Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -17,6 +17,7 @@ #include <sys/types.h> #include <machine/ieee.h> +#include <math.h> int __isfinitel(long double e) diff --git a/lib/libc/arch/amd64/gen/isinfl.c b/lib/libc/arch/amd64/gen/isinfl.c index 862c82f97e7..eab84e50759 100644 --- a/lib/libc/arch/amd64/gen/isinfl.c +++ b/lib/libc/arch/amd64/gen/isinfl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isinfl.c,v 1.1 2008/09/07 20:36:07 martynas Exp $ */ +/* $OpenBSD: isinfl.c,v 1.2 2008/12/09 19:52:33 martynas Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -17,6 +17,7 @@ #include <sys/types.h> #include <machine/ieee.h> +#include <math.h> int __isinfl(long double e) diff --git a/lib/libc/arch/amd64/gen/isnanl.c b/lib/libc/arch/amd64/gen/isnanl.c index 4db08d62be6..0fbecf2efcc 100644 --- a/lib/libc/arch/amd64/gen/isnanl.c +++ b/lib/libc/arch/amd64/gen/isnanl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isnanl.c,v 1.1 2008/09/07 20:36:07 martynas Exp $ */ +/* $OpenBSD: isnanl.c,v 1.2 2008/12/09 19:52:33 martynas Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -17,6 +17,7 @@ #include <sys/types.h> #include <machine/ieee.h> +#include <math.h> int __isnanl(long double e) diff --git a/lib/libc/arch/amd64/gen/isnormall.c b/lib/libc/arch/amd64/gen/isnormall.c index a8b4314afc9..97ce382671b 100644 --- a/lib/libc/arch/amd64/gen/isnormall.c +++ b/lib/libc/arch/amd64/gen/isnormall.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isnormall.c,v 1.1 2008/09/07 20:36:07 martynas Exp $ */ +/* $OpenBSD: isnormall.c,v 1.2 2008/12/09 19:52:33 martynas Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -17,6 +17,7 @@ #include <sys/types.h> #include <machine/ieee.h> +#include <math.h> int __isnormall(long double e) diff --git a/lib/libc/arch/amd64/gen/signbitl.c b/lib/libc/arch/amd64/gen/signbitl.c new file mode 100644 index 00000000000..1f9f7ab332d --- /dev/null +++ b/lib/libc/arch/amd64/gen/signbitl.c @@ -0,0 +1,28 @@ +/* $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/libc/arch/hppa64/gen/Makefile.inc b/lib/libc/arch/hppa64/gen/Makefile.inc index c167e7e0bda..da20439174e 100644 --- a/lib/libc/arch/hppa64/gen/Makefile.inc +++ b/lib/libc/arch/hppa64/gen/Makefile.inc @@ -1,11 +1,11 @@ -# $OpenBSD: Makefile.inc,v 1.4 2008/09/07 20:36:07 martynas Exp $ +# $OpenBSD: Makefile.inc,v 1.5 2008/12/09 19:52:33 martynas Exp $ SRCS+= setjmp.S SRCS+= fabs.c frexp.c ldexp.c SRCS+= infinity.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 +SRCS+= fpclassifyl.c isfinitel.c isinfl.c isnanl.c isnormall.c signbitl.c SRCS+= modf.c SRCS+= alloca.c diff --git a/lib/libc/arch/hppa64/gen/isfinitel.c b/lib/libc/arch/hppa64/gen/isfinitel.c index c86b9309da4..02a5602ea84 100644 --- a/lib/libc/arch/hppa64/gen/isfinitel.c +++ b/lib/libc/arch/hppa64/gen/isfinitel.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isfinitel.c,v 1.1 2008/09/07 20:36:07 martynas Exp $ */ +/* $OpenBSD: isfinitel.c,v 1.2 2008/12/09 19:52:33 martynas Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -17,6 +17,7 @@ #include <sys/types.h> #include <machine/ieee.h> +#include <math.h> int __isfinitel(long double e) diff --git a/lib/libc/arch/hppa64/gen/isinfl.c b/lib/libc/arch/hppa64/gen/isinfl.c index c529a91cd2f..f83502e8c89 100644 --- a/lib/libc/arch/hppa64/gen/isinfl.c +++ b/lib/libc/arch/hppa64/gen/isinfl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isinfl.c,v 1.1 2008/09/07 20:36:07 martynas Exp $ */ +/* $OpenBSD: isinfl.c,v 1.2 2008/12/09 19:52:33 martynas Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -17,6 +17,7 @@ #include <sys/types.h> #include <machine/ieee.h> +#include <math.h> int __isinfl(long double e) diff --git a/lib/libc/arch/hppa64/gen/isnanl.c b/lib/libc/arch/hppa64/gen/isnanl.c index 1838fcfe3fa..85139ade7e8 100644 --- a/lib/libc/arch/hppa64/gen/isnanl.c +++ b/lib/libc/arch/hppa64/gen/isnanl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isnanl.c,v 1.1 2008/09/07 20:36:07 martynas Exp $ */ +/* $OpenBSD: isnanl.c,v 1.2 2008/12/09 19:52:33 martynas Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -17,6 +17,7 @@ #include <sys/types.h> #include <machine/ieee.h> +#include <math.h> int __isnanl(long double e) diff --git a/lib/libc/arch/hppa64/gen/isnormall.c b/lib/libc/arch/hppa64/gen/isnormall.c index a8b4314afc9..97ce382671b 100644 --- a/lib/libc/arch/hppa64/gen/isnormall.c +++ b/lib/libc/arch/hppa64/gen/isnormall.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isnormall.c,v 1.1 2008/09/07 20:36:07 martynas Exp $ */ +/* $OpenBSD: isnormall.c,v 1.2 2008/12/09 19:52:33 martynas Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -17,6 +17,7 @@ #include <sys/types.h> #include <machine/ieee.h> +#include <math.h> int __isnormall(long double e) diff --git a/lib/libc/arch/hppa64/gen/signbitl.c b/lib/libc/arch/hppa64/gen/signbitl.c new file mode 100644 index 00000000000..1f9f7ab332d --- /dev/null +++ b/lib/libc/arch/hppa64/gen/signbitl.c @@ -0,0 +1,28 @@ +/* $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/libc/arch/i386/gen/Makefile.inc b/lib/libc/arch/i386/gen/Makefile.inc index 863c28d0d18..9e4fdf7184d 100644 --- a/lib/libc/arch/i386/gen/Makefile.inc +++ b/lib/libc/arch/i386/gen/Makefile.inc @@ -1,8 +1,8 @@ -# $OpenBSD: Makefile.inc,v 1.7 2008/09/07 20:36:07 martynas Exp $ +# $OpenBSD: Makefile.inc,v 1.8 2008/12/09 19:52:33 martynas Exp $ SRCS+= _setjmp.S alloca.S fabs.S infinity.c ldexp.c \ modf.S nan.c setjmp.S sigsetjmp.S -SRCS+= fpclassifyl.c isfinitel.c isinfl.c isnanl.c isnormall.c +SRCS+= fpclassifyl.c isfinitel.c isinfl.c isnanl.c isnormall.c signbitl.c SRCS+= flt_rounds.S fpgetmask.S fpgetround.S fpgetsticky.S fpsetmask.S \ fpsetround.S fpsetsticky.S SRCS+= divsi3.S fixdfsi.S fixunsdfsi.S udivsi3.S diff --git a/lib/libc/arch/i386/gen/isfinitel.c b/lib/libc/arch/i386/gen/isfinitel.c index c86b9309da4..02a5602ea84 100644 --- a/lib/libc/arch/i386/gen/isfinitel.c +++ b/lib/libc/arch/i386/gen/isfinitel.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isfinitel.c,v 1.1 2008/09/07 20:36:07 martynas Exp $ */ +/* $OpenBSD: isfinitel.c,v 1.2 2008/12/09 19:52:33 martynas Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -17,6 +17,7 @@ #include <sys/types.h> #include <machine/ieee.h> +#include <math.h> int __isfinitel(long double e) diff --git a/lib/libc/arch/i386/gen/isinfl.c b/lib/libc/arch/i386/gen/isinfl.c index 862c82f97e7..eab84e50759 100644 --- a/lib/libc/arch/i386/gen/isinfl.c +++ b/lib/libc/arch/i386/gen/isinfl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isinfl.c,v 1.1 2008/09/07 20:36:07 martynas Exp $ */ +/* $OpenBSD: isinfl.c,v 1.2 2008/12/09 19:52:33 martynas Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -17,6 +17,7 @@ #include <sys/types.h> #include <machine/ieee.h> +#include <math.h> int __isinfl(long double e) diff --git a/lib/libc/arch/i386/gen/isnanl.c b/lib/libc/arch/i386/gen/isnanl.c index 4db08d62be6..0fbecf2efcc 100644 --- a/lib/libc/arch/i386/gen/isnanl.c +++ b/lib/libc/arch/i386/gen/isnanl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isnanl.c,v 1.1 2008/09/07 20:36:07 martynas Exp $ */ +/* $OpenBSD: isnanl.c,v 1.2 2008/12/09 19:52:33 martynas Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -17,6 +17,7 @@ #include <sys/types.h> #include <machine/ieee.h> +#include <math.h> int __isnanl(long double e) diff --git a/lib/libc/arch/i386/gen/isnormall.c b/lib/libc/arch/i386/gen/isnormall.c index a8b4314afc9..97ce382671b 100644 --- a/lib/libc/arch/i386/gen/isnormall.c +++ b/lib/libc/arch/i386/gen/isnormall.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isnormall.c,v 1.1 2008/09/07 20:36:07 martynas Exp $ */ +/* $OpenBSD: isnormall.c,v 1.2 2008/12/09 19:52:33 martynas Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -17,6 +17,7 @@ #include <sys/types.h> #include <machine/ieee.h> +#include <math.h> int __isnormall(long double e) diff --git a/lib/libc/arch/i386/gen/signbitl.c b/lib/libc/arch/i386/gen/signbitl.c new file mode 100644 index 00000000000..1f9f7ab332d --- /dev/null +++ b/lib/libc/arch/i386/gen/signbitl.c @@ -0,0 +1,28 @@ +/* $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/libc/arch/m68k/gen/Makefile.inc b/lib/libc/arch/m68k/gen/Makefile.inc index ae4b21ae368..53ebb5d3df3 100644 --- a/lib/libc/arch/m68k/gen/Makefile.inc +++ b/lib/libc/arch/m68k/gen/Makefile.inc @@ -1,10 +1,10 @@ -# $OpenBSD: Makefile.inc,v 1.7 2008/09/07 20:36:07 martynas Exp $ +# $OpenBSD: Makefile.inc,v 1.8 2008/12/09 19:52:33 martynas Exp $ SRCS+= _setjmp.S fabs.S infinity.c ldexp.S \ modf.S nan.c setjmp.S sigsetjmp.S SRCS+= flt_rounds.S fpgetmask.S fpgetround.S fpgetsticky.S fpsetmask.S \ fpsetround.S fpsetsticky.S -SRCS+= fpclassifyl.c isfinitel.c isinfl.c isnanl.c isnormall.c +SRCS+= fpclassifyl.c isfinitel.c isinfl.c isnanl.c isnormall.c signbitl.c SRCS+= adddf3.S addsf3.S ashlsi3.S ashrsi3.S cmpdf2.S cmpsf2.S divdf3.S \ divsf3.S divsi3.S extendsfdf2.S fixdfsi.S fixunsdfsi.S \ floatsidf.S lshlsi3.S lshrsi3.S modsi3.S muldf3.S mulsf3.S mulsi3.S \ diff --git a/lib/libc/arch/m68k/gen/isfinitel.c b/lib/libc/arch/m68k/gen/isfinitel.c index c86b9309da4..02a5602ea84 100644 --- a/lib/libc/arch/m68k/gen/isfinitel.c +++ b/lib/libc/arch/m68k/gen/isfinitel.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isfinitel.c,v 1.1 2008/09/07 20:36:07 martynas Exp $ */ +/* $OpenBSD: isfinitel.c,v 1.2 2008/12/09 19:52:33 martynas Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -17,6 +17,7 @@ #include <sys/types.h> #include <machine/ieee.h> +#include <math.h> int __isfinitel(long double e) diff --git a/lib/libc/arch/m68k/gen/isinfl.c b/lib/libc/arch/m68k/gen/isinfl.c index 862c82f97e7..eab84e50759 100644 --- a/lib/libc/arch/m68k/gen/isinfl.c +++ b/lib/libc/arch/m68k/gen/isinfl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isinfl.c,v 1.1 2008/09/07 20:36:07 martynas Exp $ */ +/* $OpenBSD: isinfl.c,v 1.2 2008/12/09 19:52:33 martynas Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -17,6 +17,7 @@ #include <sys/types.h> #include <machine/ieee.h> +#include <math.h> int __isinfl(long double e) diff --git a/lib/libc/arch/m68k/gen/isnanl.c b/lib/libc/arch/m68k/gen/isnanl.c index 4db08d62be6..0fbecf2efcc 100644 --- a/lib/libc/arch/m68k/gen/isnanl.c +++ b/lib/libc/arch/m68k/gen/isnanl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isnanl.c,v 1.1 2008/09/07 20:36:07 martynas Exp $ */ +/* $OpenBSD: isnanl.c,v 1.2 2008/12/09 19:52:33 martynas Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -17,6 +17,7 @@ #include <sys/types.h> #include <machine/ieee.h> +#include <math.h> int __isnanl(long double e) diff --git a/lib/libc/arch/m68k/gen/isnormall.c b/lib/libc/arch/m68k/gen/isnormall.c index a8b4314afc9..97ce382671b 100644 --- a/lib/libc/arch/m68k/gen/isnormall.c +++ b/lib/libc/arch/m68k/gen/isnormall.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isnormall.c,v 1.1 2008/09/07 20:36:07 martynas Exp $ */ +/* $OpenBSD: isnormall.c,v 1.2 2008/12/09 19:52:33 martynas Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -17,6 +17,7 @@ #include <sys/types.h> #include <machine/ieee.h> +#include <math.h> int __isnormall(long double e) diff --git a/lib/libc/arch/m68k/gen/signbitl.c b/lib/libc/arch/m68k/gen/signbitl.c new file mode 100644 index 00000000000..1f9f7ab332d --- /dev/null +++ b/lib/libc/arch/m68k/gen/signbitl.c @@ -0,0 +1,28 @@ +/* $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/libc/arch/m88k/gen/Makefile.inc b/lib/libc/arch/m88k/gen/Makefile.inc index a6d82239bed..255c6918e7a 100644 --- a/lib/libc/arch/m88k/gen/Makefile.inc +++ b/lib/libc/arch/m88k/gen/Makefile.inc @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.inc,v 1.7 2008/09/07 20:36:07 martynas Exp $ +# $OpenBSD: Makefile.inc,v 1.8 2008/12/09 19:52:33 martynas Exp $ # $NetBSD: Makefile.inc,v 1.3 1995/04/10 21:09:06 jtc Exp $ #SRCS+= _setjmp.S fabs.S infinity.c ldexp.c modf.S nan.c @@ -9,7 +9,7 @@ SRCS+= _setjmp.S fabs.S frexp.c infinity.c ldexp.c nan.c 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 +SRCS+= fpclassifyl.c isfinitel.c isinfl.c isnanl.c isnormall.c signbitl.c SRCS+= setjmp.S sigsetjmp.S SRCS+= modf.c diff --git a/lib/libc/arch/m88k/gen/isfinitel.c b/lib/libc/arch/m88k/gen/isfinitel.c index c86b9309da4..02a5602ea84 100644 --- a/lib/libc/arch/m88k/gen/isfinitel.c +++ b/lib/libc/arch/m88k/gen/isfinitel.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isfinitel.c,v 1.1 2008/09/07 20:36:07 martynas Exp $ */ +/* $OpenBSD: isfinitel.c,v 1.2 2008/12/09 19:52:33 martynas Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -17,6 +17,7 @@ #include <sys/types.h> #include <machine/ieee.h> +#include <math.h> int __isfinitel(long double e) diff --git a/lib/libc/arch/m88k/gen/isinfl.c b/lib/libc/arch/m88k/gen/isinfl.c index 862c82f97e7..eab84e50759 100644 --- a/lib/libc/arch/m88k/gen/isinfl.c +++ b/lib/libc/arch/m88k/gen/isinfl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isinfl.c,v 1.1 2008/09/07 20:36:07 martynas Exp $ */ +/* $OpenBSD: isinfl.c,v 1.2 2008/12/09 19:52:33 martynas Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -17,6 +17,7 @@ #include <sys/types.h> #include <machine/ieee.h> +#include <math.h> int __isinfl(long double e) diff --git a/lib/libc/arch/m88k/gen/isnanl.c b/lib/libc/arch/m88k/gen/isnanl.c index 4db08d62be6..0fbecf2efcc 100644 --- a/lib/libc/arch/m88k/gen/isnanl.c +++ b/lib/libc/arch/m88k/gen/isnanl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isnanl.c,v 1.1 2008/09/07 20:36:07 martynas Exp $ */ +/* $OpenBSD: isnanl.c,v 1.2 2008/12/09 19:52:33 martynas Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -17,6 +17,7 @@ #include <sys/types.h> #include <machine/ieee.h> +#include <math.h> int __isnanl(long double e) diff --git a/lib/libc/arch/m88k/gen/isnormall.c b/lib/libc/arch/m88k/gen/isnormall.c index a8b4314afc9..97ce382671b 100644 --- a/lib/libc/arch/m88k/gen/isnormall.c +++ b/lib/libc/arch/m88k/gen/isnormall.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isnormall.c,v 1.1 2008/09/07 20:36:07 martynas Exp $ */ +/* $OpenBSD: isnormall.c,v 1.2 2008/12/09 19:52:33 martynas Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -17,6 +17,7 @@ #include <sys/types.h> #include <machine/ieee.h> +#include <math.h> int __isnormall(long double e) diff --git a/lib/libc/arch/m88k/gen/signbitl.c b/lib/libc/arch/m88k/gen/signbitl.c new file mode 100644 index 00000000000..1f9f7ab332d --- /dev/null +++ b/lib/libc/arch/m88k/gen/signbitl.c @@ -0,0 +1,28 @@ +/* $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/libc/arch/mips64/gen/Makefile.inc b/lib/libc/arch/mips64/gen/Makefile.inc index 2098bcc4d93..2e12b8d105f 100644 --- a/lib/libc/arch/mips64/gen/Makefile.inc +++ b/lib/libc/arch/mips64/gen/Makefile.inc @@ -1,9 +1,9 @@ -# $OpenBSD: Makefile.inc,v 1.6 2008/09/07 20:36:07 martynas Exp $ +# $OpenBSD: Makefile.inc,v 1.7 2008/12/09 19:52:33 martynas Exp $ SRCS+= _setjmp.S fabs.S infinity.c ldexp.S modf.S nan.c 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 +SRCS+= fpclassifyl.c isfinitel.c isinfl.c isnanl.c isnormall.c signbitl.c SRCS+= setjmp.S sigsetjmp.S SRCS+= alloca.c diff --git a/lib/libc/arch/mips64/gen/isfinitel.c b/lib/libc/arch/mips64/gen/isfinitel.c index c86b9309da4..02a5602ea84 100644 --- a/lib/libc/arch/mips64/gen/isfinitel.c +++ b/lib/libc/arch/mips64/gen/isfinitel.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isfinitel.c,v 1.1 2008/09/07 20:36:07 martynas Exp $ */ +/* $OpenBSD: isfinitel.c,v 1.2 2008/12/09 19:52:33 martynas Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -17,6 +17,7 @@ #include <sys/types.h> #include <machine/ieee.h> +#include <math.h> int __isfinitel(long double e) diff --git a/lib/libc/arch/mips64/gen/isinfl.c b/lib/libc/arch/mips64/gen/isinfl.c index c529a91cd2f..1a96c5ef0f3 100644 --- a/lib/libc/arch/mips64/gen/isinfl.c +++ b/lib/libc/arch/mips64/gen/isinfl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isinfl.c,v 1.1 2008/09/07 20:36:07 martynas Exp $ */ +/* $OpenBSD: isinfl.c,v 1.2 2008/12/09 19:52:34 martynas Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -17,6 +17,7 @@ #include <sys/types.h> #include <machine/ieee.h> +#include <math.h> int __isinfl(long double e) diff --git a/lib/libc/arch/mips64/gen/isnanl.c b/lib/libc/arch/mips64/gen/isnanl.c index 1838fcfe3fa..480677dce4e 100644 --- a/lib/libc/arch/mips64/gen/isnanl.c +++ b/lib/libc/arch/mips64/gen/isnanl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isnanl.c,v 1.1 2008/09/07 20:36:07 martynas Exp $ */ +/* $OpenBSD: isnanl.c,v 1.2 2008/12/09 19:52:34 martynas Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -17,6 +17,7 @@ #include <sys/types.h> #include <machine/ieee.h> +#include <math.h> int __isnanl(long double e) diff --git a/lib/libc/arch/mips64/gen/isnormall.c b/lib/libc/arch/mips64/gen/isnormall.c index a8b4314afc9..df6cdc52efd 100644 --- a/lib/libc/arch/mips64/gen/isnormall.c +++ b/lib/libc/arch/mips64/gen/isnormall.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isnormall.c,v 1.1 2008/09/07 20:36:07 martynas Exp $ */ +/* $OpenBSD: isnormall.c,v 1.2 2008/12/09 19:52:34 martynas Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -17,6 +17,7 @@ #include <sys/types.h> #include <machine/ieee.h> +#include <math.h> int __isnormall(long double e) diff --git a/lib/libc/arch/mips64/gen/signbitl.c b/lib/libc/arch/mips64/gen/signbitl.c new file mode 100644 index 00000000000..a57ea9731d5 --- /dev/null +++ b/lib/libc/arch/mips64/gen/signbitl.c @@ -0,0 +1,28 @@ +/* $OpenBSD: signbitl.c,v 1.1 2008/12/09 19:52:34 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/libc/arch/sparc/gdtoa/Makefile.inc b/lib/libc/arch/sparc/gdtoa/Makefile.inc index 9a21a743db8..5f4dfe3bb59 100644 --- a/lib/libc/arch/sparc/gdtoa/Makefile.inc +++ b/lib/libc/arch/sparc/gdtoa/Makefile.inc @@ -1,3 +1,3 @@ -# $OpenBSD: Makefile.inc,v 1.1 2008/09/07 20:36:07 martynas Exp $ +# $OpenBSD: Makefile.inc,v 1.2 2008/12/09 19:52:34 martynas Exp $ -SRCS+= strtord.c strtorQ.c +SRCS+= strtord.c diff --git a/lib/libc/arch/sparc/gen/Makefile.inc b/lib/libc/arch/sparc/gen/Makefile.inc index 4d0fcc097c8..a2475620099 100644 --- a/lib/libc/arch/sparc/gen/Makefile.inc +++ b/lib/libc/arch/sparc/gen/Makefile.inc @@ -1,9 +1,8 @@ -# $OpenBSD: Makefile.inc,v 1.7 2008/09/07 20:36:08 martynas Exp $ +# $OpenBSD: Makefile.inc,v 1.8 2008/12/09 19:52:34 martynas Exp $ SRCS+= _setjmp.S fabs.S infinity.c ldexp.c modf.S nan.c 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 SRCS+= fixunsdfsi.S mul.S umul.S saveregs.S setjmp.S sigsetjmp.S SRCS+= alloca.c diff --git a/lib/libc/arch/sparc64/gen/Makefile.inc b/lib/libc/arch/sparc64/gen/Makefile.inc index 8a7fafce703..5ae927d7383 100644 --- a/lib/libc/arch/sparc64/gen/Makefile.inc +++ b/lib/libc/arch/sparc64/gen/Makefile.inc @@ -1,9 +1,9 @@ -# $OpenBSD: Makefile.inc,v 1.6 2008/09/07 20:36:08 martynas Exp $ +# $OpenBSD: Makefile.inc,v 1.7 2008/12/09 19:52:34 martynas Exp $ SRCS+= _setjmp.S fabs.S infinity.c ldexp.c modf.S nan.c 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 +SRCS+= fpclassifyl.c isfinitel.c isinfl.c isnanl.c isnormall.c signbitl.c SRCS+= fixunsdfsi.S mul.S umul.S saveregs.S setjmp.S sigsetjmp.S SRCS+= alloca.c diff --git a/lib/libc/arch/sparc64/gen/isfinitel.c b/lib/libc/arch/sparc64/gen/isfinitel.c index f60c9f1af85..e88bb301d9a 100644 --- a/lib/libc/arch/sparc64/gen/isfinitel.c +++ b/lib/libc/arch/sparc64/gen/isfinitel.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isfinitel.c,v 1.1 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: isfinitel.c,v 1.2 2008/12/09 19:52:34 martynas Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -17,6 +17,7 @@ #include <sys/types.h> #include <machine/ieee.h> +#include <math.h> int __isfinitel(long double e) diff --git a/lib/libc/arch/sparc64/gen/isinfl.c b/lib/libc/arch/sparc64/gen/isinfl.c index 8c11b447689..1a96c5ef0f3 100644 --- a/lib/libc/arch/sparc64/gen/isinfl.c +++ b/lib/libc/arch/sparc64/gen/isinfl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isinfl.c,v 1.1 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: isinfl.c,v 1.2 2008/12/09 19:52:34 martynas Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -17,6 +17,7 @@ #include <sys/types.h> #include <machine/ieee.h> +#include <math.h> int __isinfl(long double e) diff --git a/lib/libc/arch/sparc64/gen/isnanl.c b/lib/libc/arch/sparc64/gen/isnanl.c index e5cfb5ae788..480677dce4e 100644 --- a/lib/libc/arch/sparc64/gen/isnanl.c +++ b/lib/libc/arch/sparc64/gen/isnanl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isnanl.c,v 1.1 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: isnanl.c,v 1.2 2008/12/09 19:52:34 martynas Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -17,6 +17,7 @@ #include <sys/types.h> #include <machine/ieee.h> +#include <math.h> int __isnanl(long double e) diff --git a/lib/libc/arch/sparc64/gen/isnormall.c b/lib/libc/arch/sparc64/gen/isnormall.c index 91df6fe51d0..df6cdc52efd 100644 --- a/lib/libc/arch/sparc64/gen/isnormall.c +++ b/lib/libc/arch/sparc64/gen/isnormall.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isnormall.c,v 1.1 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: isnormall.c,v 1.2 2008/12/09 19:52:34 martynas Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -17,6 +17,7 @@ #include <sys/types.h> #include <machine/ieee.h> +#include <math.h> int __isnormall(long double e) diff --git a/lib/libc/arch/sparc64/gen/signbitl.c b/lib/libc/arch/sparc64/gen/signbitl.c new file mode 100644 index 00000000000..a57ea9731d5 --- /dev/null +++ b/lib/libc/arch/sparc64/gen/signbitl.c @@ -0,0 +1,28 @@ +/* $OpenBSD: signbitl.c,v 1.1 2008/12/09 19:52:34 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/libc/arch/vax/gdtoa/strtof.c b/lib/libc/arch/vax/gdtoa/strtof.c index f0472c2558d..7ae20c2f894 100644 --- a/lib/libc/arch/vax/gdtoa/strtof.c +++ b/lib/libc/arch/vax/gdtoa/strtof.c @@ -38,13 +38,18 @@ strtof(s, sp) CONST char *s; char **sp; strtof(CONST char *s, char **sp) #endif { - static FPI fpi = { 24, 1-128-1-24+1, 255-128-1-24+1, 1, SI }; + static FPI fpi0 = { 24, 1-128-1-24+1, 255-128-1-24+1, 1, SI }; ULong bits[1]; Long exp; int k; union { ULong L[1]; float f; } u; +#ifdef Honor_FLT_ROUNDS +#include "gdtoa_fltrnds.h" +#else +#define fpi &fpi0 +#endif - k = strtodg(s, sp, &fpi, &exp, bits); + k = strtodg(s, sp, fpi, &exp, bits); switch(k & STRTOG_Retmask) { case STRTOG_NoNumber: case STRTOG_Zero: diff --git a/lib/libc/arch/vax/gen/fpclassify.c b/lib/libc/arch/vax/gen/fpclassify.c index 8c9e57d79e2..1ed7458fad6 100644 --- a/lib/libc/arch/vax/gen/fpclassify.c +++ b/lib/libc/arch/vax/gen/fpclassify.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fpclassify.c,v 1.1 2008/07/24 09:31:07 martynas Exp $ */ +/* $OpenBSD: fpclassify.c,v 1.2 2008/12/09 19:52:34 martynas Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -15,6 +15,7 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include <machine/cdefs.h> #include <machine/vaxfp.h> #include <math.h> @@ -41,3 +42,7 @@ __fpclassifyf(float f) return FP_NORMAL; } + +#ifdef __weak_alias +__weak_alias(__fpclassifyl, __fpclassify); +#endif /* __weak_alias */ diff --git a/lib/libc/arch/vax/gen/infinity.c b/lib/libc/arch/vax/gen/infinity.c index a6c30cff55a..cda57fe11a4 100644 --- a/lib/libc/arch/vax/gen/infinity.c +++ b/lib/libc/arch/vax/gen/infinity.c @@ -1,4 +1,4 @@ -/* $OpenBSD: infinity.c,v 1.4 2005/08/07 16:40:15 espie Exp $ */ +/* $OpenBSD: infinity.c,v 1.5 2008/12/09 19:52:34 martynas Exp $ */ /* * XXX - This is not correct, but what can we do about it? */ @@ -10,3 +10,6 @@ /* The highest D float on a vax. */ char __infinity[] = { (char)0xff, (char)0x7f, (char)0xff, (char)0xff, (char)0xff, (char)0xff, (char)0xff, (char)0xff }; + +/* The highest F float on a vax. */ +char __infinityf[] = { (char)0xff, (char)0x7f, (char)0xff, (char)0xff }; diff --git a/lib/libc/arch/vax/gen/isfinite.c b/lib/libc/arch/vax/gen/isfinite.c index 9e283e56e78..cb54faf4fbb 100644 --- a/lib/libc/arch/vax/gen/isfinite.c +++ b/lib/libc/arch/vax/gen/isfinite.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isfinite.c,v 1.1 2008/07/24 09:31:07 martynas Exp $ */ +/* $OpenBSD: isfinite.c,v 1.2 2008/12/09 19:52:34 martynas Exp $ */ /* * Copyright (c) Martynas Venckus <martynas@openbsd.org> * @@ -15,6 +15,9 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include <machine/cdefs.h> +#include <math.h> + /* ARGSUSED */ int __isfinite(double d) @@ -28,3 +31,15 @@ __isfinitef(float f) { return(1); } + +#ifdef __weak_alias +__weak_alias(__isfinitel, __isfinite); +#endif /* __weak_alias */ + +/* + * 3BSD compatibility aliases. + */ +#ifdef __weak_alias +__weak_alias(finite, __isfinite); +__weak_alias(finitef, __isfinitef); +#endif /* __weak_alias */ diff --git a/lib/libc/arch/vax/gen/isinf.c b/lib/libc/arch/vax/gen/isinf.c index c3a6cb7de54..bda4f90a0e7 100644 --- a/lib/libc/arch/vax/gen/isinf.c +++ b/lib/libc/arch/vax/gen/isinf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isinf.c,v 1.7 2008/07/24 09:31:07 martynas Exp $ */ +/* $OpenBSD: isinf.c,v 1.8 2008/12/09 19:52:34 martynas Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -29,6 +29,9 @@ * SUCH DAMAGE. */ +#include <machine/cdefs.h> +#include <math.h> + /* ARGSUSED */ int __isinf(double d) @@ -42,3 +45,15 @@ isinff(float f) { return(0); } + +#ifdef __weak_alias +__weak_alias(__isinfl, __isinf); +#endif /* __weak_alias */ + +/* + * 3BSD compatibility aliases. + */ +#ifdef __weak_alias +__weak_alias(isinf, __isinf); +__weak_alias(isinff, __isinff); +#endif /* __weak_alias */ diff --git a/lib/libc/arch/vax/gen/isnan.c b/lib/libc/arch/vax/gen/isnan.c index 7a6450081a1..b9961783d35 100644 --- a/lib/libc/arch/vax/gen/isnan.c +++ b/lib/libc/arch/vax/gen/isnan.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isnan.c,v 1.1 2008/07/24 09:31:07 martynas Exp $ */ +/* $OpenBSD: isnan.c,v 1.2 2008/12/09 19:52:34 martynas Exp $ */ /* * Copyright (c) Martynas Venckus <martynas@openbsd.org> * @@ -15,6 +15,9 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include <machine/cdefs.h> +#include <math.h> + /* ARGSUSED */ int __isnan(double d) @@ -28,3 +31,15 @@ isnanf(float f) { return(0); } + +#ifdef __weak_alias +__weak_alias(__isnanl, __isnan); +#endif /* __weak_alias */ + +/* + * 3BSD compatibility aliases. + */ +#ifdef __weak_alias +__weak_alias(isnan, __isnan); +__weak_alias(isnanf, __isnanf); +#endif /* __weak_alias */ diff --git a/lib/libc/arch/vax/gen/isnormal.c b/lib/libc/arch/vax/gen/isnormal.c index 0e119d7de30..8818f11e4b6 100644 --- a/lib/libc/arch/vax/gen/isnormal.c +++ b/lib/libc/arch/vax/gen/isnormal.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isnormal.c,v 1.1 2008/07/24 09:31:07 martynas Exp $ */ +/* $OpenBSD: isnormal.c,v 1.2 2008/12/09 19:52:34 martynas Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -15,7 +15,9 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include <machine/cdefs.h> #include <machine/vaxfp.h> +#include <math.h> int __isnormal(double d) @@ -32,3 +34,7 @@ __isnormalf(float f) return (p->fflt_exp != 0); } + +#ifdef __weak_alias +__weak_alias(__isnormall, __isnormal); +#endif /* __weak_alias */ diff --git a/lib/libc/arch/vax/gen/signbit.c b/lib/libc/arch/vax/gen/signbit.c index 9b31a7428a8..202e93d3bf0 100644 --- a/lib/libc/arch/vax/gen/signbit.c +++ b/lib/libc/arch/vax/gen/signbit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: signbit.c,v 1.1 2008/07/24 09:31:07 martynas Exp $ */ +/* $OpenBSD: signbit.c,v 1.2 2008/12/09 19:52:34 martynas Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -15,7 +15,9 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include <machine/cdefs.h> #include <machine/vaxfp.h> +#include <math.h> int __signbit(double d) @@ -32,3 +34,7 @@ __signbitf(float f) return p->fflt_sign; } + +#ifdef __weak_alias +__weak_alias(__signbitl, __signbit); +#endif /* __weak_alias */ diff --git a/lib/libc/gen/fpclassify.c b/lib/libc/gen/fpclassify.c index 10a0904637b..60d21770bfb 100644 --- a/lib/libc/gen/fpclassify.c +++ b/lib/libc/gen/fpclassify.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fpclassify.c,v 1.2 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: fpclassify.c,v 1.3 2008/12/09 19:52:34 martynas Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -16,7 +16,9 @@ */ #include <sys/types.h> +#include <machine/cdefs.h> #include <machine/ieee.h> +#include <float.h> #include <math.h> int @@ -62,3 +64,9 @@ __fpclassifyf(float f) return FP_NORMAL; } + +#if LDBL_MANT_DIG == 53 +#ifdef __weak_alias +__weak_alias(__fpclassifyl, __fpclassify); +#endif /* __weak_alias */ +#endif /* LDBL_MANT_DIG == 53 */ diff --git a/lib/libc/gen/isfinite.c b/lib/libc/gen/isfinite.c index 0e0e8844492..537eed7716a 100644 --- a/lib/libc/gen/isfinite.c +++ b/lib/libc/gen/isfinite.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isfinite.c,v 1.2 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: isfinite.c,v 1.3 2008/12/09 19:52:34 martynas Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -16,7 +16,10 @@ */ #include <sys/types.h> +#include <machine/cdefs.h> #include <machine/ieee.h> +#include <float.h> +#include <math.h> int __isfinite(double d) @@ -33,3 +36,17 @@ __isfinitef(float f) return (p->sng_exp != SNG_EXP_INFNAN); } + +#if LDBL_MANT_DIG == 53 +#ifdef __weak_alias +__weak_alias(__isfinitel, __isfinite); +#endif /* __weak_alias */ +#endif /* LDBL_MANT_DIG == 53 */ + +/* + * 3BSD compatibility aliases. + */ +#ifdef __weak_alias +__weak_alias(finite, __isfinite); +__weak_alias(finitef, __isfinitef); +#endif /* __weak_alias */ diff --git a/lib/libc/gen/isinf.c b/lib/libc/gen/isinf.c index 9af1ca9657b..a7b991b1c7f 100644 --- a/lib/libc/gen/isinf.c +++ b/lib/libc/gen/isinf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isinf.c,v 1.2 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: isinf.c,v 1.3 2008/12/09 19:52:34 martynas Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -16,7 +16,9 @@ */ #include <sys/types.h> +#include <machine/cdefs.h> #include <machine/ieee.h> +#include <float.h> int __isinf(double d) @@ -28,9 +30,23 @@ __isinf(double d) } int -isinff(float f) +__isinff(float f) { struct ieee_single *p = (struct ieee_single *)&f; return (p->sng_exp == SNG_EXP_INFNAN && p->sng_frac == 0); } + +#if LDBL_MANT_DIG == 53 +#ifdef __weak_alias +__weak_alias(__isinfl, __isinf); +#endif /* __weak_alias */ +#endif /* LDBL_MANT_DIG == 53 */ + +/* + * 3BSD compatibility aliases. + */ +#ifdef __weak_alias +__weak_alias(isinf, __isinf); +__weak_alias(isinff, __isinff); +#endif /* __weak_alias */ diff --git a/lib/libc/gen/isnan.c b/lib/libc/gen/isnan.c index 116360369ed..eadb1f18a5e 100644 --- a/lib/libc/gen/isnan.c +++ b/lib/libc/gen/isnan.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isnan.c,v 1.2 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: isnan.c,v 1.3 2008/12/09 19:52:34 martynas Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -16,7 +16,9 @@ */ #include <sys/types.h> +#include <machine/cdefs.h> #include <machine/ieee.h> +#include <float.h> int __isnan(double d) @@ -28,9 +30,23 @@ __isnan(double d) } int -isnanf(float f) +__isnanf(float f) { struct ieee_single *p = (struct ieee_single *)&f; return (p->sng_exp == SNG_EXP_INFNAN && p->sng_frac != 0); } + +#if LDBL_MANT_DIG == 53 +#ifdef __weak_alias +__weak_alias(__isnanl, __isnan); +#endif /* __weak_alias */ +#endif /* LDBL_MANT_DIG == 53 */ + +/* + * 3BSD compatibility aliases. + */ +#ifdef __weak_alias +__weak_alias(isnan, __isnan); +__weak_alias(isnanf, __isnanf); +#endif /* __weak_alias */ diff --git a/lib/libc/gen/isnormal.c b/lib/libc/gen/isnormal.c index 8879218e7fe..40e59913a02 100644 --- a/lib/libc/gen/isnormal.c +++ b/lib/libc/gen/isnormal.c @@ -1,4 +1,4 @@ -/* $OpenBSD: isnormal.c,v 1.2 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: isnormal.c,v 1.3 2008/12/09 19:52:34 martynas Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -16,7 +16,10 @@ */ #include <sys/types.h> +#include <machine/cdefs.h> #include <machine/ieee.h> +#include <float.h> +#include <math.h> int __isnormal(double d) @@ -33,3 +36,9 @@ __isnormalf(float f) return (p->sng_exp != 0 && p->sng_exp != SNG_EXP_INFNAN); } + +#if LDBL_MANT_DIG == 53 +#ifdef __weak_alias +__weak_alias(__isnormall, __isnormal); +#endif /* __weak_alias */ +#endif /* LDBL_MANT_DIG == 53 */ diff --git a/lib/libc/gen/signbit.c b/lib/libc/gen/signbit.c index 426362c8288..b4a3f3617e1 100644 --- a/lib/libc/gen/signbit.c +++ b/lib/libc/gen/signbit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: signbit.c,v 1.1 2008/07/24 09:31:07 martynas Exp $ */ +/* $OpenBSD: signbit.c,v 1.2 2008/12/09 19:52:34 martynas Exp $ */ /* * Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org> * @@ -16,7 +16,10 @@ */ #include <sys/types.h> +#include <machine/cdefs.h> #include <machine/ieee.h> +#include <float.h> +#include <math.h> int __signbit(double d) @@ -34,12 +37,8 @@ __signbitf(float f) return p->sng_sign; } -#if 0 /* XXX */ -int -__signbitl(long double e) -{ - struct ieee_ext *p = (struct ieee_ext *)&e; - - return p->ext_sign; -} -#endif /* XXX */ +#if LDBL_MANT_DIG == 53 +#ifdef __weak_alias +__weak_alias(__signbitl, __signbit); +#endif /* __weak_alias */ +#endif /* LDBL_MANT_DIG == 53 */ diff --git a/lib/libc/shlib_version b/lib/libc/shlib_version index c05b777c1bd..088a7e5ed1f 100644 --- a/lib/libc/shlib_version +++ b/lib/libc/shlib_version @@ -1,4 +1,4 @@ -major=49 +major=50 minor=0 # note: If changes were made to include/thread_private.h or if system # calls were added/changed then libpthread must also be updated. |