go direct instead of through the PLT.
ok millert@ kettenis@
-/* $OpenBSD: fpgetround.c,v 1.4 2005/08/07 16:40:13 espie Exp $ */
+/* $OpenBSD: fpgetround.c,v 1.5 2016/07/26 19:07:09 guenther Exp $ */
/* $NetBSD: fpgetround.c,v 1.1 1995/04/29 05:09:55 cgd Exp $ */
/*
#include <ieeefp.h>
fp_rnd
-fpgetround()
+fpgetround(void)
{
double fpcrval;
u_int64_t old;
return ((old >> 58) & 0x3);
}
+DEF_WEAK(fpgetround);
-/* $OpenBSD: fpgetround.c,v 1.4 2014/04/18 15:09:52 guenther Exp $ */
+/* $OpenBSD: fpgetround.c,v 1.5 2016/07/26 19:07:09 guenther Exp $ */
/*
* Written by Miodrag Vallat. Public domain
#include <ieeefp.h>
fp_rnd
-fpgetround()
+fpgetround(void)
{
u_int64_t fpsr;
__asm__ volatile("fstd %%fr0,0(%1)" : "=m" (fpsr) : "r" (&fpsr));
return ((fpsr >> 41) & 0x3);
}
+DEF_WEAK(fpgetround);
-/* $OpenBSD: fpgetround.c,v 1.4 2013/01/05 11:20:55 miod Exp $ */
+/* $OpenBSD: fpgetround.c,v 1.5 2016/07/26 19:07:09 guenther Exp $ */
/*
* Written by J.T. Conklin, Apr 10, 1995
#include <ieeefp.h>
fp_rnd
-fpgetround()
+fpgetround(void)
{
int x;
__asm__ volatile ("fldcr %0, %%fcr63" : "=r" (x));
return (x >> 14) & 0x03;
}
+DEF_WEAK(fpgetround);
-/* $OpenBSD: fpgetround.c,v 1.2 2005/08/07 16:40:15 espie Exp $ */
+/* $OpenBSD: fpgetround.c,v 1.3 2016/07/26 19:07:09 guenther Exp $ */
/*
* Written by J.T. Conklin, Apr 11, 1995
* Public domain.
#include <ieeefp.h>
fp_rnd
-fpgetround()
+fpgetround(void)
{
int x;
__asm__("cfc1 %0,$31" : "=r" (x));
return x & 0x03;
}
+DEF_WEAK(fpgetround);
-/* $OpenBSD: flt_rounds.c,v 1.6 2015/10/27 05:54:49 guenther Exp $ */
+/* $OpenBSD: flt_rounds.c,v 1.7 2016/07/26 19:07:09 guenther Exp $ */
/* $NetBSD: flt_rounds.c,v 1.5 2001/05/25 12:14:05 simonb Exp $ */
/*
#include <sys/types.h>
#include <float.h>
+#include <ieeefp.h>
static const int map[] = {
};
int
-__flt_rounds()
+__flt_rounds(void)
{
#ifdef _SOFT_FLOAT
return map[fpgetround()];
-/* $OpenBSD: fpgetround.c,v 1.3 2014/04/17 09:01:25 guenther Exp $ */
+/* $OpenBSD: fpgetround.c,v 1.4 2016/07/26 19:07:09 guenther Exp $ */
/* $NetBSD: fpgetround.c,v 1.1 1999/07/07 01:55:08 danw Exp $ */
/*
#include <ieeefp.h>
fp_rnd
-fpgetround()
+fpgetround(void)
{
u_int64_t fpscr;
__asm__ volatile("mffs %0" : "=f"(fpscr));
return (fpscr & 0x3);
}
+DEF_WEAK(fpgetround);
-/* $OpenBSD: flt_rounds.c,v 1.5 2015/10/27 05:54:49 guenther Exp $ */
+/* $OpenBSD: flt_rounds.c,v 1.6 2016/07/26 19:07:09 guenther Exp $ */
/*
* Copyright (c) 2006 Miodrag Vallat.
*
#include <sys/types.h>
#include <float.h>
-#include <machine/ieeefp.h>
+#include <ieeefp.h>
static const int rndmap[] = {
1, /* round to nearest */
-/* $OpenBSD: fpgetround.c,v 1.2 2014/04/18 15:09:52 guenther Exp $ */
+/* $OpenBSD: fpgetround.c,v 1.3 2016/07/26 19:07:09 guenther Exp $ */
/*
* Copyright (c) 2006 Miodrag Vallat.
*
#include <ieeefp.h>
fp_rnd
-fpgetround()
+fpgetround(void)
{
register_t fpscr;
__asm__ volatile ("sts fpscr, %0" : "=r" (fpscr));
return (fpscr & 0x3);
}
+DEF_WEAK(fpgetround);
-/* $OpenBSD: fpgetround.c,v 1.3 2005/08/07 16:40:15 espie Exp $ */
+/* $OpenBSD: fpgetround.c,v 1.4 2016/07/26 19:07:09 guenther Exp $ */
/*
* Written by J.T. Conklin, Apr 10, 1995
* Public domain.
#include <ieeefp.h>
fp_rnd
-fpgetround()
+fpgetround(void)
{
int x;
__asm__("st %%fsr,%0" : "=m" (*&x));
return (x >> 30) & 0x03;
}
+DEF_WEAK(fpgetround);
-/* $OpenBSD: fpgetround.c,v 1.1 2001/08/29 01:34:56 art Exp $ */
+/* $OpenBSD: fpgetround.c,v 1.2 2016/07/26 19:07:09 guenther Exp $ */
/*
* Written by J.T. Conklin, Apr 10, 1995
#include <ieeefp.h>
fp_rnd
-fpgetround()
+fpgetround(void)
{
int x;
__asm__("st %%fsr,%0" : "=m" (*&x));
return (x >> 30) & 0x03;
}
+DEF_WEAK(fpgetround);
--- /dev/null
+/* $OpenBSD: ieeefp.h,v 1.1 2016/07/26 19:07:09 guenther Exp $ */
+/*
+ * Copyright (c) 2016 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_IEEEFP_H_
+#define _LIBC_IEEEFP_H_
+
+#include_next <ieeefp.h>
+
+PROTO_DEPRECATED(fpgetmask);
+PROTO_NORMAL(fpgetround);
+PROTO_DEPRECATED(fpgetsticky);
+PROTO_DEPRECATED(fpsetmask);
+PROTO_DEPRECATED(fpsetround);
+PROTO_DEPRECATED(fpsetsticky);
+
+#endif /* _LIBC_IEEEFP_H_ */
-/* $OpenBSD: fpgetround.c,v 1.6 2016/07/18 19:05:22 guenther Exp $ */
+/* $OpenBSD: fpgetround.c,v 1.7 2016/07/26 19:07:09 guenther Exp $ */
/* $NetBSD: fpgetround.c,v 1.2 2002/01/13 21:45:53 thorpej Exp $ */
/*-
return float_rounding_mode;
}
+DEF_WEAK(fpgetround);