codegen: a small improvement in do_bswap and do_brev
[ajla.git] / fn_impl.h
blobe7403528b71d98b305655c6120168b0cf1655047
1 /*
2 * Copyright (C) 2024 Mikulas Patocka
4 * This file is part of Ajla.
6 * Ajla is free software: you can redistribute it and/or modify it under the
7 * terms of the GNU General Public License as published by the Free Software
8 * Foundation, either version 3 of the License, or (at your option) any later
9 * version.
11 * Ajla is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13 * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along with
16 * Ajla. If not, see <https://www.gnu.org/licenses/>.
19 /* gcc 2.7.2.1 will throw "internal error--unrecognizable insn" if we enable this
20 #ifndef HAVE_LONG_DOUBLE
21 #if defined(ARCH_X86) && defined(HAVE_REAL_GNUC)
22 #define HAVE_LONG_DOUBLE 1
23 #endif
24 #endif
27 #ifndef HAVE_GETENV
28 char *getenv(const char *name);
29 #endif
31 #ifndef HAVE_MEMPCPY
32 void *mempcpy(void *dst, const void *src, size_t length);
33 #endif
35 #if defined(__EMX__) || defined(__BORLANDC__)
36 #define strcasecmp stricmp
37 #endif
39 #if defined(_MSC_VER)
40 #define strcasecmp _stricmp
41 #endif
43 #ifndef HAVE_STRERROR
44 char *strerror(int errnum);
45 #endif
47 #ifdef __ICC
48 #undef HAVE_STRNLEN
49 #define strnlen my_strnlen
50 #endif
52 #ifndef HAVE_STRNLEN
53 size_t strnlen(const char *s, size_t maxlen);
54 #endif
56 #if !defined(HAVE_CBRT)
57 double cbrt(double x);
58 #endif
60 #if !defined(HAVE_CBRTF)
61 float cbrtf(float x);
62 #endif
64 #if defined(HAVE_LONG_DOUBLE) && !defined(HAVE_CBRTL)
65 #define cbrtl my_cbrtl /* fix conflicting types for built-in function cbrtl */
66 float cbrtl(float x);
67 #endif
69 #if !defined(HAVE_ASINH)
70 double asinh(double x);
71 #endif
73 #if defined(HAVE_LONG_DOUBLE) && !defined(HAVE_ASINHL)
74 long double asinhl(long double x);
75 #endif
77 #if !defined(HAVE_ACOSH)
78 double acosh(double x);
79 #endif
81 #if defined(HAVE_LONG_DOUBLE) && !defined(HAVE_ACOSHL)
82 long double acoshl(long double x);
83 #endif
85 #if !defined(HAVE_ATANH)
86 double atanh(double x);
87 #endif
89 #if defined(HAVE_LONG_DOUBLE) && !defined(HAVE_ATANHL)
90 long double atanhl(long double x);
91 #endif
93 #if !defined(HAVE_EXP2)
94 double exp2(double x);
95 #endif
97 #if !defined(HAVE_EXP2F)
98 float exp2f(float x);
99 #endif
101 #if defined(HAVE_LONG_DOUBLE) && !defined(HAVE_EXP2L)
102 long double exp2l(long double x);
103 #endif
105 #if defined(HAVE___FLOAT128) && defined(HAVE_LIBQUADMATH) && defined(HAVE_QUADMATH_H) && !defined(HAVE_EXP2Q)
106 __float128 exp2q(__float128 x);
107 #endif
109 #if !defined(HAVE_EXP10)
110 double exp10(double x);
111 #endif
112 #if !defined(HAVE_EXP10F)
113 float exp10f(float x);
114 #endif
115 #if defined(HAVE_LONG_DOUBLE) && !defined(HAVE_EXP10L)
116 long double exp10l(long double x);
117 #endif
118 #if defined(HAVE___FLOAT128) && defined(HAVE_LIBQUADMATH) && defined(HAVE_QUADMATH_H) && !defined(HAVE_EXP10Q)
119 __float128 exp10q(__float128 x);
120 #endif
122 #if !defined(HAVE_LOG2)
123 double log2(double x);
124 #endif
126 #if !defined(HAVE_LOG2F)
127 float log2f(float x);
128 #endif
130 #if defined(HAVE_LONG_DOUBLE) && !defined(HAVE_LOG2L)
131 long double log2l(long double x);
132 #endif
134 #if !defined(HAVE_TRUNC)
135 double trunc(double x);
136 #endif
138 #if !defined(HAVE_TRUNCF)
139 float truncf(float x);
140 #endif
142 #if defined(HAVE_LONG_DOUBLE) && !defined(HAVE_TRUNCL)
143 long double truncl(long double x);
144 #endif
146 #if !defined(HAVE_RINT)
147 double rint(double x);
148 #endif
150 #if !defined(HAVE_RINTF)
151 float rintf(float x);
152 #endif
154 #if !defined(HAVE_MODFF)
155 float modff(float x, float *iflt);
156 #endif