diff options
Diffstat (limited to 'sysdeps/aarch64/fpu/math_private.h')
-rw-r--r-- | sysdeps/aarch64/fpu/math_private.h | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/sysdeps/aarch64/fpu/math_private.h b/sysdeps/aarch64/fpu/math_private.h index fd8eb1fb56..fcd02c0654 100644 --- a/sysdeps/aarch64/fpu/math_private.h +++ b/sysdeps/aarch64/fpu/math_private.h @@ -1,5 +1,5 @@ /* Private floating point rounding and exceptions handling. AArch64 version. - Copyright (C) 2014-2016 Free Software Foundation, Inc. + Copyright (C) 2014-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -22,27 +22,6 @@ #include <fenv.h> #include <fpu_control.h> -#define math_opt_barrier(x) \ -({ __typeof (x) __x = (x); __asm ("" : "+w" (__x)); __x; }) -#define math_force_eval(x) \ -({ __typeof (x) __x = (x); __asm __volatile__ ("" : : "w" (__x)); }) - -extern __always_inline double -__ieee754_sqrt (double d) -{ - double res; - asm __volatile__ ("fsqrt %d0, %d1" : "=w" (res) : "w" (d)); - return res; -} - -extern __always_inline float -__ieee754_sqrtf (float s) -{ - float res; - asm __volatile__ ("fsqrt %s0, %s1" : "=w" (res) : "w" (s)); - return res; -} - static __always_inline void libc_feholdexcept_aarch64 (fenv_t *envp) { @@ -319,6 +298,26 @@ libc_feresetround_noex_aarch64_ctx (struct rm_ctx *ctx) #define libc_feresetround_noexf_ctx libc_feresetround_noex_aarch64_ctx #define libc_feresetround_noexl_ctx libc_feresetround_noex_aarch64_ctx +/* Hack: only include the large arm_neon.h when needed. */ +#ifdef _MATH_CONFIG_H +# include <arm_neon.h> + +/* ACLE intrinsics for frintn and fcvtns instructions. */ +# define TOINT_INTRINSICS 1 + +static inline double_t +roundtoint (double_t x) +{ + return vget_lane_f64 (vrndn_f64 (vld1_f64 (&x)), 0); +} + +static inline uint64_t +converttoint (double_t x) +{ + return vcvtnd_s64_f64 (x); +} +#endif + #include_next <math_private.h> #endif |