Date: Sat, 25 Jan 2014 18:13:43 +0000 (UTC) From: Andrew Turner <andrew@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261163 - head/lib/msun/arm Message-ID: <201401251813.s0PIDhAa031878@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: andrew Date: Sat Jan 25 18:13:43 2014 New Revision: 261163 URL: http://svnweb.freebsd.org/changeset/base/261163 Log: * Mark static inline functions with __fenv_static. * Correctly shift the mask when masking/unmasking exceptions. Modified: head/lib/msun/arm/fenv.h Modified: head/lib/msun/arm/fenv.h ============================================================================== --- head/lib/msun/arm/fenv.h Sat Jan 25 16:35:56 2014 (r261162) +++ head/lib/msun/arm/fenv.h Sat Jan 25 18:13:43 2014 (r261163) @@ -98,6 +98,8 @@ int feupdateenv(const fenv_t *__envp); #define vmrs_fpscr(__r) __asm __volatile("vmrs %0, fpscr" : "=&r"(__r)) #define vmsr_fpscr(__r) __asm __volatile("vmsr fpscr, %0" : : "r"(__r)) +#define _FPU_MASK_SHIFT 8 + __fenv_static inline int feclearexcept(int __excepts) { @@ -213,29 +215,31 @@ feupdateenv(const fenv_t *__envp) /* We currently provide no external definitions of the functions below. */ -static inline int +__fenv_static inline int feenableexcept(int __mask) { fenv_t __old_fpsr, __new_fpsr; vmrs_fpscr(__old_fpsr); - __new_fpsr = __old_fpsr | (__mask & FE_ALL_EXCEPT); + __new_fpsr = __old_fpsr | + ((__mask & FE_ALL_EXCEPT) << _FPU_MASK_SHIFT); vmsr_fpscr(__new_fpsr); - return (__old_fpsr & FE_ALL_EXCEPT); + return ((__old_fpsr >> _FPU_MASK_SHIFT) & FE_ALL_EXCEPT); } -static inline int +__fenv_static inline int fedisableexcept(int __mask) { fenv_t __old_fpsr, __new_fpsr; vmrs_fpscr(__old_fpsr); - __new_fpsr = __old_fpsr & ~(__mask & FE_ALL_EXCEPT); + __new_fpsr = __old_fpsr & + ~((__mask & FE_ALL_EXCEPT) << _FPU_MASK_SHIFT); vmsr_fpscr(__new_fpsr); - return (__old_fpsr & FE_ALL_EXCEPT); + return ((__old_fpsr >> _FPU_MASK_SHIFT) & FE_ALL_EXCEPT); } -static inline int +__fenv_static inline int fegetexcept(void) { fenv_t __fpsr;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201401251813.s0PIDhAa031878>