Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libm/arch/arm Make this compile for earmhf
details: https://anonhg.NetBSD.org/src/rev/340d79270df1
branches: trunk
changeset: 786508:340d79270df1
user: matt <matt%NetBSD.org@localhost>
date: Tue Apr 30 01:45:13 2013 +0000
description:
Make this compile for earmhf
diffstat:
lib/libm/arch/arm/fenv.c | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)
diffs (86 lines):
diff -r 459eb64dd66f -r 340d79270df1 lib/libm/arch/arm/fenv.c
--- a/lib/libm/arch/arm/fenv.c Tue Apr 30 01:44:07 2013 +0000
+++ b/lib/libm/arch/arm/fenv.c Tue Apr 30 01:45:13 2013 +0000
@@ -28,20 +28,20 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: fenv.c,v 1.1 2013/04/28 21:06:34 matt Exp $");
+__RCSID("$NetBSD: fenv.c,v 1.2 2013/04/30 01:45:13 matt Exp $");
#include <sys/types.h>
#include <assert.h>
#include <fenv.h>
#include <string.h>
#include <unistd.h>
+#include <inttypes.h>
#ifdef __SOFTFP__
#include <ieeefp.h>
#include <sys/signal.h>
#include <sys/siginfo.h>
#else
-#include <inttypes.h>
#include <arm/armreg.h>
#endif
@@ -56,7 +56,9 @@
int
feclearexcept(int excepts)
{
+#ifndef lint
_DIAGASSERT((except & ~FE_EXCEPT_ALL) == 0);
+#endif
#ifdef __SOFTFP__
int old = fpresetsticky(excepts);
return old & ~excepts;
@@ -93,7 +95,9 @@
int
feraiseexcept(int excepts)
{
+#ifndef lint
_DIAGASSERT((except & ~FE_EXCEPT_ALL) == 0);
+#endif
#ifdef __SOFTFP__
excepts &= fpgetsticky();
@@ -116,7 +120,7 @@
sigqueueinfo(getpid(), &info);
}
#else
- uint32_t fpscr = armreg_fpscr_read();
+ int fpscr = armreg_fpscr_read();
fpscr = (fpscr & ~VFP_FPSCR_ESUM) | __SHIFTIN(excepts, VFP_FPSCR_ESUM);
armreg_fpscr_write(fpscr);
#endif
@@ -135,7 +139,9 @@
int
fesetexceptflag(const fexcept_t *flagp, int excepts)
{
+#ifndef lint
_DIAGASSERT((except & ~FE_EXCEPT_ALL) == 0);
+#endif
#ifdef __SOFTFP__
fpsetsticky((fpgetsticky() & ~excepts) | (excepts & *flagp));
#else
@@ -184,7 +190,9 @@
int
fesetround(int round)
{
+#ifndef lint
_DIAGASSERT(!(round & ~__SHIFTOUT(VFP_FPSCR_RMODE, VFP_FPSCR_RMODE)));
+#endif
#ifdef __SOFTFP__
(void)fpsetround(round);
#else
@@ -262,8 +270,9 @@
int
feupdateenv(const fenv_t *envp)
{
+#ifndef lint
_DIAGASSERT(envp != NULL);
-
+#endif
#ifdef __SOFTFP__
(void)fpsetround(__SHIFTIN(*envp, VFP_FPSCR_RMODE));
(void)fpsetmask(fpgetmask() | __SHIFTOUT(*envp, VFP_FPSCR_ESUM));
Home |
Main Index |
Thread Index |
Old Index