[7/13] AArch64: Cleanup fenv implementation

Message ID 001101cfeee7$ae6f75b0$0b4e6110$@com
State Committed
Headers

Commit Message

Wilco Dijkstra Oct. 23, 2014, 5:35 p.m. UTC
  Call get_rounding_mode rather than duplicating functionality.

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

	* sysdeps/aarch64/fpu/fegetround.c (fegetround):
	Call get_rounding_mode.

---
 sysdeps/aarch64/fpu/fegetround.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
  

Comments

Marcus Shawcroft Oct. 24, 2014, 9:02 a.m. UTC | #1
On 23 October 2014 18:35, Wilco Dijkstra <wdijkstr@arm.com> wrote:
> Call get_rounding_mode rather than duplicating functionality.
>
> ChangeLog:
> 2014-10-23  Wilco Dijkstra  <wdijkstr@arm.com>
>
>         * sysdeps/aarch64/fpu/fegetround.c (fegetround):
>         Call get_rounding_mode.
>
> ---
>  sysdeps/aarch64/fpu/fegetround.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/sysdeps/aarch64/fpu/fegetround.c b/sysdeps/aarch64/fpu/fegetround.c
> index a970ce3..a32532b 100644
> --- a/sysdeps/aarch64/fpu/fegetround.c
> +++ b/sysdeps/aarch64/fpu/fegetround.c
> @@ -16,14 +16,11 @@
>     License along with the GNU C Library; if not, see
>     <http://www.gnu.org/licenses/>.  */
>

> -#include <fenv.h>

This provides the prototype for fegetround() therefore it should not
be removed. Otherwise OK.

/Marcus
  

Patch

diff --git a/sysdeps/aarch64/fpu/fegetround.c b/sysdeps/aarch64/fpu/fegetround.c
index a970ce3..a32532b 100644
--- a/sysdeps/aarch64/fpu/fegetround.c
+++ b/sysdeps/aarch64/fpu/fegetround.c
@@ -16,14 +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 <get-rounding-mode.h>
 
 int
 fegetround (void)
 {
-  fpu_control_t fpcr;
-  _FPU_GETCW (fpcr);
-  return fpcr & FE_TOWARDZERO;
+  return get_rounding_mode ();
 }
 libm_hidden_def (fegetround)