From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31222 invoked by alias); 24 Sep 2012 23:23:42 -0000 Received: (qmail 31214 invoked by uid 22791); 24 Sep 2012 23:23:41 -0000 X-SWARE-Spam-Status: No, hits=-6.1 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 24 Sep 2012 23:23:28 +0000 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id F1BCD33CF72 for ; Mon, 24 Sep 2012 23:23:27 +0000 (UTC) From: Mike Frysinger To: libc-ports@sourceware.org Subject: [PATCH] ia64: define new get-rounding-mode.h header Date: Mon, 24 Sep 2012 23:23:00 -0000 Message-Id: <1348529011-15269-1-git-send-email-vapier@gentoo.org> In-Reply-To: References: X-IsSubscribed: yes Mailing-List: contact libc-ports-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: libc-ports-owner@sourceware.org X-SW-Source: 2012-09/txt/msg00071.txt.bz2 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 --- ports/ChangeLog.ia64 | 6 +++++ ports/sysdeps/ia64/fpu/fegetround.c | 10 +++----- ports/sysdeps/ia64/fpu/get-rounding-mode.h | 37 ++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 7 deletions(-) create mode 100644 ports/sysdeps/ia64/fpu/get-rounding-mode.h diff --git a/ports/ChangeLog.ia64 b/ports/ChangeLog.ia64 index 3566b37..39ec5ff 100644 --- a/ports/ChangeLog.ia64 +++ b/ports/ChangeLog.ia64 @@ -1,5 +1,11 @@ 2012-09-24 Mike Frysinger + * 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 + * sysdeps/ia64/Makeconfig: New file. 2012-08-16 Carlos O'Donell diff --git a/ports/sysdeps/ia64/fpu/fegetround.c b/ports/sysdeps/ia64/fpu/fegetround.c index e672f61..403aadb 100644 --- a/ports/sysdeps/ia64/fpu/fegetround.c +++ b/ports/sysdeps/ia64/fpu/fegetround.c @@ -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 , 1999. @@ -17,14 +17,10 @@ License along with the GNU C Library; if not, see . */ -#include +#include int fegetround (void) { - fenv_t fpsr; - - __asm__ __volatile__ ("mov.m %0=ar.fpsr" : "=r" (fpsr)); - - return (fpsr >> 10) & 3; + return get_rounding_mode (); } diff --git a/ports/sysdeps/ia64/fpu/get-rounding-mode.h b/ports/sysdeps/ia64/fpu/get-rounding-mode.h new file mode 100644 index 0000000..1e18473 --- /dev/null +++ b/ports/sysdeps/ia64/fpu/get-rounding-mode.h @@ -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 , 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 + . */ + +#ifndef IA64_GET_ROUNDING_MODE_H +#define IA64_GET_ROUNDING_MODE_H 1 + +#include + +/* 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 */ -- 1.7.12