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