fpgetround.c revision 129203
1129203Scognet/* $NetBSD: fpgetround.c,v 1.2 2002/01/13 21:45:53 thorpej Exp $ */ 2129203Scognet 3129203Scognet/*- 4129203Scognet * Copyright (c) 1997 The NetBSD Foundation, Inc. 5129203Scognet * All rights reserved. 6129203Scognet * 7129203Scognet * This code is derived from software contributed to The NetBSD Foundation 8129203Scognet * by Neil A. Carson and Mark Brinicombe 9129203Scognet * 10129203Scognet * Redistribution and use in source and binary forms, with or without 11129203Scognet * modification, are permitted provided that the following conditions 12129203Scognet * are met: 13129203Scognet * 1. Redistributions of source code must retain the above copyright 14129203Scognet * notice, this list of conditions and the following disclaimer. 15129203Scognet * 2. Redistributions in binary form must reproduce the above copyright 16129203Scognet * notice, this list of conditions and the following disclaimer in the 17129203Scognet * documentation and/or other materials provided with the distribution. 18129203Scognet * 3. All advertising materials mentioning features or use of this software 19129203Scognet * must display the following acknowledgement: 20129203Scognet * This product includes software developed by the NetBSD 21129203Scognet * Foundation, Inc. and its contributors. 22129203Scognet * 4. Neither the name of The NetBSD Foundation nor the names of its 23129203Scognet * contributors may be used to endorse or promote products derived 24129203Scognet * from this software without specific prior written permission. 25129203Scognet * 26129203Scognet * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 27129203Scognet * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 28129203Scognet * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 29129203Scognet * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 30129203Scognet * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 31129203Scognet * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 32129203Scognet * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 33129203Scognet * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 34129203Scognet * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 35129203Scognet * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 36129203Scognet * POSSIBILITY OF SUCH DAMAGE. 37129203Scognet */ 38129203Scognet 39129203Scognet#include <sys/cdefs.h> 40129203Scognet__FBSDID("$FreeBSD: head/lib/libc/softfloat/fpgetround.c 129203 2004-05-14 12:13:06Z cognet $"); 41129203Scognet 42129203Scognet#include "namespace.h" 43129203Scognet 44129203Scognet#include <ieeefp.h> 45129203Scognet#ifdef SOFTFLOAT_FOR_GCC 46129203Scognet#include "softfloat-for-gcc.h" 47129203Scognet#endif 48129203Scognet#include "milieu.h" 49129203Scognet#include "softfloat.h" 50129203Scognet 51129203Scognet#ifdef __weak_alias 52129203Scognet__weak_alias(fpgetround,_fpgetround) 53129203Scognet#endif 54129203Scognet 55129203Scognetfp_rnd_t 56129203Scognetfpgetround(void) 57129203Scognet{ 58129203Scognet 59129203Scognet return float_rounding_mode; 60129203Scognet} 61