@zigc/lib 0.16.0-test.1 → 0.17.0-dev.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (253) hide show
  1. package/LICENSE +19 -0
  2. package/c/math.zig +148 -35
  3. package/c/stropts.zig +17 -0
  4. package/c.zig +1 -0
  5. package/compiler/aro/aro/Attribute/names.zig +604 -589
  6. package/compiler/aro/aro/Attribute.zig +202 -116
  7. package/compiler/aro/aro/Builtins/common.zig +874 -863
  8. package/compiler/aro/aro/Builtins/eval.zig +15 -7
  9. package/compiler/aro/aro/Builtins.zig +0 -1
  10. package/compiler/aro/aro/CodeGen.zig +3 -1
  11. package/compiler/aro/aro/Compilation.zig +120 -97
  12. package/compiler/aro/aro/Diagnostics.zig +21 -17
  13. package/compiler/aro/aro/Driver/GCCDetector.zig +635 -0
  14. package/compiler/aro/aro/Driver.zig +124 -50
  15. package/compiler/aro/aro/LangOpts.zig +12 -2
  16. package/compiler/aro/aro/Parser/Diagnostic.zig +79 -19
  17. package/compiler/aro/aro/Parser.zig +336 -142
  18. package/compiler/aro/aro/Preprocessor/Diagnostic.zig +21 -0
  19. package/compiler/aro/aro/Preprocessor.zig +127 -56
  20. package/compiler/aro/aro/Target.zig +17 -12
  21. package/compiler/aro/aro/Tokenizer.zig +31 -14
  22. package/compiler/aro/aro/Toolchain.zig +4 -7
  23. package/compiler/aro/aro/Tree.zig +178 -148
  24. package/compiler/aro/aro/TypeStore.zig +82 -24
  25. package/compiler/aro/aro/Value.zig +13 -17
  26. package/compiler/aro/aro/features.zig +1 -0
  27. package/compiler/aro/aro/pragmas/once.zig +0 -1
  28. package/compiler/aro/aro/record_layout.zig +3 -3
  29. package/compiler/aro/assembly_backend/x86_64.zig +3 -4
  30. package/compiler/aro/backend/Assembly.zig +1 -2
  31. package/compiler/aro/backend/Interner.zig +2 -2
  32. package/compiler/aro/backend/Ir.zig +100 -92
  33. package/compiler/aro/include/ptrcheck.h +49 -0
  34. package/compiler/aro/main.zig +26 -10
  35. package/compiler/build_runner.zig +1 -0
  36. package/compiler/objdump.zig +93 -0
  37. package/compiler/reduce.zig +5 -1
  38. package/compiler/resinator/compile.zig +2 -2
  39. package/compiler/resinator/main.zig +7 -1
  40. package/compiler/resinator/preprocess.zig +1 -3
  41. package/compiler/std-docs.zig +8 -1
  42. package/compiler/test_runner.zig +194 -62
  43. package/compiler/translate-c/MacroTranslator.zig +80 -11
  44. package/compiler/translate-c/PatternList.zig +1 -9
  45. package/compiler/translate-c/Scope.zig +43 -6
  46. package/compiler/translate-c/Translator.zig +364 -126
  47. package/compiler/translate-c/ast.zig +19 -11
  48. package/compiler/translate-c/main.zig +75 -16
  49. package/compiler_rt/cos.zig +141 -52
  50. package/compiler_rt/divmodei4.zig +40 -17
  51. package/compiler_rt/exp.zig +1 -4
  52. package/compiler_rt/exp2.zig +1 -4
  53. package/compiler_rt/exp_f128.zig +377 -0
  54. package/compiler_rt/limb64.zig +1126 -0
  55. package/compiler_rt/long_double.zig +37 -0
  56. package/compiler_rt/mulXi3.zig +1 -1
  57. package/compiler_rt/mulo.zig +6 -1
  58. package/compiler_rt/rem_pio2l.zig +173 -0
  59. package/compiler_rt/sin.zig +140 -55
  60. package/compiler_rt/sincos.zig +279 -72
  61. package/compiler_rt/ssp.zig +1 -1
  62. package/compiler_rt/tan.zig +118 -47
  63. package/compiler_rt/trig.zig +256 -6
  64. package/compiler_rt/udivmodei4.zig +28 -0
  65. package/compiler_rt.zig +2 -0
  66. package/fuzzer.zig +855 -307
  67. package/libc/musl/src/math/pow.c +343 -0
  68. package/package.json +1 -1
  69. package/std/Build/Fuzz.zig +6 -19
  70. package/std/Build/Module.zig +1 -1
  71. package/std/Build/Step/CheckObject.zig +3 -3
  72. package/std/Build/Step/Compile.zig +18 -0
  73. package/std/Build/Step/ConfigHeader.zig +49 -33
  74. package/std/Build/Step/InstallArtifact.zig +18 -0
  75. package/std/Build/Step/Run.zig +536 -87
  76. package/std/Build/Step/TranslateC.zig +0 -6
  77. package/std/Build/Step.zig +8 -15
  78. package/std/Build/WebServer.zig +29 -17
  79. package/std/Build/abi.zig +47 -11
  80. package/std/Build.zig +17 -14
  81. package/std/Io/Dispatch.zig +2 -0
  82. package/std/Io/File/Reader.zig +3 -1
  83. package/std/Io/File.zig +1 -0
  84. package/std/Io/Kqueue.zig +2 -2
  85. package/std/Io/Threaded.zig +181 -143
  86. package/std/Io/Uring.zig +2 -1
  87. package/std/Io/Writer.zig +41 -41
  88. package/std/Io.zig +970 -2
  89. package/std/Target.zig +3 -2
  90. package/std/Thread.zig +8 -3
  91. package/std/array_hash_map.zig +96 -555
  92. package/std/array_list.zig +22 -31
  93. package/std/bit_set.zig +22 -6
  94. package/std/builtin/assembly.zig +68 -0
  95. package/std/c.zig +17 -17
  96. package/std/compress/flate/Compress.zig +3 -3
  97. package/std/crypto/Certificate/Bundle.zig +15 -1
  98. package/std/crypto/codecs/asn1.zig +33 -18
  99. package/std/crypto/codecs/base64_hex_ct.zig +14 -4
  100. package/std/debug/Dwarf.zig +29 -9
  101. package/std/debug/Info.zig +4 -0
  102. package/std/debug/MachOFile.zig +46 -8
  103. package/std/debug/Pdb.zig +539 -36
  104. package/std/debug/SelfInfo/Elf.zig +19 -18
  105. package/std/debug/SelfInfo/MachO.zig +18 -7
  106. package/std/debug/SelfInfo/Windows.zig +138 -36
  107. package/std/debug.zig +179 -65
  108. package/std/enums.zig +25 -19
  109. package/std/heap/ArenaAllocator.zig +145 -154
  110. package/std/heap/debug_allocator.zig +7 -7
  111. package/std/http/Client.zig +10 -6
  112. package/std/http.zig +11 -9
  113. package/std/json/Stringify.zig +3 -3
  114. package/std/json/dynamic.zig +4 -4
  115. package/std/math/big/int.zig +16 -17
  116. package/std/mem/Allocator.zig +4 -5
  117. package/std/mem.zig +48 -0
  118. package/std/os/emscripten.zig +2 -18
  119. package/std/os/linux/arc.zig +144 -0
  120. package/std/os/linux.zig +21 -4
  121. package/std/os/windows.zig +2 -2
  122. package/std/pdb.zig +143 -4
  123. package/std/posix.zig +6 -12
  124. package/std/priority_dequeue.zig +13 -12
  125. package/std/priority_queue.zig +5 -4
  126. package/std/process/Child.zig +1 -1
  127. package/std/process/Environ.zig +1 -1
  128. package/std/start.zig +17 -4
  129. package/std/std.zig +19 -6
  130. package/std/testing/FailingAllocator.zig +4 -4
  131. package/std/testing/Smith.zig +37 -2
  132. package/std/zig/Ast/Render.zig +186 -458
  133. package/std/zig/Ast.zig +0 -4
  134. package/std/zig/AstGen.zig +44 -7
  135. package/std/zig/AstSmith.zig +2602 -0
  136. package/std/zig/Client.zig +8 -3
  137. package/std/zig/Parse.zig +83 -74
  138. package/std/zig/Server.zig +26 -0
  139. package/std/zig/Zir.zig +17 -0
  140. package/std/zig/c_translation/helpers.zig +14 -9
  141. package/std/zig/llvm/Builder.zig +107 -48
  142. package/std/zig/system.zig +20 -4
  143. package/std/zig/tokenizer.zig +2 -1
  144. package/std/zig.zig +6 -0
  145. package/compiler/aro/aro/Driver/Filesystem.zig +0 -241
  146. package/libc/mingw/complex/cabs.c +0 -48
  147. package/libc/mingw/complex/cabsf.c +0 -48
  148. package/libc/mingw/complex/cacos.c +0 -50
  149. package/libc/mingw/complex/cacosf.c +0 -50
  150. package/libc/mingw/complex/carg.c +0 -48
  151. package/libc/mingw/complex/cargf.c +0 -48
  152. package/libc/mingw/complex/casin.c +0 -50
  153. package/libc/mingw/complex/casinf.c +0 -50
  154. package/libc/mingw/complex/catan.c +0 -50
  155. package/libc/mingw/complex/catanf.c +0 -50
  156. package/libc/mingw/complex/ccos.c +0 -50
  157. package/libc/mingw/complex/ccosf.c +0 -50
  158. package/libc/mingw/complex/cexp.c +0 -48
  159. package/libc/mingw/complex/cexpf.c +0 -48
  160. package/libc/mingw/complex/cimag.c +0 -48
  161. package/libc/mingw/complex/cimagf.c +0 -48
  162. package/libc/mingw/complex/clog.c +0 -48
  163. package/libc/mingw/complex/clog10.c +0 -49
  164. package/libc/mingw/complex/clog10f.c +0 -49
  165. package/libc/mingw/complex/clogf.c +0 -48
  166. package/libc/mingw/complex/conj.c +0 -48
  167. package/libc/mingw/complex/conjf.c +0 -48
  168. package/libc/mingw/complex/cpow.c +0 -48
  169. package/libc/mingw/complex/cpowf.c +0 -48
  170. package/libc/mingw/complex/cproj.c +0 -48
  171. package/libc/mingw/complex/cprojf.c +0 -48
  172. package/libc/mingw/complex/creal.c +0 -48
  173. package/libc/mingw/complex/crealf.c +0 -48
  174. package/libc/mingw/complex/csin.c +0 -50
  175. package/libc/mingw/complex/csinf.c +0 -50
  176. package/libc/mingw/complex/csqrt.c +0 -48
  177. package/libc/mingw/complex/csqrtf.c +0 -48
  178. package/libc/mingw/complex/ctan.c +0 -50
  179. package/libc/mingw/complex/ctanf.c +0 -50
  180. package/libc/mingw/math/arm/s_rint.c +0 -86
  181. package/libc/mingw/math/arm/s_rintf.c +0 -51
  182. package/libc/mingw/math/arm/sincos.S +0 -30
  183. package/libc/mingw/math/arm-common/sincosl.c +0 -13
  184. package/libc/mingw/math/arm64/rint.c +0 -12
  185. package/libc/mingw/math/arm64/rintf.c +0 -12
  186. package/libc/mingw/math/arm64/sincos.S +0 -32
  187. package/libc/mingw/math/bsd_private_base.h +0 -148
  188. package/libc/mingw/math/fdiml.c +0 -24
  189. package/libc/mingw/math/frexpf.c +0 -13
  190. package/libc/mingw/math/frexpl.c +0 -71
  191. package/libc/mingw/math/x86/acosf.c +0 -29
  192. package/libc/mingw/math/x86/atanf.c +0 -23
  193. package/libc/mingw/math/x86/atanl.c +0 -18
  194. package/libc/mingw/math/x86/cos.def.h +0 -65
  195. package/libc/mingw/math/x86/cosl.c +0 -46
  196. package/libc/mingw/math/x86/cosl_internal.S +0 -55
  197. package/libc/mingw/math/x86/ldexp.c +0 -23
  198. package/libc/mingw/math/x86/scalbn.S +0 -41
  199. package/libc/mingw/math/x86/scalbnf.S +0 -40
  200. package/libc/mingw/math/x86/sin.def.h +0 -65
  201. package/libc/mingw/math/x86/sinl.c +0 -46
  202. package/libc/mingw/math/x86/sinl_internal.S +0 -58
  203. package/libc/mingw/math/x86/tanl.S +0 -62
  204. package/libc/mingw/misc/btowc.c +0 -28
  205. package/libc/mingw/misc/wcstof.c +0 -66
  206. package/libc/mingw/misc/wcstoimax.c +0 -132
  207. package/libc/mingw/misc/wcstoumax.c +0 -126
  208. package/libc/mingw/misc/wctob.c +0 -29
  209. package/libc/mingw/misc/winbs_uint64.c +0 -6
  210. package/libc/mingw/misc/winbs_ulong.c +0 -6
  211. package/libc/mingw/misc/winbs_ushort.c +0 -6
  212. package/libc/mingw/stdio/_Exit.c +0 -10
  213. package/libc/mingw/stdio/_findfirst64i32.c +0 -21
  214. package/libc/mingw/stdio/_findnext64i32.c +0 -21
  215. package/libc/mingw/stdio/_fstat64i32.c +0 -37
  216. package/libc/mingw/stdio/_stat64i32.c +0 -37
  217. package/libc/mingw/stdio/_wfindfirst64i32.c +0 -21
  218. package/libc/mingw/stdio/_wfindnext64i32.c +0 -21
  219. package/libc/mingw/stdio/_wstat64i32.c +0 -37
  220. package/libc/musl/src/legacy/isastream.c +0 -7
  221. package/libc/musl/src/legacy/valloc.c +0 -8
  222. package/libc/musl/src/math/__cosl.c +0 -96
  223. package/libc/musl/src/math/__sinl.c +0 -78
  224. package/libc/musl/src/math/__tanl.c +0 -143
  225. package/libc/musl/src/math/aarch64/lrint.c +0 -10
  226. package/libc/musl/src/math/aarch64/lrintf.c +0 -10
  227. package/libc/musl/src/math/aarch64/rintf.c +0 -7
  228. package/libc/musl/src/math/cosl.c +0 -39
  229. package/libc/musl/src/math/fdim.c +0 -10
  230. package/libc/musl/src/math/fdimf.c +0 -10
  231. package/libc/musl/src/math/fdiml.c +0 -18
  232. package/libc/musl/src/math/finite.c +0 -7
  233. package/libc/musl/src/math/finitef.c +0 -7
  234. package/libc/musl/src/math/frexp.c +0 -23
  235. package/libc/musl/src/math/frexpf.c +0 -23
  236. package/libc/musl/src/math/frexpl.c +0 -29
  237. package/libc/musl/src/math/i386/lrint.c +0 -8
  238. package/libc/musl/src/math/i386/lrintf.c +0 -8
  239. package/libc/musl/src/math/i386/rintf.c +0 -7
  240. package/libc/musl/src/math/lrint.c +0 -72
  241. package/libc/musl/src/math/lrintf.c +0 -8
  242. package/libc/musl/src/math/powerpc64/lrint.c +0 -16
  243. package/libc/musl/src/math/powerpc64/lrintf.c +0 -16
  244. package/libc/musl/src/math/rintf.c +0 -30
  245. package/libc/musl/src/math/s390x/rintf.c +0 -15
  246. package/libc/musl/src/math/sincosl.c +0 -60
  247. package/libc/musl/src/math/sinl.c +0 -41
  248. package/libc/musl/src/math/tanl.c +0 -29
  249. package/libc/musl/src/math/x32/lrint.s +0 -5
  250. package/libc/musl/src/math/x32/lrintf.s +0 -5
  251. package/libc/musl/src/math/x86_64/lrint.c +0 -8
  252. package/libc/musl/src/math/x86_64/lrintf.c +0 -8
  253. package/libc/wasi/libc-bottom-half/sources/reallocarray.c +0 -14
@@ -1,7 +0,0 @@
1
- #include <math.h>
2
-
3
- float rintf(float x)
4
- {
5
- __asm__ ("frndint" : "+t"(x));
6
- return x;
7
- }
@@ -1,72 +0,0 @@
1
- #include <limits.h>
2
- #include <fenv.h>
3
- #include <math.h>
4
- #include "libm.h"
5
-
6
- /*
7
- If the result cannot be represented (overflow, nan), then
8
- lrint raises the invalid exception.
9
-
10
- Otherwise if the input was not an integer then the inexact
11
- exception is raised.
12
-
13
- C99 is a bit vague about whether inexact exception is
14
- allowed to be raised when invalid is raised.
15
- (F.9 explicitly allows spurious inexact exceptions, F.9.6.5
16
- does not make it clear if that rule applies to lrint, but
17
- IEEE 754r 7.8 seems to forbid spurious inexact exception in
18
- the ineger conversion functions)
19
-
20
- So we try to make sure that no spurious inexact exception is
21
- raised in case of an overflow.
22
-
23
- If the bit size of long > precision of double, then there
24
- cannot be inexact rounding in case the result overflows,
25
- otherwise LONG_MAX and LONG_MIN can be represented exactly
26
- as a double.
27
- */
28
-
29
- #if LONG_MAX < 1U<<53 && defined(FE_INEXACT)
30
- #include <float.h>
31
- #include <stdint.h>
32
- #if FLT_EVAL_METHOD==0 || FLT_EVAL_METHOD==1
33
- #define EPS DBL_EPSILON
34
- #elif FLT_EVAL_METHOD==2
35
- #define EPS LDBL_EPSILON
36
- #endif
37
- #ifdef __GNUC__
38
- /* avoid stack frame in lrint */
39
- __attribute__((noinline))
40
- #endif
41
- static long lrint_slow(double x)
42
- {
43
- #pragma STDC FENV_ACCESS ON
44
- int e;
45
-
46
- e = fetestexcept(FE_INEXACT);
47
- x = rint(x);
48
- if (!e && (x > LONG_MAX || x < LONG_MIN))
49
- feclearexcept(FE_INEXACT);
50
- /* conversion */
51
- return x;
52
- }
53
-
54
- long lrint(double x)
55
- {
56
- uint32_t abstop = asuint64(x)>>32 & 0x7fffffff;
57
- uint64_t sign = asuint64(x) & (1ULL << 63);
58
-
59
- if (abstop < 0x41dfffff) {
60
- /* |x| < 0x7ffffc00, no overflow */
61
- double_t toint = asdouble(asuint64(1/EPS) | sign);
62
- double_t y = x + toint - toint;
63
- return (long)y;
64
- }
65
- return lrint_slow(x);
66
- }
67
- #else
68
- long lrint(double x)
69
- {
70
- return rint(x);
71
- }
72
- #endif
@@ -1,8 +0,0 @@
1
- #include <math.h>
2
-
3
- /* uses LONG_MAX > 2^24, see comments in lrint.c */
4
-
5
- long lrintf(float x)
6
- {
7
- return rintf(x);
8
- }
@@ -1,16 +0,0 @@
1
- #include <math.h>
2
-
3
- #ifdef _ARCH_PWR5X
4
-
5
- long lrint(double x)
6
- {
7
- long n;
8
- __asm__ ("fctid %0, %1" : "=d"(n) : "d"(x));
9
- return n;
10
- }
11
-
12
- #else
13
-
14
- #include "../lrint.c"
15
-
16
- #endif
@@ -1,16 +0,0 @@
1
- #include <math.h>
2
-
3
- #ifdef _ARCH_PWR5X
4
-
5
- long lrintf(float x)
6
- {
7
- long n;
8
- __asm__ ("fctid %0, %1" : "=d"(n) : "f"(x));
9
- return n;
10
- }
11
-
12
- #else
13
-
14
- #include "../lrintf.c"
15
-
16
- #endif
@@ -1,30 +0,0 @@
1
- #include <float.h>
2
- #include <math.h>
3
- #include <stdint.h>
4
-
5
- #if FLT_EVAL_METHOD==0
6
- #define EPS FLT_EPSILON
7
- #elif FLT_EVAL_METHOD==1
8
- #define EPS DBL_EPSILON
9
- #elif FLT_EVAL_METHOD==2
10
- #define EPS LDBL_EPSILON
11
- #endif
12
- static const float_t toint = 1/EPS;
13
-
14
- float rintf(float x)
15
- {
16
- union {float f; uint32_t i;} u = {x};
17
- int e = u.i>>23 & 0xff;
18
- int s = u.i>>31;
19
- float_t y;
20
-
21
- if (e >= 0x7f+23)
22
- return x;
23
- if (s)
24
- y = x - toint + toint;
25
- else
26
- y = x + toint - toint;
27
- if (y == 0)
28
- return s ? -0.0f : 0.0f;
29
- return y;
30
- }
@@ -1,15 +0,0 @@
1
- #include <math.h>
2
-
3
- #if defined(__HTM__) || __ARCH__ >= 9
4
-
5
- float rintf(float x)
6
- {
7
- __asm__ ("fiebr %0, 0, %1" : "=f"(x) : "f"(x));
8
- return x;
9
- }
10
-
11
- #else
12
-
13
- #include "../rintf.c"
14
-
15
- #endif
@@ -1,60 +0,0 @@
1
- #define _GNU_SOURCE
2
- #include "libm.h"
3
-
4
- #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
5
- void sincosl(long double x, long double *sin, long double *cos)
6
- {
7
- double sind, cosd;
8
- sincos(x, &sind, &cosd);
9
- *sin = sind;
10
- *cos = cosd;
11
- }
12
- #elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384
13
- void sincosl(long double x, long double *sin, long double *cos)
14
- {
15
- union ldshape u = {x};
16
- unsigned n;
17
- long double y[2], s, c;
18
-
19
- u.i.se &= 0x7fff;
20
- if (u.i.se == 0x7fff) {
21
- *sin = *cos = x - x;
22
- return;
23
- }
24
- if (u.f < M_PI_4) {
25
- if (u.i.se < 0x3fff - LDBL_MANT_DIG) {
26
- /* raise underflow if subnormal */
27
- if (u.i.se == 0) FORCE_EVAL(x*0x1p-120f);
28
- *sin = x;
29
- /* raise inexact if x!=0 */
30
- *cos = 1.0 + x;
31
- return;
32
- }
33
- *sin = __sinl(x, 0, 0);
34
- *cos = __cosl(x, 0);
35
- return;
36
- }
37
- n = __rem_pio2l(x, y);
38
- s = __sinl(y[0], y[1], 1);
39
- c = __cosl(y[0], y[1]);
40
- switch (n & 3) {
41
- case 0:
42
- *sin = s;
43
- *cos = c;
44
- break;
45
- case 1:
46
- *sin = c;
47
- *cos = -s;
48
- break;
49
- case 2:
50
- *sin = -s;
51
- *cos = -c;
52
- break;
53
- case 3:
54
- default:
55
- *sin = -c;
56
- *cos = s;
57
- break;
58
- }
59
- }
60
- #endif
@@ -1,41 +0,0 @@
1
- #include "libm.h"
2
-
3
- #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
4
- long double sinl(long double x)
5
- {
6
- return sin(x);
7
- }
8
- #elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384
9
- long double sinl(long double x)
10
- {
11
- union ldshape u = {x};
12
- unsigned n;
13
- long double y[2], hi, lo;
14
-
15
- u.i.se &= 0x7fff;
16
- if (u.i.se == 0x7fff)
17
- return x - x;
18
- if (u.f < M_PI_4) {
19
- if (u.i.se < 0x3fff - LDBL_MANT_DIG/2) {
20
- /* raise inexact if x!=0 and underflow if subnormal */
21
- FORCE_EVAL(u.i.se == 0 ? x*0x1p-120f : x+0x1p120f);
22
- return x;
23
- }
24
- return __sinl(x, 0.0, 0);
25
- }
26
- n = __rem_pio2l(x, y);
27
- hi = y[0];
28
- lo = y[1];
29
- switch (n & 3) {
30
- case 0:
31
- return __sinl(hi, lo, 1);
32
- case 1:
33
- return __cosl(hi, lo);
34
- case 2:
35
- return -__sinl(hi, lo, 1);
36
- case 3:
37
- default:
38
- return -__cosl(hi, lo);
39
- }
40
- }
41
- #endif
@@ -1,29 +0,0 @@
1
- #include "libm.h"
2
-
3
- #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
4
- long double tanl(long double x)
5
- {
6
- return tan(x);
7
- }
8
- #elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384
9
- long double tanl(long double x)
10
- {
11
- union ldshape u = {x};
12
- long double y[2];
13
- unsigned n;
14
-
15
- u.i.se &= 0x7fff;
16
- if (u.i.se == 0x7fff)
17
- return x - x;
18
- if (u.f < M_PI_4) {
19
- if (u.i.se < 0x3fff - LDBL_MANT_DIG/2) {
20
- /* raise inexact if x!=0 and underflow if subnormal */
21
- FORCE_EVAL(u.i.se == 0 ? x*0x1p-120f : x+0x1p120f);
22
- return x;
23
- }
24
- return __tanl(x, 0, 0);
25
- }
26
- n = __rem_pio2l(x, y);
27
- return __tanl(y[0], y[1], n&1);
28
- }
29
- #endif
@@ -1,5 +0,0 @@
1
- .global lrint
2
- .type lrint,@function
3
- lrint:
4
- cvtsd2si %xmm0,%rax
5
- ret
@@ -1,5 +0,0 @@
1
- .global lrintf
2
- .type lrintf,@function
3
- lrintf:
4
- cvtss2si %xmm0,%rax
5
- ret
@@ -1,8 +0,0 @@
1
- #include <math.h>
2
-
3
- long lrint(double x)
4
- {
5
- long r;
6
- __asm__ ("cvtsd2si %1, %0" : "=r"(r) : "x"(x));
7
- return r;
8
- }
@@ -1,8 +0,0 @@
1
- #include <math.h>
2
-
3
- long lrintf(float x)
4
- {
5
- long r;
6
- __asm__ ("cvtss2si %1, %0" : "=r"(r) : "x"(x));
7
- return r;
8
- }
@@ -1,14 +0,0 @@
1
- #include <stdlib.h>
2
- #include <errno.h>
3
-
4
- void *__reallocarray(void *ptr, size_t nmemb, size_t size) {
5
- size_t bytes;
6
- if (__builtin_umull_overflow(nmemb, size, &bytes)) {
7
- errno = ENOMEM;
8
- return NULL;
9
- }
10
- return realloc(ptr, bytes);
11
- }
12
-
13
- void *reallocarray(void *ptr, size_t nmemb, size_t size)
14
- __attribute__((__weak__, __alias__("__reallocarray")));