From c614ca505dd2947acbd111e2764056aeac2012ad Mon Sep 17 00:00:00 2001 From: darylm503 Date: Fri, 16 Sep 2011 20:59:10 +0000 Subject: StdLib: Patches and updates for ARM. Add ARMGCC and RVCT toolchain support. Update and Add ARM specific machine headers. Set the empty macro for __warn_references(). Make __flt_rounds() return 'Round to nearest' by default on ARM. Signed-off-by: Olivier Martin [olivier.martin@arm.com] Reviewed-by: darylm503 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12367 6f19259b-4bc3-4df7-8a09-765794883524 --- StdLib/LibC/Main/Arm/flt_rounds.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'StdLib/LibC/Main/Arm/flt_rounds.c') diff --git a/StdLib/LibC/Main/Arm/flt_rounds.c b/StdLib/LibC/Main/Arm/flt_rounds.c index 3f43650270..a64f447aab 100644 --- a/StdLib/LibC/Main/Arm/flt_rounds.c +++ b/StdLib/LibC/Main/Arm/flt_rounds.c @@ -1,4 +1,4 @@ -/* $NetBSD: flt_rounds.c,v 1.3 2006/02/25 00:58:35 wiz Exp $ */ +/* $NetBSD: flt_rounds.c,v 1.3 2006/02/25 00:58:35 wiz Exp $ */ /* * Copyright (c) 1996 Mark Brinicombe @@ -15,7 +15,7 @@ * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by Mark Brinicombe - * for the NetBSD Project. + * for the NetBSD Project. * 4. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission * @@ -31,29 +31,29 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include +#include #if defined(LIBC_SCCS) && !defined(lint) __RCSID("$NetBSD: flt_rounds.c,v 1.3 2006/02/25 00:58:35 wiz Exp $"); #endif /* LIBC_SCCS and not lint */ #include -#include +//#include static const int map[] = { - 1, /* round to nearest */ - 2, /* round to positive infinity */ - 3, /* round to negative infinity */ - 0 /* round to zero */ + 1, /* round to nearest */ + 2, /* round to positive infinity */ + 3, /* round to negative infinity */ + 0 /* round to zero */ }; /* * Return the current FP rounding mode * * Returns: - * 0 - round to zero - * 1 - round to nearest - * 2 - round to postive infinity - * 3 - round to negative infinity + * 0 - round to zero + * 1 - round to nearest + * 2 - round to postive infinity + * 3 - round to negative infinity * * ok all we need to do is get the current FP rounding mode * index our map table and return the appropriate value. @@ -77,5 +77,6 @@ int __flt_rounds(void); int __flt_rounds() { - return(map[fpgetround()]); + //return(map[fpgetround()]); + return 1; //TODO: FixMe } -- cgit v1.2.3