From 27bb6dc0db1d0da548a0be3ec1aa33e2c25565cd Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Tue, 5 Aug 2014 13:36:36 -0700 Subject: 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. --- sysdeps/alpha/soft-fp/Makefile | 3 ++- sysdeps/alpha/soft-fp/ots_cvtxq.c | 4 +--- sysdeps/alpha/soft-fp/sfp-machine.h | 8 ++++---- 3 files changed, 7 insertions(+), 8 deletions(-) (limited to 'sysdeps/alpha') diff --git a/sysdeps/alpha/soft-fp/Makefile b/sysdeps/alpha/soft-fp/Makefile index 5410a78984..83baa7c49d 100644 --- a/sysdeps/alpha/soft-fp/Makefile +++ b/sysdeps/alpha/soft-fp/Makefile @@ -2,7 +2,8 @@ ifeq ($(subdir),soft-fp) 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 ifeq ($(subdir),math) diff --git a/sysdeps/alpha/soft-fp/ots_cvtxq.c b/sysdeps/alpha/soft-fp/ots_cvtxq.c index 1eef9490c3..2447a381ac 100644 --- a/sysdeps/alpha/soft-fp/ots_cvtxq.c +++ b/sysdeps/alpha/soft-fp/ots_cvtxq.c @@ -35,9 +35,7 @@ _OtsCvtXQ (long al, long ah, long _round) FP_INIT_ROUNDMODE; FP_UNPACK_RAW_Q(A, a); FP_TO_INT_Q(r, A, 64, s); - - if (s > 0 && (_fex &= FP_EX_INVALID)) - FP_HANDLE_EXCEPTIONS; + FP_HANDLE_EXCEPTIONS; return r; } diff --git a/sysdeps/alpha/soft-fp/sfp-machine.h b/sysdeps/alpha/soft-fp/sfp-machine.h index e11a8dd7ca..bd78534163 100644 --- a/sysdeps/alpha/soft-fp/sfp-machine.h +++ b/sysdeps/alpha/soft-fp/sfp-machine.h @@ -86,13 +86,13 @@ do { \ } \ } while (0) +/* We copy the libm function into libc for soft-fp. */ +extern int __feraiseexcept (int __excepts) attribute_hidden; + #define FP_HANDLE_EXCEPTIONS \ do { \ if (__builtin_expect (_fex, 0)) \ - { \ - unsigned long t = __ieee_get_fp_control (); \ - __ieee_set_fp_control (t | _fex); \ - } \ + __feraiseexcept (_fex); \ } while (0) #define FP_TRAPPING_EXCEPTIONS \ -- cgit 1.4.1