xref: /openbsd-src/lib/libc/softfloat/fpgetround.c (revision 08daf0c23d348e44ad9e5fdcb608738a28c9c404)
1*08daf0c2Sdrahn /*	$OpenBSD: fpgetround.c,v 1.1 2006/11/06 15:11:37 drahn Exp $	*/
2*08daf0c2Sdrahn /* $NetBSD: fpgetround.c,v 1.2 2002/01/13 21:45:53 thorpej Exp $ */
3*08daf0c2Sdrahn 
4*08daf0c2Sdrahn /*-
5*08daf0c2Sdrahn  * Copyright (c) 1997 The NetBSD Foundation, Inc.
6*08daf0c2Sdrahn  * All rights reserved.
7*08daf0c2Sdrahn  *
8*08daf0c2Sdrahn  * This code is derived from software contributed to The NetBSD Foundation
9*08daf0c2Sdrahn  * by Neil A. Carson and Mark Brinicombe
10*08daf0c2Sdrahn  *
11*08daf0c2Sdrahn  * Redistribution and use in source and binary forms, with or without
12*08daf0c2Sdrahn  * modification, are permitted provided that the following conditions
13*08daf0c2Sdrahn  * are met:
14*08daf0c2Sdrahn  * 1. Redistributions of source code must retain the above copyright
15*08daf0c2Sdrahn  *    notice, this list of conditions and the following disclaimer.
16*08daf0c2Sdrahn  * 2. Redistributions in binary form must reproduce the above copyright
17*08daf0c2Sdrahn  *    notice, this list of conditions and the following disclaimer in the
18*08daf0c2Sdrahn  *    documentation and/or other materials provided with the distribution.
19*08daf0c2Sdrahn  * 3. All advertising materials mentioning features or use of this software
20*08daf0c2Sdrahn  *    must display the following acknowledgement:
21*08daf0c2Sdrahn  *	This product includes software developed by the NetBSD
22*08daf0c2Sdrahn  *	Foundation, Inc. and its contributors.
23*08daf0c2Sdrahn  * 4. Neither the name of The NetBSD Foundation nor the names of its
24*08daf0c2Sdrahn  *    contributors may be used to endorse or promote products derived
25*08daf0c2Sdrahn  *    from this software without specific prior written permission.
26*08daf0c2Sdrahn  *
27*08daf0c2Sdrahn  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
28*08daf0c2Sdrahn  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
29*08daf0c2Sdrahn  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
30*08daf0c2Sdrahn  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
31*08daf0c2Sdrahn  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32*08daf0c2Sdrahn  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33*08daf0c2Sdrahn  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34*08daf0c2Sdrahn  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35*08daf0c2Sdrahn  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36*08daf0c2Sdrahn  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37*08daf0c2Sdrahn  * POSSIBILITY OF SUCH DAMAGE.
38*08daf0c2Sdrahn  */
39*08daf0c2Sdrahn 
40*08daf0c2Sdrahn #include <sys/cdefs.h>
41*08daf0c2Sdrahn 
42*08daf0c2Sdrahn #include "namespace.h"
43*08daf0c2Sdrahn 
44*08daf0c2Sdrahn #include <ieeefp.h>
45*08daf0c2Sdrahn #ifdef SOFTFLOAT_FOR_GCC
46*08daf0c2Sdrahn #include "softfloat-for-gcc.h"
47*08daf0c2Sdrahn #endif
48*08daf0c2Sdrahn #include "milieu.h"
49*08daf0c2Sdrahn #include "softfloat.h"
50*08daf0c2Sdrahn 
51*08daf0c2Sdrahn #ifdef __weak_alias
52*08daf0c2Sdrahn __weak_alias(_fpgetround,fpgetround);
53*08daf0c2Sdrahn #endif
54*08daf0c2Sdrahn 
55*08daf0c2Sdrahn fp_rnd
56*08daf0c2Sdrahn fpgetround(void)
57*08daf0c2Sdrahn {
58*08daf0c2Sdrahn 
59*08daf0c2Sdrahn 	return float_rounding_mode;
60*08daf0c2Sdrahn }
61