xref: /freebsd/lib/libc/softfloat/fpsetmask.c (revision 15144b0f960e6044ec23ad91c5f76f37d1de36ba)
115144b0fSOlivier Houchard /* $NetBSD: fpsetmask.c,v 1.3 2002/05/12 13:12:45 bjh21 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  * 3. All advertising materials mentioning features or use of this software
1915144b0fSOlivier Houchard  *    must display the following acknowledgement:
2015144b0fSOlivier Houchard  *	This product includes software developed by the NetBSD
2115144b0fSOlivier Houchard  *	Foundation, Inc. and its contributors.
2215144b0fSOlivier Houchard  * 4. Neither the name of The NetBSD Foundation nor the names of its
2315144b0fSOlivier Houchard  *    contributors may be used to endorse or promote products derived
2415144b0fSOlivier Houchard  *    from this software without specific prior written permission.
2515144b0fSOlivier Houchard  *
2615144b0fSOlivier Houchard  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
2715144b0fSOlivier Houchard  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
2815144b0fSOlivier Houchard  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
2915144b0fSOlivier Houchard  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
3015144b0fSOlivier Houchard  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
3115144b0fSOlivier Houchard  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
3215144b0fSOlivier Houchard  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
3315144b0fSOlivier Houchard  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
3415144b0fSOlivier Houchard  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
3515144b0fSOlivier Houchard  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
3615144b0fSOlivier Houchard  * POSSIBILITY OF SUCH DAMAGE.
3715144b0fSOlivier Houchard  */
3815144b0fSOlivier Houchard 
3915144b0fSOlivier Houchard #include <sys/cdefs.h>
4015144b0fSOlivier Houchard __FBSDID("$FreeBSD$");
4115144b0fSOlivier Houchard 
4215144b0fSOlivier Houchard #include "namespace.h"
4315144b0fSOlivier Houchard 
4415144b0fSOlivier Houchard #include <ieeefp.h>
4515144b0fSOlivier Houchard #ifdef SOFTFLOAT_FOR_GCC
4615144b0fSOlivier Houchard #include "softfloat-for-gcc.h"
4715144b0fSOlivier Houchard #endif
4815144b0fSOlivier Houchard #include "milieu.h"
4915144b0fSOlivier Houchard #include "softfloat.h"
5015144b0fSOlivier Houchard 
5115144b0fSOlivier Houchard #ifdef __weak_alias
5215144b0fSOlivier Houchard __weak_alias(fpsetmask,_fpsetmask)
5315144b0fSOlivier Houchard #endif
5415144b0fSOlivier Houchard 
5515144b0fSOlivier Houchard fp_except
5615144b0fSOlivier Houchard fpsetmask(fp_except mask)
5715144b0fSOlivier Houchard {
5815144b0fSOlivier Houchard 	fp_except old;
5915144b0fSOlivier Houchard 
6015144b0fSOlivier Houchard 	old = float_exception_mask;
6115144b0fSOlivier Houchard 	float_exception_mask = mask;
6215144b0fSOlivier Houchard 	return old;
6315144b0fSOlivier Houchard }
64