ia64: define new get-rounding-mode.h header

The new strtod function wants rounding information from the C lib, so
move the guts of the ia64 version into a header file for it to use.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
Mike Frysinger 2012-09-24 17:52:18 -04:00
parent 2d48610df2
commit 15055a1cd7
3 changed files with 46 additions and 7 deletions

View File

@ -1,3 +1,9 @@
2012-09-24 Mike Frysinger <vapier@gentoo.org>
* ports/sysdeps/ia64/fpu/fegetround.c (fegetround): Move contents
of function to ...
* ports/sysdeps/ia64/fpu/get-rounding-mode.h: ... here.
2012-09-24 Mike Frysinger <vapier@gentoo.org>
* sysdeps/ia64/Makeconfig: New file.

View File

@ -1,5 +1,5 @@
/* Return current rounding direction.
Copyright (C) 1999, 2000 Free Software Foundation, Inc.
Copyright (C) 1999-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Christian Boissat <Christian.Boissat@cern.ch>, 1999.
@ -17,14 +17,10 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include <fenv.h>
#include <get-rounding-mode.h>
int
fegetround (void)
{
fenv_t fpsr;
__asm__ __volatile__ ("mov.m %0=ar.fpsr" : "=r" (fpsr));
return (fpsr >> 10) & 3;
return get_rounding_mode ();
}

View File

@ -0,0 +1,37 @@
/* Return current rounding direction within libc. IA64 version.
Copyright (C) 1999-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Christian Boissat <Christian.Boissat@cern.ch>, 1999.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#ifndef IA64_GET_ROUNDING_MODE_H
#define IA64_GET_ROUNDING_MODE_H 1
#include <fenv.h>
/* Return the floating-point rounding mode. */
static inline int
get_rounding_mode (void)
{
fenv_t fpsr;
__asm__ __volatile__ ("mov.m %0=ar.fpsr" : "=r" (fpsr));
return (fpsr >> 10) & 3;
}
#endif /* get-rounding-mode.h */