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