138f92d0cSXin LI /* $NetBSD: fpgetround.c,v 1.3 2008/04/28 20:23:00 martin Exp $ */ 215144b0fSOlivier Houchard 315144b0fSOlivier Houchard /*- 415144b0fSOlivier Houchard * Copyright (c) 1997 The NetBSD Foundation, Inc. 515144b0fSOlivier Houchard * All rights reserved. 615144b0fSOlivier Houchard * 715144b0fSOlivier Houchard * This code is derived from software contributed to The NetBSD Foundation 815144b0fSOlivier Houchard * by Neil A. Carson and Mark Brinicombe 915144b0fSOlivier Houchard * 1015144b0fSOlivier Houchard * Redistribution and use in source and binary forms, with or without 1115144b0fSOlivier Houchard * modification, are permitted provided that the following conditions 1215144b0fSOlivier Houchard * are met: 1315144b0fSOlivier Houchard * 1. Redistributions of source code must retain the above copyright 1415144b0fSOlivier Houchard * notice, this list of conditions and the following disclaimer. 1515144b0fSOlivier Houchard * 2. Redistributions in binary form must reproduce the above copyright 1615144b0fSOlivier Houchard * notice, this list of conditions and the following disclaimer in the 1715144b0fSOlivier Houchard * documentation and/or other materials provided with the distribution. 1815144b0fSOlivier Houchard * 1915144b0fSOlivier Houchard * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 2015144b0fSOlivier Houchard * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 2115144b0fSOlivier Houchard * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 2215144b0fSOlivier Houchard * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 2315144b0fSOlivier Houchard * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 2415144b0fSOlivier Houchard * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 2515144b0fSOlivier Houchard * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 2615144b0fSOlivier Houchard * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 2715144b0fSOlivier Houchard * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 2815144b0fSOlivier Houchard * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 2915144b0fSOlivier Houchard * POSSIBILITY OF SUCH DAMAGE. 3015144b0fSOlivier Houchard */ 3115144b0fSOlivier Houchard 3215144b0fSOlivier Houchard #include <sys/cdefs.h> 3315144b0fSOlivier Houchard __FBSDID("$FreeBSD$"); 3415144b0fSOlivier Houchard 3515144b0fSOlivier Houchard #include "namespace.h" 3615144b0fSOlivier Houchard 3715144b0fSOlivier Houchard #include <ieeefp.h> 3815144b0fSOlivier Houchard #ifdef SOFTFLOAT_FOR_GCC 3915144b0fSOlivier Houchard #include "softfloat-for-gcc.h" 4015144b0fSOlivier Houchard #endif 4115144b0fSOlivier Houchard #include "milieu.h" 4215144b0fSOlivier Houchard #include "softfloat.h" 4315144b0fSOlivier Houchard 4415144b0fSOlivier Houchard #ifdef __weak_alias 4515144b0fSOlivier Houchard __weak_alias(fpgetround,_fpgetround) 4615144b0fSOlivier Houchard #endif 4715144b0fSOlivier Houchard 4815144b0fSOlivier Houchard fp_rnd_t 4915144b0fSOlivier Houchard fpgetround(void) 5015144b0fSOlivier Houchard { 5115144b0fSOlivier Houchard 5215144b0fSOlivier Houchard return float_rounding_mode; 5315144b0fSOlivier Houchard } 54