xref: /freebsd/lib/msun/aarch64/fenv.c (revision b3e7694832e81d7a904a10f525f8797b753bf0d3)
1*f7346285SAndrew Turner /*-
2*f7346285SAndrew Turner  * Copyright (c) 2004 David Schultz <das@FreeBSD.ORG>
3*f7346285SAndrew Turner  * Copyright (c) 2013 Andrew Turner <andrew@FreeBSD.ORG>
4*f7346285SAndrew Turner  * All rights reserved.
5*f7346285SAndrew Turner  *
6*f7346285SAndrew Turner  * Redistribution and use in source and binary forms, with or without
7*f7346285SAndrew Turner  * modification, are permitted provided that the following conditions
8*f7346285SAndrew Turner  * are met:
9*f7346285SAndrew Turner  * 1. Redistributions of source code must retain the above copyright
10*f7346285SAndrew Turner  *    notice, this list of conditions and the following disclaimer.
11*f7346285SAndrew Turner  * 2. Redistributions in binary form must reproduce the above copyright
12*f7346285SAndrew Turner  *    notice, this list of conditions and the following disclaimer in the
13*f7346285SAndrew Turner  *    documentation and/or other materials provided with the distribution.
14*f7346285SAndrew Turner  *
15*f7346285SAndrew Turner  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16*f7346285SAndrew Turner  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17*f7346285SAndrew Turner  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18*f7346285SAndrew Turner  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19*f7346285SAndrew Turner  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20*f7346285SAndrew Turner  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21*f7346285SAndrew Turner  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22*f7346285SAndrew Turner  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23*f7346285SAndrew Turner  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24*f7346285SAndrew Turner  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25*f7346285SAndrew Turner  * SUCH DAMAGE.
26*f7346285SAndrew Turner  */
27*f7346285SAndrew Turner 
28*f7346285SAndrew Turner #define	__fenv_static
29*f7346285SAndrew Turner #include "fenv.h"
30*f7346285SAndrew Turner 
31*f7346285SAndrew Turner /*
32*f7346285SAndrew Turner  * Hopefully the system ID byte is immutable, so it's valid to use
33*f7346285SAndrew Turner  * this as a default environment.
34*f7346285SAndrew Turner  */
35*f7346285SAndrew Turner const fenv_t __fe_dfl_env = 0;
36*f7346285SAndrew Turner 
37*f7346285SAndrew Turner #ifdef __GNUC_GNU_INLINE__
38*f7346285SAndrew Turner #error "This file must be compiled with C99 'inline' semantics"
39*f7346285SAndrew Turner #endif
40*f7346285SAndrew Turner 
41*f7346285SAndrew Turner extern inline int feclearexcept(int __excepts);
42*f7346285SAndrew Turner extern inline int fegetexceptflag(fexcept_t *__flagp, int __excepts);
43*f7346285SAndrew Turner extern inline int fesetexceptflag(const fexcept_t *__flagp, int __excepts);
44*f7346285SAndrew Turner extern inline int feraiseexcept(int __excepts);
45*f7346285SAndrew Turner extern inline int fetestexcept(int __excepts);
46*f7346285SAndrew Turner extern inline int fegetround(void);
47*f7346285SAndrew Turner extern inline int fesetround(int __round);
48*f7346285SAndrew Turner extern inline int fegetenv(fenv_t *__envp);
49*f7346285SAndrew Turner extern inline int feholdexcept(fenv_t *__envp);
50*f7346285SAndrew Turner extern inline int fesetenv(const fenv_t *__envp);
51*f7346285SAndrew Turner extern inline int feupdateenv(const fenv_t *__envp);
52*f7346285SAndrew Turner extern inline int feenableexcept(int __mask);
53*f7346285SAndrew Turner extern inline int fedisableexcept(int __mask);
54*f7346285SAndrew Turner extern inline int fegetexcept(void);
55