xref: /freebsd/lib/msun/aarch64/fenv.c (revision 9aff62dee28239f84b4aa4a3429cf26dbbf770cc)
1 /*-
2  * Copyright (c) 2004 David Schultz <das@FreeBSD.ORG>
3  * Copyright (c) 2013 Andrew Turner <andrew@FreeBSD.ORG>
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  * 1. Redistributions of source code must retain the above copyright
10  *    notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  *    notice, this list of conditions and the following disclaimer in the
13  *    documentation and/or other materials provided with the distribution.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25  * SUCH DAMAGE.
26  */
27 
28 #include "fenv.h"
29 
30 /*
31  * Hopefully the system ID byte is immutable, so it's valid to use
32  * this as a default environment.
33  */
34 const fenv_t __fe_dfl_env = 0;
35 const femode_t __fe_dfl_mode = 0;
36 
37 int
38 (feclearexcept)(int excepts)
39 {
40 	return (__feclearexcept_int(excepts));
41 }
42 
43 int
44 (fegetexceptflag)(fexcept_t *flagp, int excepts)
45 {
46 	return (__fegetexceptflag_int(flagp, excepts));
47 }
48 
49 int
50 (fesetexceptflag)(const fexcept_t *flagp, int excepts)
51 {
52 	return (__fesetexceptflag_int(flagp, excepts));
53 }
54 
55 int
56 (feraiseexcept)(int excepts)
57 {
58 	return (__feraiseexcept_int(excepts));
59 }
60 
61 int
62 (fetestexcept)(int excepts)
63 {
64 	return (__fetestexcept_int(excepts));
65 }
66 
67 int
68 (fegetround)(void)
69 {
70 	return (__fegetround_int());
71 }
72 
73 int
74 (fesetround)(int round)
75 {
76 	return (__fesetround_int(round));
77 }
78 
79 int
80 (fegetmode)(femode_t *modep)
81 {
82 	return (__fegetmode_int(modep));
83 }
84 
85 int
86 (fesetmode)(const femode_t *modep)
87 {
88 	return (__fesetmode_int(modep));
89 }
90 
91 int
92 (fegetenv)(fenv_t *envp)
93 {
94 	return (__fegetenv_int(envp));
95 }
96 
97 int
98 (feholdexcept)(fenv_t *envp)
99 {
100 	return (__feholdexcept_int(envp));
101 }
102 
103 int
104 (fesetenv)(const fenv_t *envp)
105 {
106 	return (__fesetenv_int(envp));
107 }
108 
109 int
110 (feupdateenv)(const fenv_t *envp)
111 {
112 	return (__feupdateenv_int(envp));
113 }
114 
115 int
116 (feenableexcept)(int mask)
117 {
118 	return (__feenableexcept_int(mask));
119 }
120 
121 int
122 (fedisableexcept)(int mask)
123 {
124 	return (__fedisableexcept_int(mask));
125 }
126 
127 int
128 (fegetexcept)(void)
129 {
130 	return (__fegetexcept_int());
131 }
132