diff mbox

[10/13] AArch64: Cleanup fenv implementation

Message ID 001401cfeee7$d09d4ea0$71d7ebe0$@com
State New
Headers show

Commit Message

Wilco Oct. 23, 2014, 5:36 p.m. UTC
Call libc_fetestexcept_aarch64 from math_private.h rather than duplicating functionality.

ChangeLog:
2014-10-23  Wilco Dijkstra  <wdijkstr@arm.com>

	* sysdeps/aarch64/fpu/fgetexcptflg.c (fegetexceptflag):
	Call libc_fetestexcept_aarch64.

---
 sysdeps/aarch64/fpu/fgetexcptflg.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

Comments

Marcus Shawcroft Oct. 24, 2014, 9:19 a.m. UTC | #1
On 23 October 2014 18:36, Wilco Dijkstra <wdijkstr@arm.com> wrote:
> Call libc_fetestexcept_aarch64 from math_private.h rather than duplicating functionality.
>
> ChangeLog:
> 2014-10-23  Wilco Dijkstra  <wdijkstr@arm.com>
>
>         * sysdeps/aarch64/fpu/fgetexcptflg.c (fegetexceptflag):
>         Call libc_fetestexcept_aarch64.
>

> -#include <fenv.h>

Don't drop this header, it provides the prototype for
fegetexceptflag().  Otherwise OK.
/Marcus
diff mbox

Patch

diff --git a/sysdeps/aarch64/fpu/fgetexcptflg.c b/sysdeps/aarch64/fpu/fgetexcptflg.c
index d25da1ca..364f5da 100644
--- a/sysdeps/aarch64/fpu/fgetexcptflg.c
+++ b/sysdeps/aarch64/fpu/fgetexcptflg.c
@@ -16,18 +16,11 @@ 
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <fenv.h>
-#include <fpu_control.h>
+#include <math_private.h>
 
 int
 fegetexceptflag (fexcept_t *flagp, int excepts)
 {
-  fpu_fpsr_t fpsr;
-
-  /* Get the current exceptions.  */
-  _FPU_GETFPSR (fpsr);
-
-  *flagp = fpsr & excepts & FE_ALL_EXCEPT;
-
+  *flagp = libc_fetestexcept_aarch64 (excepts);
   return 0;
 }