alpha: Fix exception raising from soft-fp

Use the SSI_IEEE_RAISE_EXCEPTION function as from feraiseexcept,
instead of __ieee_get+set_fp_status.  Always raise the FP exceptions
from float-to-integer conversion.
This commit is contained in:
Richard Henderson 2014-08-05 13:36:36 -07:00
parent d3f364d3c7
commit 27bb6dc0db
5 changed files with 21 additions and 12 deletions

View File

@ -1,5 +1,14 @@
2014-08-05 Richard Henderson <rth@redhat.com> 2014-08-05 Richard Henderson <rth@redhat.com>
* sysdeps/alpha/soft-fp/ots_cvtxq.c (_OtsCvtXQ): Always raise
exceptions.
* sysdeps/alpha/soft-fp/Makefile [soft-fp] (sysdep_routines):
Add fraiseexcpt.
* sysdeps/alpha/soft-fp/sfp-machine.h (FP_HANDLE_EXCEPTIONS):
Use __feraiseexcept.
* sysdeps/unix/sysv/linux/alpha/fraiseexcpt.S (feraiseexcept):
Protect libm symbols with IS_IN_libm.
* sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Remove file. * sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Remove file.
2014-08-04 Bernard Ogden <bernie.ogden@linaro.org> 2014-08-04 Bernard Ogden <bernie.ogden@linaro.org>

View File

@ -2,7 +2,8 @@
ifeq ($(subdir),soft-fp) ifeq ($(subdir),soft-fp)
sysdep_routines += ots_add ots_sub ots_mul ots_div ots_cmp ots_cmpe \ sysdep_routines += ots_add ots_sub ots_mul ots_div ots_cmp ots_cmpe \
ots_cvtxq ots_cvtqx ots_cvtqux ots_cvttx ots_cvtxt ots_nintxq ots_cvtxq ots_cvtqx ots_cvtqux ots_cvttx ots_cvtxt ots_nintxq \
fraiseexcpt
endif endif
ifeq ($(subdir),math) ifeq ($(subdir),math)

View File

@ -35,9 +35,7 @@ _OtsCvtXQ (long al, long ah, long _round)
FP_INIT_ROUNDMODE; FP_INIT_ROUNDMODE;
FP_UNPACK_RAW_Q(A, a); FP_UNPACK_RAW_Q(A, a);
FP_TO_INT_Q(r, A, 64, s); FP_TO_INT_Q(r, A, 64, s);
FP_HANDLE_EXCEPTIONS;
if (s > 0 && (_fex &= FP_EX_INVALID))
FP_HANDLE_EXCEPTIONS;
return r; return r;
} }

View File

@ -86,13 +86,13 @@ do { \
} \ } \
} while (0) } while (0)
/* We copy the libm function into libc for soft-fp. */
extern int __feraiseexcept (int __excepts) attribute_hidden;
#define FP_HANDLE_EXCEPTIONS \ #define FP_HANDLE_EXCEPTIONS \
do { \ do { \
if (__builtin_expect (_fex, 0)) \ if (__builtin_expect (_fex, 0)) \
{ \ __feraiseexcept (_fex); \
unsigned long t = __ieee_get_fp_control (); \
__ieee_set_fp_control (t | _fex); \
} \
} while (0) } while (0)
#define FP_TRAPPING_EXCEPTIONS \ #define FP_TRAPPING_EXCEPTIONS \

View File

@ -46,11 +46,12 @@ ENTRY(__feraiseexcept)
END(__feraiseexcept) END(__feraiseexcept)
cfi_endproc cfi_endproc
#include <shlib-compat.h> #ifdef IS_IN_libm
#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2) # include <shlib-compat.h>
# if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
strong_alias (__feraiseexcept, __old_feraiseexcept) strong_alias (__feraiseexcept, __old_feraiseexcept)
compat_symbol (libm, __old_feraiseexcept, feraiseexcept, GLIBC_2_1); compat_symbol (libm, __old_feraiseexcept, feraiseexcept, GLIBC_2_1);
#endif # endif
libm_hidden_ver (__feraiseexcept, feraiseexcept) libm_hidden_ver (__feraiseexcept, feraiseexcept)
versioned_symbol (libm, __feraiseexcept, feraiseexcept, GLIBC_2_2); versioned_symbol (libm, __feraiseexcept, feraiseexcept, GLIBC_2_2);
#endif