and ldexp().
ok millert@
-/* $OpenBSD: flt_rounds.c,v 1.6 2012/06/25 17:01:09 deraadt Exp $ */
+/* $OpenBSD: flt_rounds.c,v 1.7 2015/10/27 05:54:49 guenther Exp $ */
/* $NetBSD: flt_rounds.c,v 1.1 1995/04/29 05:09:53 cgd Exp $ */
/*
return map[(old >> 58) & 0x3];
}
+DEF_STRONG(__flt_rounds);
-/* $OpenBSD: flt_rounds.S,v 1.4 2015/05/29 08:50:12 uebayasi Exp $ */
+/* $OpenBSD: flt_rounds.S,v 1.5 2015/10/27 05:54:49 guenther Exp $ */
/* $NetBSD: flt_rounds.S,v 1.2 2002/06/06 23:04:35 fvdl Exp $ */
/*
* Public domain.
*/
-#include <machine/asm.h>
+#include "SYS.h"
.text
_ALIGN_TEXT
movb _map(,%rax,1),%al
#endif
ret
-END(__flt_rounds)
+END_STRONG(__flt_rounds)
-/* $OpenBSD: fpclassifyl.c,v 1.1 2008/09/07 20:36:07 martynas Exp $ */
+/* $OpenBSD: fpclassifyl.c,v 1.2 2015/10/27 05:54:49 guenther Exp $ */
/*
* Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org>
*
return FP_NORMAL;
}
+DEF_STRONG(__fpclassifyl);
-/* $OpenBSD: ldexp.c,v 1.4 2015/01/04 16:12:42 daniel Exp $ */
+/* $OpenBSD: ldexp.c,v 1.5 2015/10/27 05:54:49 guenther Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
: "0" (value), "u" ((double)exp));
return (temp);
}
+DEF_STRONG(ldexp);
-/* $OpenBSD: flt_rounds.c,v 1.4 2015/10/18 19:30:39 guenther Exp $ */
+/* $OpenBSD: flt_rounds.c,v 1.5 2015/10/27 05:54:49 guenther Exp $ */
/* $NetBSD: flt_rounds.c,v 1.1 2000/12/29 20:13:48 bjh21 Exp $ */
/*
{
return(map[fpgetround()]);
}
+DEF_STRONG(__flt_rounds);
-/* $OpenBSD: flt_rounds.c,v 1.5 2014/04/18 15:09:52 guenther Exp $ */
+/* $OpenBSD: flt_rounds.c,v 1.6 2015/10/27 05:54:49 guenther Exp $ */
/*
* Written by Miodrag Vallat. Public domain.
__asm__ volatile("fstd %%fr0,0(%1)" : "=m" (fpsr) : "r" (&fpsr));
return map[(fpsr >> 41) & 0x03];
}
+DEF_STRONG(__flt_rounds);
-/* $OpenBSD: flt_rounds.c,v 1.3 2014/04/18 15:09:52 guenther Exp $ */
+/* $OpenBSD: flt_rounds.c,v 1.4 2015/10/27 05:54:49 guenther Exp $ */
/*
* Written by Miodrag Vallat. Public domain.
__asm__ volatile("fstd %%fr0,0(%1)" : "=m" (fpsr) : "r" (&fpsr));
return map[(fpsr >> 41) & 0x03];
}
+DEF_STRONG(__flt_rounds);
-/* $OpenBSD: flt_rounds.S,v 1.4 2012/08/22 17:19:34 pascal Exp $ */
+/* $OpenBSD: flt_rounds.S,v 1.5 2015/10/27 05:54:49 guenther Exp $ */
/*
* Written by J.T. Conklin, Apr 4, 1995
* Public domain.
*/
-#include <machine/asm.h>
+#include "SYS.h"
.text
.align 2
#endif
addl $4,%esp
ret
+END_STRONG(__flt_rounds);
-/* $OpenBSD: fpclassifyl.c,v 1.1 2008/09/07 20:36:07 martynas Exp $ */
+/* $OpenBSD: fpclassifyl.c,v 1.2 2015/10/27 05:54:49 guenther Exp $ */
/*
* Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org>
*
return FP_NORMAL;
}
+DEF_STRONG(__fpclassifyl);
-/* $OpenBSD: ldexp.c,v 1.8 2015/01/04 16:12:42 daniel Exp $ */
+/* $OpenBSD: ldexp.c,v 1.9 2015/10/27 05:54:49 guenther Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
: "0" (value), "u" ((double)exp));
return (temp);
}
+DEF_STRONG(ldexp);
-/* $OpenBSD: flt_rounds.c,v 1.5 2013/01/05 11:20:55 miod Exp $ */
+/* $OpenBSD: flt_rounds.c,v 1.6 2015/10/27 05:54:49 guenther Exp $ */
/*
* Written by J.T. Conklin, Apr 10, 1995
__asm__("fldcr %0, %%fcr63" : "=r" (x));
return map[(x >> 14) & 0x03];
}
+DEF_STRONG(__flt_rounds);
-/* $OpenBSD: flt_rounds.c,v 1.3 2012/06/25 17:01:11 deraadt Exp $ */
+/* $OpenBSD: flt_rounds.c,v 1.4 2015/10/27 05:54:49 guenther Exp $ */
/*
* Written by J.T. Conklin, Apr 11, 1995
* Public domain.
__asm__("nop");
return map[x & 0x03];
}
+DEF_STRONG(__flt_rounds);
-/* $OpenBSD: fpclassifyl.c,v 1.1 2008/09/07 20:36:07 martynas Exp $ */
+/* $OpenBSD: fpclassifyl.c,v 1.2 2015/10/27 05:54:49 guenther Exp $ */
/*
* Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org>
*
return FP_NORMAL;
}
+DEF_STRONG(__fpclassifyl);
-/* $OpenBSD: ldexp.S,v 1.6 2005/08/07 16:40:15 espie Exp $ */
+/* $OpenBSD: ldexp.S,v 1.7 2015/10/27 05:54:49 guenther Exp $ */
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
* SUCH DAMAGE.
*/
-#include <machine/asm.h>
+#include "SYS.h"
#define DEXP_INF 0x7ff
#define DEXP_BIAS 1023
9:
mov.d $f0, $f12 # yes, result is just x
j ra
-END(ldexp)
+END_STRONG(ldexp)
-/* $OpenBSD: flt_rounds.c,v 1.5 2014/04/17 09:01:25 guenther Exp $ */
+/* $OpenBSD: flt_rounds.c,v 1.6 2015/10/27 05:54:49 guenther Exp $ */
/* $NetBSD: flt_rounds.c,v 1.5 2001/05/25 12:14:05 simonb Exp $ */
/*
return map[x & 0x03];
#endif
}
+DEF_STRONG(__flt_rounds);
-/* $OpenBSD: flt_rounds.c,v 1.4 2014/04/18 15:09:52 guenther Exp $ */
+/* $OpenBSD: flt_rounds.c,v 1.5 2015/10/27 05:54:49 guenther Exp $ */
/*
* Copyright (c) 2006 Miodrag Vallat.
*
return rndmap[fpgetround()];
#endif
}
+DEF_STRONG(__flt_rounds);
-/* $OpenBSD: flt_rounds.c,v 1.6 2012/06/25 17:01:11 deraadt Exp $ */
+/* $OpenBSD: flt_rounds.c,v 1.7 2015/10/27 05:54:49 guenther Exp $ */
/*
* Written by J.T. Conklin, Apr 10, 1995
* Public domain.
__asm__("st %%fsr,%0" : "=m" (*&x));
return map[(x >> 30) & 0x03];
}
+DEF_STRONG(__flt_rounds);
-/* $OpenBSD: flt_rounds.c,v 1.3 2012/06/25 17:01:11 deraadt Exp $ */
+/* $OpenBSD: flt_rounds.c,v 1.4 2015/10/27 05:54:49 guenther Exp $ */
/* $NetBSD: flt_rounds.c,v 1.1 1998/09/11 04:56:23 eeh Exp $ */
/*
__asm__("st %%fsr,%0" : "=m" (*&x));
return map[(x >> 30) & 0x03];
}
+DEF_STRONG(__flt_rounds);
-/* $OpenBSD: fpclassifyl.c,v 1.1 2008/09/07 20:36:08 martynas Exp $ */
+/* $OpenBSD: fpclassifyl.c,v 1.2 2015/10/27 05:54:49 guenther Exp $ */
/*
* Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org>
*
return FP_NORMAL;
}
+DEF_STRONG(__fpclassifyl);
-/* $OpenBSD: fpclassify.c,v 1.6 2013/03/28 18:09:38 martynas Exp $ */
+/* $OpenBSD: fpclassify.c,v 1.7 2015/10/27 05:54:49 guenther Exp $ */
/*
* Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org>
*
return FP_NORMAL;
}
+DEF_STRONG(__fpclassify);
int
__fpclassifyf(float f)
return FP_NORMAL;
}
+DEF_STRONG(__fpclassifyf);
-__strong_alias(__fpclassifyl, __fpclassify);
+MAKE_CLONE(__fpclassifyl, __fpclassify);
+DEF_STRONG(__fpclassifyl);
-/* $OpenBSD: ldexp.S,v 1.10 2013/07/05 21:10:50 miod Exp $ */
+/* $OpenBSD: ldexp.S,v 1.11 2015/10/27 05:54:49 guenther Exp $ */
/*
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
1:
movl $ ERANGE,_C_LABEL(errno)
ret
+END_STRONG(ldexp);
.data
huge: .word 0x7fff /* the largest number that can */
-/* $OpenBSD: fpclassify.c,v 1.8 2013/07/03 04:46:36 espie Exp $ */
+/* $OpenBSD: fpclassify.c,v 1.9 2015/10/27 05:54:49 guenther Exp $ */
/*
* Copyright (c) 2008 Martynas Venckus <martynas@openbsd.org>
*
return FP_NORMAL;
}
+DEF_STRONG(__fpclassify);
int
__fpclassifyf(float f)
return FP_NORMAL;
}
+DEF_STRONG(__fpclassifyf);
#if LDBL_MANT_DIG == DBL_MANT_DIG
-__strong_alias(__fpclassifyl, __fpclassify);
+MAKE_CLONE(__fpclassifyl, __fpclassify);
+DEF_STRONG(__fpclassifyl);
#endif /* LDBL_MANT_DIG == DBL_MANT_DIG */
-/* $OpenBSD: ldexp.c,v 1.9 2014/07/21 01:51:10 guenther Exp $ */
+/* $OpenBSD: ldexp.c,v 1.10 2015/10/27 05:54:49 guenther Exp $ */
/* @(#)s_scalbn.c 5.1 93/09/24 */
/* @(#)fdlibm.h 5.1 93/09/24 */
/*
SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20));
return x*twom54;
}
+DEF_STRONG(ldexp);
#if LDBL_MANT_DIG == DBL_MANT_DIG
__strong_alias(ldexpl, ldexp);
--- /dev/null
+/* $OpenBSD: float.h,v 1.1 2015/10/27 05:54:49 guenther Exp $ */
+/*
+ * Copyright (c) 2015 Philip Guenther <guenther@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.
+ */
+
+#ifndef _LIBC_FLOAT_H_
+#define _LIBC_FLOAT_H_
+
+#include_next <float.h>
+
+PROTO_NORMAL(__flt_rounds);
+
+#endif /* _LIBC_FLOAT_H_ */
--- /dev/null
+/* $OpenBSD: math.h,v 1.1 2015/10/27 05:54:49 guenther Exp $ */
+/*
+ * Copyright (c) 2015 Philip Guenther <guenther@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.
+ */
+
+#ifndef _LIBC_MATH_H_
+#define _LIBC_MATH_H_
+
+#include_next <math.h>
+
+/*
+ * This file only wraps the handful of functions that are both
+ * defined and used by libc.
+ */
+
+PROTO_NORMAL(__fpclassify);
+PROTO_NORMAL(__fpclassifyf);
+PROTO_NORMAL(__fpclassifyl);
+PROTO_NORMAL(ldexp);
+
+#endif /* !_LIBC_MATH_H_ */