fpsetsticky.c revision 189647
1139825Simp/* $NetBSD: fpsetsticky.c,v 1.3 2008/04/28 20:23:00 martin Exp $ */
277957Sbenno
377957Sbenno/*-
477957Sbenno * Copyright (c) 1997 The NetBSD Foundation, Inc.
577957Sbenno * All rights reserved.
677957Sbenno *
777957Sbenno * This code is derived from software contributed to The NetBSD Foundation
877957Sbenno * by Neil A. Carson and Mark Brinicombe
977957Sbenno *
1077957Sbenno * Redistribution and use in source and binary forms, with or without
1177957Sbenno * modification, are permitted provided that the following conditions
1277957Sbenno * are met:
1377957Sbenno * 1. Redistributions of source code must retain the above copyright
1477957Sbenno *    notice, this list of conditions and the following disclaimer.
1577957Sbenno * 2. Redistributions in binary form must reproduce the above copyright
1677957Sbenno *    notice, this list of conditions and the following disclaimer in the
1777957Sbenno *    documentation and/or other materials provided with the distribution.
1877957Sbenno *
1977957Sbenno * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
2077957Sbenno * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
2177957Sbenno * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
2277957Sbenno * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
2377957Sbenno * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2477957Sbenno * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2577957Sbenno * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2677957Sbenno * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2777957Sbenno * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2877957Sbenno * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2977957Sbenno * POSSIBILITY OF SUCH DAMAGE.
3077957Sbenno */
3177957Sbenno
3277957Sbenno#include <sys/cdefs.h>
3377957Sbenno__FBSDID("$FreeBSD: head/lib/libc/softfloat/fpsetsticky.c 189647 2009-03-10 21:13:26Z delphij $");
3477957Sbenno
35192067Snwhitehorn#include "namespace.h"
36192067Snwhitehorn
37192067Snwhitehorn#include <ieeefp.h>
38192067Snwhitehorn#ifdef SOFTFLOAT_FOR_GCC
39192067Snwhitehorn#include "softfloat-for-gcc.h"
4077957Sbenno#endif
4177957Sbenno#include "milieu.h"
4297346Sbenno#include "softfloat.h"
4397346Sbenno
4477957Sbenno#ifdef __weak_alias
4577957Sbenno__weak_alias(fpsetsticky,_fpsetsticky)
4697346Sbenno#endif
47215159Snwhitehorn
4877957Sbennofp_except
49192067Snwhitehornfpsetsticky(fp_except except)
50192067Snwhitehorn{
51192067Snwhitehorn	fp_except old;
52192067Snwhitehorn
53192067Snwhitehorn	old = float_exception_flags;
54192067Snwhitehorn	float_exception_flags = except;
55255417Snwhitehorn	return old;
56192067Snwhitehorn}
57192067Snwhitehorn