@zigc/lib 0.16.0-test.1 → 0.17.0-dev.131
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.
- package/LICENSE +19 -0
- package/c/fcntl.zig +6 -1
- package/c/inttypes.zig +0 -10
- package/c/math.zig +138 -114
- package/c/pthread.zig +57 -0
- package/c/search.zig +1 -27
- package/c/stdlib/drand48.zig +0 -57
- package/c/stdlib.zig +0 -100
- package/c/string.zig +20 -7
- package/c/strings.zig +0 -38
- package/c/stropts.zig +17 -0
- package/c/unistd.zig +27 -26
- package/c/wchar.zig +10 -0
- package/c.zig +3 -2
- package/compiler/aro/aro/Attribute/names.zig +604 -589
- package/compiler/aro/aro/Attribute.zig +202 -116
- package/compiler/aro/aro/Builtins/common.zig +874 -863
- package/compiler/aro/aro/Builtins/eval.zig +15 -7
- package/compiler/aro/aro/Builtins.zig +0 -1
- package/compiler/aro/aro/CodeGen.zig +8 -7
- package/compiler/aro/aro/Compilation.zig +137 -111
- package/compiler/aro/aro/Diagnostics.zig +21 -17
- package/compiler/aro/aro/Driver/GCCDetector.zig +635 -0
- package/compiler/aro/aro/Driver.zig +138 -63
- package/compiler/aro/aro/LangOpts.zig +12 -2
- package/compiler/aro/aro/Parser/Diagnostic.zig +79 -19
- package/compiler/aro/aro/Parser.zig +352 -153
- package/compiler/aro/aro/Pragma.zig +3 -2
- package/compiler/aro/aro/Preprocessor/Diagnostic.zig +21 -0
- package/compiler/aro/aro/Preprocessor.zig +136 -62
- package/compiler/aro/aro/Target.zig +17 -12
- package/compiler/aro/aro/Tokenizer.zig +31 -14
- package/compiler/aro/aro/Toolchain.zig +4 -7
- package/compiler/aro/aro/Tree.zig +178 -148
- package/compiler/aro/aro/TypeStore.zig +82 -24
- package/compiler/aro/aro/Value.zig +13 -17
- package/compiler/aro/aro/features.zig +1 -0
- package/compiler/aro/aro/pragmas/message.zig +3 -2
- package/compiler/aro/aro/pragmas/once.zig +0 -1
- package/compiler/aro/aro/record_layout.zig +3 -3
- package/compiler/aro/aro/text_literal.zig +3 -2
- package/compiler/aro/assembly_backend/x86_64.zig +7 -8
- package/compiler/aro/backend/Assembly.zig +1 -2
- package/compiler/aro/backend/Interner.zig +2 -2
- package/compiler/aro/backend/Ir.zig +100 -92
- package/compiler/aro/include/ptrcheck.h +49 -0
- package/compiler/aro/main.zig +26 -10
- package/compiler/build_runner.zig +1 -2
- package/compiler/objdump.zig +93 -0
- package/compiler/reduce/Walk.zig +7 -7
- package/compiler/reduce.zig +5 -1
- package/compiler/resinator/compile.zig +2 -2
- package/compiler/resinator/main.zig +7 -1
- package/compiler/resinator/preprocess.zig +1 -3
- package/compiler/std-docs.zig +8 -1
- package/compiler/test_runner.zig +194 -62
- package/compiler/translate-c/MacroTranslator.zig +80 -11
- package/compiler/translate-c/PatternList.zig +1 -9
- package/compiler/translate-c/Scope.zig +43 -6
- package/compiler/translate-c/Translator.zig +369 -127
- package/compiler/translate-c/ast.zig +19 -11
- package/compiler/translate-c/main.zig +76 -17
- package/compiler_rt/cos.zig +140 -53
- package/compiler_rt/divmodei4.zig +40 -17
- package/compiler_rt/exp.zig +1 -6
- package/compiler_rt/exp2.zig +1 -6
- package/compiler_rt/exp_f128.zig +377 -0
- package/compiler_rt/fabs.zig +0 -2
- package/compiler_rt/fma.zig +0 -2
- package/compiler_rt/fmax.zig +0 -2
- package/compiler_rt/fmin.zig +0 -2
- package/compiler_rt/fmod.zig +0 -2
- package/compiler_rt/limb64.zig +1127 -0
- package/compiler_rt/log.zig +0 -2
- package/compiler_rt/log10.zig +0 -2
- package/compiler_rt/log2.zig +0 -2
- package/compiler_rt/long_double.zig +37 -0
- package/compiler_rt/mulXi3.zig +1 -1
- package/compiler_rt/mulo.zig +6 -1
- package/compiler_rt/rem_pio2l.zig +173 -0
- package/compiler_rt/round.zig +0 -2
- package/compiler_rt/sin.zig +139 -56
- package/compiler_rt/sincos.zig +277 -72
- package/compiler_rt/sqrt.zig +0 -2
- package/compiler_rt/ssp.zig +1 -1
- package/compiler_rt/tan.zig +117 -48
- package/compiler_rt/trig.zig +256 -6
- package/compiler_rt/trunc.zig +0 -2
- package/compiler_rt/udivmodei4.zig +28 -0
- package/compiler_rt.zig +2 -0
- package/fuzzer.zig +857 -307
- package/libc/musl/arch/mipsn32/syscall_arch.h +35 -32
- package/libc/musl/src/math/pow.c +343 -0
- package/package.json +1 -1
- package/std/Build/Cache.zig +6 -6
- package/std/Build/Fuzz.zig +6 -19
- package/std/Build/Module.zig +1 -1
- package/std/Build/Step/CheckObject.zig +3 -3
- package/std/Build/Step/Compile.zig +18 -1
- package/std/Build/Step/ConfigHeader.zig +49 -33
- package/std/Build/Step/InstallArtifact.zig +18 -0
- package/std/Build/Step/Run.zig +538 -89
- package/std/Build/Step/TranslateC.zig +0 -6
- package/std/Build/Step.zig +10 -19
- package/std/Build/WebServer.zig +31 -19
- package/std/Build/abi.zig +47 -11
- package/std/Build.zig +17 -17
- package/std/Io/Dir.zig +7 -2
- package/std/Io/Dispatch.zig +5 -13
- package/std/Io/File/Reader.zig +3 -1
- package/std/Io/File/Writer.zig +8 -6
- package/std/Io/File.zig +1 -0
- package/std/Io/Kqueue.zig +2 -2
- package/std/Io/Reader.zig +8 -9
- package/std/Io/Semaphore.zig +112 -17
- package/std/Io/Terminal.zig +1 -1
- package/std/Io/Threaded.zig +352 -180
- package/std/Io/Uring.zig +15 -16
- package/std/Io/Writer.zig +46 -42
- package/std/Io/net.zig +11 -11
- package/std/Io.zig +1052 -20
- package/std/SemanticVersion.zig +1 -1
- package/std/Target/Query.zig +2 -2
- package/std/Target.zig +53 -7
- package/std/Thread.zig +8 -3
- package/std/array_hash_map.zig +105 -573
- package/std/array_list.zig +22 -31
- package/std/bit_set.zig +22 -6
- package/std/builtin/assembly.zig +68 -0
- package/std/builtin.zig +4 -0
- package/std/c/haiku.zig +3 -0
- package/std/c/serenity.zig +1 -6
- package/std/c.zig +106 -24
- package/std/compress/flate/Compress.zig +3 -3
- package/std/compress/flate/Decompress.zig +2 -3
- package/std/compress/zstd/Decompress.zig +2 -4
- package/std/crypto/Certificate/Bundle.zig +15 -1
- package/std/crypto/Certificate.zig +13 -1
- package/std/crypto/ascon.zig +75 -33
- package/std/crypto/codecs/asn1/Oid.zig +12 -1
- package/std/crypto/codecs/asn1.zig +33 -18
- package/std/crypto/codecs/base64_hex_ct.zig +16 -8
- package/std/crypto/ml_kem.zig +2 -9
- package/std/crypto/tls/Client.zig +79 -4
- package/std/crypto/tls.zig +1 -1
- package/std/crypto.zig +1 -0
- package/std/debug/Dwarf.zig +29 -9
- package/std/debug/Info.zig +4 -0
- package/std/debug/MachOFile.zig +46 -8
- package/std/debug/Pdb.zig +540 -37
- package/std/debug/SelfInfo/Elf.zig +19 -18
- package/std/debug/SelfInfo/MachO.zig +18 -7
- package/std/debug/SelfInfo/Windows.zig +138 -36
- package/std/debug.zig +181 -66
- package/std/enums.zig +25 -19
- package/std/fmt.zig +8 -3
- package/std/fs/path.zig +6 -4
- package/std/heap/ArenaAllocator.zig +145 -154
- package/std/heap/BufferFirstAllocator.zig +165 -0
- package/std/heap/debug_allocator.zig +7 -7
- package/std/heap.zig +2 -126
- package/std/http/Client.zig +31 -30
- package/std/http.zig +14 -13
- package/std/json/Scanner.zig +2 -2
- package/std/json/Stringify.zig +3 -3
- package/std/json/dynamic.zig +4 -4
- package/std/math/big/int.zig +16 -17
- package/std/mem/Allocator.zig +4 -5
- package/std/mem.zig +48 -0
- package/std/os/emscripten.zig +2 -18
- package/std/os/linux/IoUring.zig +2 -0
- package/std/os/linux/aarch64.zig +41 -12
- package/std/os/linux/arc.zig +173 -0
- package/std/os/linux/arm.zig +41 -12
- package/std/os/linux/hexagon.zig +33 -11
- package/std/os/linux/loongarch32.zig +41 -13
- package/std/os/linux/loongarch64.zig +41 -12
- package/std/os/linux/m68k.zig +41 -13
- package/std/os/linux/mips.zig +67 -36
- package/std/os/linux/mips64.zig +60 -29
- package/std/os/linux/mipsn32.zig +60 -29
- package/std/os/linux/or1k.zig +41 -12
- package/std/os/linux/powerpc.zig +41 -12
- package/std/os/linux/powerpc64.zig +41 -12
- package/std/os/linux/riscv32.zig +41 -12
- package/std/os/linux/riscv64.zig +41 -12
- package/std/os/linux/s390x.zig +44 -7
- package/std/os/linux/sparc64.zig +83 -52
- package/std/os/linux/thumb.zig +52 -36
- package/std/os/linux/x32.zig +41 -12
- package/std/os/linux/x86.zig +42 -13
- package/std/os/linux/x86_64.zig +41 -12
- package/std/os/linux.zig +419 -438
- package/std/os/uefi/tables/boot_services.zig +9 -8
- package/std/os/windows.zig +2 -2
- package/std/os.zig +41 -0
- package/std/pdb.zig +143 -4
- package/std/posix.zig +6 -12
- package/std/priority_dequeue.zig +13 -12
- package/std/priority_queue.zig +5 -4
- package/std/process/Child.zig +1 -1
- package/std/process/Environ.zig +1 -1
- package/std/process.zig +1 -1
- package/std/sort.zig +3 -3
- package/std/start.zig +17 -4
- package/std/std.zig +19 -6
- package/std/testing/FailingAllocator.zig +4 -4
- package/std/testing/Smith.zig +37 -2
- package/std/zig/Ast/Render.zig +187 -459
- package/std/zig/Ast.zig +0 -4
- package/std/zig/AstGen.zig +86 -103
- package/std/zig/AstRlAnnotate.zig +0 -11
- package/std/zig/AstSmith.zig +2602 -0
- package/std/zig/BuiltinFn.zig +0 -32
- package/std/zig/Client.zig +8 -3
- package/std/zig/LibCInstallation.zig +4 -3
- package/std/zig/Parse.zig +90 -81
- package/std/zig/Server.zig +26 -0
- package/std/zig/WindowsSdk.zig +13 -13
- package/std/zig/Zir.zig +66 -62
- package/std/zig/ZonGen.zig +6 -5
- package/std/zig/c_translation/helpers.zig +14 -9
- package/std/zig/llvm/Builder.zig +119 -60
- package/std/zig/system.zig +20 -4
- package/std/zig/tokenizer.zig +2 -1
- package/std/zig.zig +7 -10
- package/std/zip.zig +5 -5
- package/zig.h +340 -1
- package/compiler/aro/aro/Driver/Filesystem.zig +0 -241
- package/libc/mingw/complex/cabs.c +0 -48
- package/libc/mingw/complex/cabsf.c +0 -48
- package/libc/mingw/complex/cacos.c +0 -50
- package/libc/mingw/complex/cacosf.c +0 -50
- package/libc/mingw/complex/carg.c +0 -48
- package/libc/mingw/complex/cargf.c +0 -48
- package/libc/mingw/complex/casin.c +0 -50
- package/libc/mingw/complex/casinf.c +0 -50
- package/libc/mingw/complex/catan.c +0 -50
- package/libc/mingw/complex/catanf.c +0 -50
- package/libc/mingw/complex/ccos.c +0 -50
- package/libc/mingw/complex/ccosf.c +0 -50
- package/libc/mingw/complex/cexp.c +0 -48
- package/libc/mingw/complex/cexpf.c +0 -48
- package/libc/mingw/complex/cimag.c +0 -48
- package/libc/mingw/complex/cimagf.c +0 -48
- package/libc/mingw/complex/clog.c +0 -48
- package/libc/mingw/complex/clog10.c +0 -49
- package/libc/mingw/complex/clog10f.c +0 -49
- package/libc/mingw/complex/clogf.c +0 -48
- package/libc/mingw/complex/conj.c +0 -48
- package/libc/mingw/complex/conjf.c +0 -48
- package/libc/mingw/complex/cpow.c +0 -48
- package/libc/mingw/complex/cpowf.c +0 -48
- package/libc/mingw/complex/cproj.c +0 -48
- package/libc/mingw/complex/cprojf.c +0 -48
- package/libc/mingw/complex/creal.c +0 -48
- package/libc/mingw/complex/crealf.c +0 -48
- package/libc/mingw/complex/csin.c +0 -50
- package/libc/mingw/complex/csinf.c +0 -50
- package/libc/mingw/complex/csqrt.c +0 -48
- package/libc/mingw/complex/csqrtf.c +0 -48
- package/libc/mingw/complex/ctan.c +0 -50
- package/libc/mingw/complex/ctanf.c +0 -50
- package/libc/mingw/math/arm/s_rint.c +0 -86
- package/libc/mingw/math/arm/s_rintf.c +0 -51
- package/libc/mingw/math/arm/sincos.S +0 -30
- package/libc/mingw/math/arm-common/sincosl.c +0 -13
- package/libc/mingw/math/arm64/rint.c +0 -12
- package/libc/mingw/math/arm64/rintf.c +0 -12
- package/libc/mingw/math/arm64/sincos.S +0 -32
- package/libc/mingw/math/bsd_private_base.h +0 -148
- package/libc/mingw/math/fdiml.c +0 -24
- package/libc/mingw/math/frexpf.c +0 -13
- package/libc/mingw/math/frexpl.c +0 -71
- package/libc/mingw/math/x86/acosf.c +0 -29
- package/libc/mingw/math/x86/atanf.c +0 -23
- package/libc/mingw/math/x86/atanl.c +0 -18
- package/libc/mingw/math/x86/cos.def.h +0 -65
- package/libc/mingw/math/x86/cosl.c +0 -46
- package/libc/mingw/math/x86/cosl_internal.S +0 -55
- package/libc/mingw/math/x86/ldexp.c +0 -23
- package/libc/mingw/math/x86/scalbn.S +0 -41
- package/libc/mingw/math/x86/scalbnf.S +0 -40
- package/libc/mingw/math/x86/sin.def.h +0 -65
- package/libc/mingw/math/x86/sinl.c +0 -46
- package/libc/mingw/math/x86/sinl_internal.S +0 -58
- package/libc/mingw/math/x86/tanl.S +0 -62
- package/libc/mingw/misc/btowc.c +0 -28
- package/libc/mingw/misc/wcstof.c +0 -66
- package/libc/mingw/misc/wcstoimax.c +0 -132
- package/libc/mingw/misc/wcstoumax.c +0 -126
- package/libc/mingw/misc/wctob.c +0 -29
- package/libc/mingw/misc/winbs_uint64.c +0 -6
- package/libc/mingw/misc/winbs_ulong.c +0 -6
- package/libc/mingw/misc/winbs_ushort.c +0 -6
- package/libc/mingw/stdio/_Exit.c +0 -10
- package/libc/mingw/stdio/_findfirst64i32.c +0 -21
- package/libc/mingw/stdio/_findnext64i32.c +0 -21
- package/libc/mingw/stdio/_fstat64i32.c +0 -37
- package/libc/mingw/stdio/_stat64i32.c +0 -37
- package/libc/mingw/stdio/_wfindfirst64i32.c +0 -21
- package/libc/mingw/stdio/_wfindnext64i32.c +0 -21
- package/libc/mingw/stdio/_wstat64i32.c +0 -37
- package/libc/mingw/winpthreads/spinlock.c +0 -82
- package/libc/musl/src/legacy/isastream.c +0 -7
- package/libc/musl/src/legacy/valloc.c +0 -8
- package/libc/musl/src/linux/tee.c +0 -8
- package/libc/musl/src/math/__cosl.c +0 -96
- package/libc/musl/src/math/__sinl.c +0 -78
- package/libc/musl/src/math/__tanl.c +0 -143
- package/libc/musl/src/math/aarch64/lrint.c +0 -10
- package/libc/musl/src/math/aarch64/lrintf.c +0 -10
- package/libc/musl/src/math/aarch64/rintf.c +0 -7
- package/libc/musl/src/math/cosl.c +0 -39
- package/libc/musl/src/math/fdim.c +0 -10
- package/libc/musl/src/math/fdimf.c +0 -10
- package/libc/musl/src/math/fdiml.c +0 -18
- package/libc/musl/src/math/finite.c +0 -7
- package/libc/musl/src/math/finitef.c +0 -7
- package/libc/musl/src/math/frexp.c +0 -23
- package/libc/musl/src/math/frexpf.c +0 -23
- package/libc/musl/src/math/frexpl.c +0 -29
- package/libc/musl/src/math/i386/lrint.c +0 -8
- package/libc/musl/src/math/i386/lrintf.c +0 -8
- package/libc/musl/src/math/i386/rintf.c +0 -7
- package/libc/musl/src/math/lrint.c +0 -72
- package/libc/musl/src/math/lrintf.c +0 -8
- package/libc/musl/src/math/powerpc64/lrint.c +0 -16
- package/libc/musl/src/math/powerpc64/lrintf.c +0 -16
- package/libc/musl/src/math/rintf.c +0 -30
- package/libc/musl/src/math/s390x/rintf.c +0 -15
- package/libc/musl/src/math/sincosl.c +0 -60
- package/libc/musl/src/math/sinl.c +0 -41
- package/libc/musl/src/math/tanl.c +0 -29
- package/libc/musl/src/math/x32/lrint.s +0 -5
- package/libc/musl/src/math/x32/lrintf.s +0 -5
- package/libc/musl/src/math/x86_64/lrint.c +0 -8
- package/libc/musl/src/math/x86_64/lrintf.c +0 -8
- package/libc/musl/src/string/strdup.c +0 -10
- package/libc/musl/src/string/strndup.c +0 -12
- package/libc/musl/src/string/wcsdup.c +0 -10
- package/libc/musl/src/thread/pthread_spin_destroy.c +0 -6
- package/libc/musl/src/thread/pthread_spin_init.c +0 -6
- package/libc/musl/src/thread/pthread_spin_lock.c +0 -8
- package/libc/musl/src/thread/pthread_spin_trylock.c +0 -7
- package/libc/musl/src/thread/pthread_spin_unlock.c +0 -7
- package/libc/musl/src/unistd/dup2.c +0 -20
- package/libc/musl/src/unistd/dup3.c +0 -26
- package/libc/wasi/libc-bottom-half/sources/reallocarray.c +0 -14
- package/libc/wasi/thread-stub/pthread_spin_lock.c +0 -8
- package/libc/wasi/thread-stub/pthread_spin_trylock.c +0 -8
- package/libc/wasi/thread-stub/pthread_spin_unlock.c +0 -7
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file has no copyright assigned and is placed in the Public Domain.
|
|
3
|
-
* This file is part of the mingw-w64 runtime package.
|
|
4
|
-
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
|
5
|
-
*/
|
|
6
|
-
/*
|
|
7
|
-
This source code was extracted from the Q8 package created and
|
|
8
|
-
placed in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil>
|
|
9
|
-
|
|
10
|
-
last edit: 1999/11/05 gwyn@arl.mil
|
|
11
|
-
|
|
12
|
-
Implements subclause 7.8.2 of ISO/IEC 9899:1999 (E).
|
|
13
|
-
|
|
14
|
-
This particular implementation requires the matching <inttypes.h>.
|
|
15
|
-
It also assumes that character codes for A..Z and a..z are in
|
|
16
|
-
contiguous ascending order; this is true for ASCII but not EBCDIC.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
#include <wchar.h>
|
|
20
|
-
#include <errno.h>
|
|
21
|
-
#include <ctype.h>
|
|
22
|
-
#include <inttypes.h>
|
|
23
|
-
|
|
24
|
-
/* convert digit wide character to number, in any base */
|
|
25
|
-
|
|
26
|
-
#define ToWNumber(c) (iswdigit(c) ? (c) - L'0' : \
|
|
27
|
-
iswupper(c) ? (c) - L'A' + 10 : \
|
|
28
|
-
iswlower(c) ? (c) - L'a' + 10 : \
|
|
29
|
-
-1 /* "invalid" flag */ \
|
|
30
|
-
)
|
|
31
|
-
|
|
32
|
-
/* validate converted digit character for specific base */
|
|
33
|
-
#define valid(n, b) ((n) >= 0 && (n) < (b))
|
|
34
|
-
|
|
35
|
-
uintmax_t
|
|
36
|
-
__cdecl
|
|
37
|
-
wcstoumax(const wchar_t * __restrict__ nptr, wchar_t ** __restrict__ endptr, int base)
|
|
38
|
-
{
|
|
39
|
-
register uintmax_t accum; /* accumulates converted value */
|
|
40
|
-
register uintmax_t next; /* for computing next value of accum */
|
|
41
|
-
register int n; /* numeral from digit character */
|
|
42
|
-
int minus; /* set iff minus sign seen (yes!) */
|
|
43
|
-
int toobig; /* set iff value overflows */
|
|
44
|
-
|
|
45
|
-
if ( endptr != NULL )
|
|
46
|
-
*endptr = (wchar_t *)nptr; /* in case no conv performed */
|
|
47
|
-
|
|
48
|
-
if ( base < 0 || base == 1 || base > 36 )
|
|
49
|
-
{
|
|
50
|
-
errno = EDOM;
|
|
51
|
-
return 0; /* unspecified behavior */
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/* skip initial, possibly empty sequence of white-space w.characters */
|
|
55
|
-
|
|
56
|
-
while ( iswspace(*nptr) )
|
|
57
|
-
++nptr;
|
|
58
|
-
|
|
59
|
-
/* process subject sequence: */
|
|
60
|
-
|
|
61
|
-
/* optional sign */
|
|
62
|
-
|
|
63
|
-
if ( (minus = *nptr == L'-') || *nptr == L'+' )
|
|
64
|
-
++nptr;
|
|
65
|
-
|
|
66
|
-
if ( base == 0 )
|
|
67
|
-
{
|
|
68
|
-
if ( *nptr == L'0' )
|
|
69
|
-
{
|
|
70
|
-
if ( nptr[1] == L'X' || nptr[1] == L'x' )
|
|
71
|
-
base = 16;
|
|
72
|
-
else
|
|
73
|
-
base = 8;
|
|
74
|
-
}
|
|
75
|
-
else
|
|
76
|
-
base = 10;
|
|
77
|
-
}
|
|
78
|
-
/* optional "0x" or "0X" for base 16 */
|
|
79
|
-
|
|
80
|
-
if ( base == 16 && *nptr == L'0'
|
|
81
|
-
&& (nptr[1] == L'X' || nptr[1] == L'x')
|
|
82
|
-
)
|
|
83
|
-
nptr += 2; /* skip past this prefix */
|
|
84
|
-
|
|
85
|
-
/* check whether there is at least one valid digit */
|
|
86
|
-
|
|
87
|
-
n = ToWNumber(*nptr);
|
|
88
|
-
++nptr;
|
|
89
|
-
|
|
90
|
-
if ( !valid(n, base) )
|
|
91
|
-
return 0; /* subject seq. not of expected form */
|
|
92
|
-
|
|
93
|
-
accum = n;
|
|
94
|
-
|
|
95
|
-
for ( toobig = 0; n = ToWNumber(*nptr), valid(n, base); ++nptr )
|
|
96
|
-
if ( accum > UINTMAX_MAX / base + 1 /* major wrap-around */
|
|
97
|
-
|| (next = base * accum + n) < accum /* minor wrap-around */
|
|
98
|
-
)
|
|
99
|
-
toobig = 1; /* but keep scanning */
|
|
100
|
-
else
|
|
101
|
-
accum = next;
|
|
102
|
-
|
|
103
|
-
if ( endptr != NULL )
|
|
104
|
-
*endptr = (wchar_t *)nptr; /* -> first not-valid-digit */
|
|
105
|
-
|
|
106
|
-
if ( toobig )
|
|
107
|
-
{
|
|
108
|
-
errno = ERANGE;
|
|
109
|
-
return UINTMAX_MAX;
|
|
110
|
-
}
|
|
111
|
-
else
|
|
112
|
-
return minus ? -accum : accum; /* (yes!) */
|
|
113
|
-
}
|
|
114
|
-
uintmax_t (__cdecl *__MINGW_IMP_SYMBOL(wcstoumax))(const wchar_t * __restrict__, wchar_t ** __restrict__, int) = wcstoumax;
|
|
115
|
-
|
|
116
|
-
unsigned long long __attribute__ ((alias ("wcstoumax")))
|
|
117
|
-
__cdecl
|
|
118
|
-
wcstoull (const wchar_t* __restrict__ nptr, wchar_t ** __restrict__ endptr, int base);
|
|
119
|
-
extern unsigned long long __attribute__ ((alias (__MINGW64_STRINGIFY(__MINGW_IMP_SYMBOL(wcstoumax)))))
|
|
120
|
-
(__cdecl *__MINGW_IMP_SYMBOL(wcstoull))(const wchar_t * __restrict__, wchar_t ** __restrict__, int);
|
|
121
|
-
|
|
122
|
-
unsigned long long __attribute__ ((alias ("wcstoumax")))
|
|
123
|
-
__cdecl
|
|
124
|
-
_wcstoui64 (const wchar_t* __restrict__ nptr, wchar_t ** __restrict__ endptr, int base);
|
|
125
|
-
extern unsigned long long __attribute__ ((alias (__MINGW64_STRINGIFY(__MINGW_IMP_SYMBOL(wcstoumax)))))
|
|
126
|
-
(__cdecl *__MINGW_IMP_SYMBOL(_wcstoui64))(const wchar_t * __restrict__, wchar_t ** __restrict__, int);
|
package/libc/mingw/misc/wctob.c
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file has no copyright assigned and is placed in the Public Domain.
|
|
3
|
-
* This file is part of the mingw-w64 runtime package.
|
|
4
|
-
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
|
5
|
-
*/
|
|
6
|
-
#ifndef WIN32_LEAN_AND_MEAN
|
|
7
|
-
#define WIN32_LEAN_AND_MEAN
|
|
8
|
-
#endif
|
|
9
|
-
#include "mb_wc_common.h"
|
|
10
|
-
#include <wchar.h>
|
|
11
|
-
#include <stdio.h>
|
|
12
|
-
#include <stdlib.h>
|
|
13
|
-
#include <errno.h>
|
|
14
|
-
#include <windows.h>
|
|
15
|
-
|
|
16
|
-
/* Return just the first byte after translating to multibyte. */
|
|
17
|
-
int wctob (wint_t wc )
|
|
18
|
-
{
|
|
19
|
-
wchar_t w = wc;
|
|
20
|
-
char c;
|
|
21
|
-
int invalid_char = 0;
|
|
22
|
-
if (!WideCharToMultiByte (___lc_codepage_func(),
|
|
23
|
-
0 /* Is this correct flag? */,
|
|
24
|
-
&w, 1, &c, 1, NULL, &invalid_char)
|
|
25
|
-
|| invalid_char)
|
|
26
|
-
return EOF;
|
|
27
|
-
|
|
28
|
-
return (unsigned char) c;
|
|
29
|
-
}
|
package/libc/mingw/stdio/_Exit.c
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file has no copyright assigned and is placed in the Public Domain.
|
|
3
|
-
* This file is part of the mingw-w64 runtime package.
|
|
4
|
-
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
|
5
|
-
*/
|
|
6
|
-
#define __CRT__NO_INLINE
|
|
7
|
-
#include <stdlib.h>
|
|
8
|
-
|
|
9
|
-
void _Exit(int status)
|
|
10
|
-
{ _exit(status); }
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#define __CRT__NO_INLINE
|
|
2
|
-
#include <io.h>
|
|
3
|
-
#include <string.h>
|
|
4
|
-
|
|
5
|
-
intptr_t __cdecl _findfirst64i32(const char *_Filename,struct _finddata64i32_t *_FindData)
|
|
6
|
-
{
|
|
7
|
-
struct __finddata64_t fd;
|
|
8
|
-
intptr_t ret = _findfirst64(_Filename,&fd);
|
|
9
|
-
if (ret == -1) {
|
|
10
|
-
*_FindData = (struct _finddata64i32_t){0};
|
|
11
|
-
return -1;
|
|
12
|
-
}
|
|
13
|
-
_FindData->attrib=fd.attrib;
|
|
14
|
-
_FindData->time_create=fd.time_create;
|
|
15
|
-
_FindData->time_access=fd.time_access;
|
|
16
|
-
_FindData->time_write=fd.time_write;
|
|
17
|
-
_FindData->size=(_fsize_t) fd.size;
|
|
18
|
-
strncpy(_FindData->name,fd.name,260);
|
|
19
|
-
return ret;
|
|
20
|
-
}
|
|
21
|
-
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#define __CRT__NO_INLINE
|
|
2
|
-
#include <io.h>
|
|
3
|
-
#include <string.h>
|
|
4
|
-
|
|
5
|
-
int __cdecl _findnext64i32(intptr_t _FindHandle,struct _finddata64i32_t *_FindData)
|
|
6
|
-
{
|
|
7
|
-
struct __finddata64_t fd;
|
|
8
|
-
int ret = _findnext64(_FindHandle,&fd);
|
|
9
|
-
if (ret == -1) {
|
|
10
|
-
*_FindData = (struct _finddata64i32_t){0};
|
|
11
|
-
return -1;
|
|
12
|
-
}
|
|
13
|
-
_FindData->attrib=fd.attrib;
|
|
14
|
-
_FindData->time_create=fd.time_create;
|
|
15
|
-
_FindData->time_access=fd.time_access;
|
|
16
|
-
_FindData->time_write=fd.time_write;
|
|
17
|
-
_FindData->size=(_fsize_t) fd.size;
|
|
18
|
-
strncpy(_FindData->name,fd.name,260);
|
|
19
|
-
return ret;
|
|
20
|
-
}
|
|
21
|
-
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file has no copyright assigned and is placed in the Public Domain.
|
|
3
|
-
* This file is part of the mingw-w64 runtime package.
|
|
4
|
-
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
#include <sys/stat.h>
|
|
8
|
-
|
|
9
|
-
/* When the file size does not fit into the st_size field:
|
|
10
|
-
* crtdll-msvcr90 msvcr100 msvcr110+
|
|
11
|
-
* st_size truncate 0 0
|
|
12
|
-
* errno no change no change EOVERFLOW
|
|
13
|
-
* returns 0 -1 -1
|
|
14
|
-
*
|
|
15
|
-
* This file is used only for pre-msvcr80 builds,
|
|
16
|
-
* So use the pre-msvcr80 behavior - truncate without error.
|
|
17
|
-
*/
|
|
18
|
-
int __cdecl _fstat64i32(int _FileDes,struct _stat64i32 *_Stat)
|
|
19
|
-
{
|
|
20
|
-
struct _stat64 st;
|
|
21
|
-
int ret=_fstat64(_FileDes,&st);
|
|
22
|
-
if (ret != 0)
|
|
23
|
-
return ret;
|
|
24
|
-
_Stat->st_dev=st.st_dev;
|
|
25
|
-
_Stat->st_ino=st.st_ino;
|
|
26
|
-
_Stat->st_mode=st.st_mode;
|
|
27
|
-
_Stat->st_nlink=st.st_nlink;
|
|
28
|
-
_Stat->st_uid=st.st_uid;
|
|
29
|
-
_Stat->st_gid=st.st_gid;
|
|
30
|
-
_Stat->st_rdev=st.st_rdev;
|
|
31
|
-
_Stat->st_size=(_off_t) st.st_size; /* truncate 64-bit st_size to 32-bit */
|
|
32
|
-
_Stat->st_atime=st.st_atime;
|
|
33
|
-
_Stat->st_mtime=st.st_mtime;
|
|
34
|
-
_Stat->st_ctime=st.st_ctime;
|
|
35
|
-
return 0;
|
|
36
|
-
}
|
|
37
|
-
int (__cdecl *__MINGW_IMP_SYMBOL(_fstat64i32))(int, struct _stat64i32 *) = _fstat64i32;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file has no copyright assigned and is placed in the Public Domain.
|
|
3
|
-
* This file is part of the mingw-w64 runtime package.
|
|
4
|
-
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
#include <sys/stat.h>
|
|
8
|
-
|
|
9
|
-
/* When the file size does not fit into the st_size field:
|
|
10
|
-
* crtdll-msvcr90 msvcr100 msvcr110+
|
|
11
|
-
* st_size truncate 0 0
|
|
12
|
-
* errno no change no change EOVERFLOW
|
|
13
|
-
* returns 0 -1 -1
|
|
14
|
-
*
|
|
15
|
-
* This file is used only for pre-msvcr80 builds,
|
|
16
|
-
* So use the pre-msvcr80 behavior - truncate without error.
|
|
17
|
-
*/
|
|
18
|
-
int __cdecl _stat64i32(const char *_Name,struct _stat64i32 *_Stat)
|
|
19
|
-
{
|
|
20
|
-
struct _stat64 st;
|
|
21
|
-
int ret=_stat64(_Name,&st);
|
|
22
|
-
if (ret != 0)
|
|
23
|
-
return ret;
|
|
24
|
-
_Stat->st_dev=st.st_dev;
|
|
25
|
-
_Stat->st_ino=st.st_ino;
|
|
26
|
-
_Stat->st_mode=st.st_mode;
|
|
27
|
-
_Stat->st_nlink=st.st_nlink;
|
|
28
|
-
_Stat->st_uid=st.st_uid;
|
|
29
|
-
_Stat->st_gid=st.st_gid;
|
|
30
|
-
_Stat->st_rdev=st.st_rdev;
|
|
31
|
-
_Stat->st_size=(_off_t) st.st_size; /* truncate 64-bit st_size to 32-bit */
|
|
32
|
-
_Stat->st_atime=st.st_atime;
|
|
33
|
-
_Stat->st_mtime=st.st_mtime;
|
|
34
|
-
_Stat->st_ctime=st.st_ctime;
|
|
35
|
-
return 0;
|
|
36
|
-
}
|
|
37
|
-
int (__cdecl *__MINGW_IMP_SYMBOL(_stat64i32))(const char *, struct _stat64i32 *) = _stat64i32;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#define __CRT__NO_INLINE
|
|
2
|
-
#include <io.h>
|
|
3
|
-
#include <string.h>
|
|
4
|
-
|
|
5
|
-
intptr_t __cdecl _wfindfirst64i32(const wchar_t *_Filename,struct _wfinddata64i32_t *_FindData)
|
|
6
|
-
{
|
|
7
|
-
struct _wfinddata64_t fd;
|
|
8
|
-
intptr_t ret = _wfindfirst64(_Filename,&fd);
|
|
9
|
-
if (ret == -1) {
|
|
10
|
-
*_FindData = (struct _wfinddata64i32_t){0};
|
|
11
|
-
return -1;
|
|
12
|
-
}
|
|
13
|
-
_FindData->attrib=fd.attrib;
|
|
14
|
-
_FindData->time_create=fd.time_create;
|
|
15
|
-
_FindData->time_access=fd.time_access;
|
|
16
|
-
_FindData->time_write=fd.time_write;
|
|
17
|
-
_FindData->size=(_fsize_t) fd.size;
|
|
18
|
-
memcpy(_FindData->name,fd.name,260*sizeof(wchar_t));
|
|
19
|
-
return ret;
|
|
20
|
-
}
|
|
21
|
-
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#define __CRT__NO_INLINE
|
|
2
|
-
#include <io.h>
|
|
3
|
-
#include <string.h>
|
|
4
|
-
|
|
5
|
-
int __cdecl _wfindnext64i32(intptr_t _FindHandle,struct _wfinddata64i32_t *_FindData)
|
|
6
|
-
{
|
|
7
|
-
struct _wfinddata64_t fd;
|
|
8
|
-
int ret = _wfindnext64(_FindHandle,&fd);
|
|
9
|
-
if (ret == -1) {
|
|
10
|
-
*_FindData = (struct _wfinddata64i32_t){0};
|
|
11
|
-
return -1;
|
|
12
|
-
}
|
|
13
|
-
_FindData->attrib=fd.attrib;
|
|
14
|
-
_FindData->time_create=fd.time_create;
|
|
15
|
-
_FindData->time_access=fd.time_access;
|
|
16
|
-
_FindData->time_write=fd.time_write;
|
|
17
|
-
_FindData->size=(_fsize_t) fd.size;
|
|
18
|
-
memcpy(_FindData->name,fd.name,260*sizeof(wchar_t));
|
|
19
|
-
return ret;
|
|
20
|
-
}
|
|
21
|
-
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file has no copyright assigned and is placed in the Public Domain.
|
|
3
|
-
* This file is part of the mingw-w64 runtime package.
|
|
4
|
-
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
#include <sys/stat.h>
|
|
8
|
-
|
|
9
|
-
/* When the file size does not fit into the st_size field:
|
|
10
|
-
* crtdll-msvcr90 msvcr100 msvcr110+
|
|
11
|
-
* st_size truncate 0 0
|
|
12
|
-
* errno no change no change EOVERFLOW
|
|
13
|
-
* returns 0 -1 -1
|
|
14
|
-
*
|
|
15
|
-
* This file is used only for pre-msvcr80 builds,
|
|
16
|
-
* So use the pre-msvcr80 behavior - truncate without error.
|
|
17
|
-
*/
|
|
18
|
-
int __cdecl _wstat64i32(const wchar_t *_Name,struct _stat64i32 *_Stat)
|
|
19
|
-
{
|
|
20
|
-
struct _stat64 st;
|
|
21
|
-
int ret=_wstat64(_Name,&st);
|
|
22
|
-
if (ret != 0)
|
|
23
|
-
return ret;
|
|
24
|
-
_Stat->st_dev=st.st_dev;
|
|
25
|
-
_Stat->st_ino=st.st_ino;
|
|
26
|
-
_Stat->st_mode=st.st_mode;
|
|
27
|
-
_Stat->st_nlink=st.st_nlink;
|
|
28
|
-
_Stat->st_uid=st.st_uid;
|
|
29
|
-
_Stat->st_gid=st.st_gid;
|
|
30
|
-
_Stat->st_rdev=st.st_rdev;
|
|
31
|
-
_Stat->st_size=(_off_t) st.st_size; /* truncate 64-bit st_size to 32-bit */
|
|
32
|
-
_Stat->st_atime=st.st_atime;
|
|
33
|
-
_Stat->st_mtime=st.st_mtime;
|
|
34
|
-
_Stat->st_ctime=st.st_ctime;
|
|
35
|
-
return 0;
|
|
36
|
-
}
|
|
37
|
-
int (__cdecl *__MINGW_IMP_SYMBOL(_wstat64i32))(const wchar_t *, struct _stat64i32 *) = _wstat64i32;
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright (c) 2013 mingw-w64 project
|
|
3
|
-
Copyright (c) 2015 Intel Corporation
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a
|
|
6
|
-
copy of this software and associated documentation files (the "Software"),
|
|
7
|
-
to deal in the Software without restriction, including without limitation
|
|
8
|
-
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
9
|
-
and/or sell copies of the Software, and to permit persons to whom the
|
|
10
|
-
Software is furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
|
13
|
-
all copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
20
|
-
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
21
|
-
DEALINGS IN THE SOFTWARE.
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
#ifdef HAVE_CONFIG_H
|
|
25
|
-
#include "config.h"
|
|
26
|
-
#endif
|
|
27
|
-
|
|
28
|
-
#define WIN32_LEAN_AND_MEAN
|
|
29
|
-
#include <windows.h>
|
|
30
|
-
|
|
31
|
-
/* public header files */
|
|
32
|
-
#include "pthread.h"
|
|
33
|
-
/* internal header files */
|
|
34
|
-
#include "misc.h"
|
|
35
|
-
|
|
36
|
-
/* We use the pthread_spinlock_t itself as a lock:
|
|
37
|
-
-1 is free, 0 is locked.
|
|
38
|
-
(This is dictated by PTHREAD_SPINLOCK_INITIALIZER, which we can't change
|
|
39
|
-
without breaking binary compatibility.) */
|
|
40
|
-
typedef intptr_t spinlock_word_t;
|
|
41
|
-
|
|
42
|
-
int
|
|
43
|
-
pthread_spin_init (pthread_spinlock_t *lock, int pshared)
|
|
44
|
-
{
|
|
45
|
-
spinlock_word_t *lk = (spinlock_word_t *)lock;
|
|
46
|
-
*lk = -1;
|
|
47
|
-
return 0;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
int
|
|
52
|
-
pthread_spin_destroy (pthread_spinlock_t *lock)
|
|
53
|
-
{
|
|
54
|
-
return 0;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
int
|
|
58
|
-
pthread_spin_lock (pthread_spinlock_t *lock)
|
|
59
|
-
{
|
|
60
|
-
volatile spinlock_word_t *lk = (volatile spinlock_word_t *)lock;
|
|
61
|
-
while (unlikely(InterlockedExchangePointer((PVOID volatile *)lk, 0) == 0))
|
|
62
|
-
do {
|
|
63
|
-
YieldProcessor();
|
|
64
|
-
} while (*lk == 0);
|
|
65
|
-
return 0;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
int
|
|
69
|
-
pthread_spin_trylock (pthread_spinlock_t *lock)
|
|
70
|
-
{
|
|
71
|
-
spinlock_word_t *lk = (spinlock_word_t *)lock;
|
|
72
|
-
return InterlockedExchangePointer((PVOID volatile *)lk, 0) == 0 ? EBUSY : 0;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
int
|
|
77
|
-
pthread_spin_unlock (pthread_spinlock_t *lock)
|
|
78
|
-
{
|
|
79
|
-
volatile spinlock_word_t *lk = (volatile spinlock_word_t *)lock;
|
|
80
|
-
*lk = -1;
|
|
81
|
-
return 0;
|
|
82
|
-
}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
/* origin: FreeBSD /usr/src/lib/msun/ld80/k_cosl.c */
|
|
2
|
-
/* origin: FreeBSD /usr/src/lib/msun/ld128/k_cosl.c */
|
|
3
|
-
/*
|
|
4
|
-
* ====================================================
|
|
5
|
-
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
|
|
6
|
-
* Copyright (c) 2008 Steven G. Kargl, David Schultz, Bruce D. Evans.
|
|
7
|
-
*
|
|
8
|
-
* Developed at SunSoft, a Sun Microsystems, Inc. business.
|
|
9
|
-
* Permission to use, copy, modify, and distribute this
|
|
10
|
-
* software is freely granted, provided that this notice
|
|
11
|
-
* is preserved.
|
|
12
|
-
* ====================================================
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
#include "libm.h"
|
|
17
|
-
|
|
18
|
-
#if (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384
|
|
19
|
-
#if LDBL_MANT_DIG == 64
|
|
20
|
-
/*
|
|
21
|
-
* ld80 version of __cos.c. See __cos.c for most comments.
|
|
22
|
-
*/
|
|
23
|
-
/*
|
|
24
|
-
* Domain [-0.7854, 0.7854], range ~[-2.43e-23, 2.425e-23]:
|
|
25
|
-
* |cos(x) - c(x)| < 2**-75.1
|
|
26
|
-
*
|
|
27
|
-
* The coefficients of c(x) were generated by a pari-gp script using
|
|
28
|
-
* a Remez algorithm that searches for the best higher coefficients
|
|
29
|
-
* after rounding leading coefficients to a specified precision.
|
|
30
|
-
*
|
|
31
|
-
* Simpler methods like Chebyshev or basic Remez barely suffice for
|
|
32
|
-
* cos() in 64-bit precision, because we want the coefficient of x^2
|
|
33
|
-
* to be precisely -0.5 so that multiplying by it is exact, and plain
|
|
34
|
-
* rounding of the coefficients of a good polynomial approximation only
|
|
35
|
-
* gives this up to about 64-bit precision. Plain rounding also gives
|
|
36
|
-
* a mediocre approximation for the coefficient of x^4, but a rounding
|
|
37
|
-
* error of 0.5 ulps for this coefficient would only contribute ~0.01
|
|
38
|
-
* ulps to the final error, so this is unimportant. Rounding errors in
|
|
39
|
-
* higher coefficients are even less important.
|
|
40
|
-
*
|
|
41
|
-
* In fact, coefficients above the x^4 one only need to have 53-bit
|
|
42
|
-
* precision, and this is more efficient. We get this optimization
|
|
43
|
-
* almost for free from the complications needed to search for the best
|
|
44
|
-
* higher coefficients.
|
|
45
|
-
*/
|
|
46
|
-
static const long double
|
|
47
|
-
C1 = 0.0416666666666666666136L; /* 0xaaaaaaaaaaaaaa9b.0p-68 */
|
|
48
|
-
static const double
|
|
49
|
-
C2 = -0.0013888888888888874, /* -0x16c16c16c16c10.0p-62 */
|
|
50
|
-
C3 = 0.000024801587301571716, /* 0x1a01a01a018e22.0p-68 */
|
|
51
|
-
C4 = -0.00000027557319215507120, /* -0x127e4fb7602f22.0p-74 */
|
|
52
|
-
C5 = 0.0000000020876754400407278, /* 0x11eed8caaeccf1.0p-81 */
|
|
53
|
-
C6 = -1.1470297442401303e-11, /* -0x19393412bd1529.0p-89 */
|
|
54
|
-
C7 = 4.7383039476436467e-14; /* 0x1aac9d9af5c43e.0p-97 */
|
|
55
|
-
#define POLY(z) (z*(C1+z*(C2+z*(C3+z*(C4+z*(C5+z*(C6+z*C7)))))))
|
|
56
|
-
#elif LDBL_MANT_DIG == 113
|
|
57
|
-
/*
|
|
58
|
-
* ld128 version of __cos.c. See __cos.c for most comments.
|
|
59
|
-
*/
|
|
60
|
-
/*
|
|
61
|
-
* Domain [-0.7854, 0.7854], range ~[-1.80e-37, 1.79e-37]:
|
|
62
|
-
* |cos(x) - c(x))| < 2**-122.0
|
|
63
|
-
*
|
|
64
|
-
* 113-bit precision requires more care than 64-bit precision, since
|
|
65
|
-
* simple methods give a minimax polynomial with coefficient for x^2
|
|
66
|
-
* that is 1 ulp below 0.5, but we want it to be precisely 0.5. See
|
|
67
|
-
* above for more details.
|
|
68
|
-
*/
|
|
69
|
-
static const long double
|
|
70
|
-
C1 = 0.04166666666666666666666666666666658424671L,
|
|
71
|
-
C2 = -0.001388888888888888888888888888863490893732L,
|
|
72
|
-
C3 = 0.00002480158730158730158730158600795304914210L,
|
|
73
|
-
C4 = -0.2755731922398589065255474947078934284324e-6L,
|
|
74
|
-
C5 = 0.2087675698786809897659225313136400793948e-8L,
|
|
75
|
-
C6 = -0.1147074559772972315817149986812031204775e-10L,
|
|
76
|
-
C7 = 0.4779477332386808976875457937252120293400e-13L;
|
|
77
|
-
static const double
|
|
78
|
-
C8 = -0.1561920696721507929516718307820958119868e-15,
|
|
79
|
-
C9 = 0.4110317413744594971475941557607804508039e-18,
|
|
80
|
-
C10 = -0.8896592467191938803288521958313920156409e-21,
|
|
81
|
-
C11 = 0.1601061435794535138244346256065192782581e-23;
|
|
82
|
-
#define POLY(z) (z*(C1+z*(C2+z*(C3+z*(C4+z*(C5+z*(C6+z*(C7+ \
|
|
83
|
-
z*(C8+z*(C9+z*(C10+z*C11)))))))))))
|
|
84
|
-
#endif
|
|
85
|
-
|
|
86
|
-
long double __cosl(long double x, long double y)
|
|
87
|
-
{
|
|
88
|
-
long double hz,z,r,w;
|
|
89
|
-
|
|
90
|
-
z = x*x;
|
|
91
|
-
r = POLY(z);
|
|
92
|
-
hz = 0.5*z;
|
|
93
|
-
w = 1.0-hz;
|
|
94
|
-
return w + (((1.0-w)-hz) + (z*r-x*y));
|
|
95
|
-
}
|
|
96
|
-
#endif
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/* origin: FreeBSD /usr/src/lib/msun/ld80/k_sinl.c */
|
|
2
|
-
/* origin: FreeBSD /usr/src/lib/msun/ld128/k_sinl.c */
|
|
3
|
-
/*
|
|
4
|
-
* ====================================================
|
|
5
|
-
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
|
|
6
|
-
* Copyright (c) 2008 Steven G. Kargl, David Schultz, Bruce D. Evans.
|
|
7
|
-
*
|
|
8
|
-
* Developed at SunSoft, a Sun Microsystems, Inc. business.
|
|
9
|
-
* Permission to use, copy, modify, and distribute this
|
|
10
|
-
* software is freely granted, provided that this notice
|
|
11
|
-
* is preserved.
|
|
12
|
-
* ====================================================
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
#include "libm.h"
|
|
16
|
-
|
|
17
|
-
#if (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384
|
|
18
|
-
#if LDBL_MANT_DIG == 64
|
|
19
|
-
/*
|
|
20
|
-
* ld80 version of __sin.c. See __sin.c for most comments.
|
|
21
|
-
*/
|
|
22
|
-
/*
|
|
23
|
-
* Domain [-0.7854, 0.7854], range ~[-1.89e-22, 1.915e-22]
|
|
24
|
-
* |sin(x)/x - s(x)| < 2**-72.1
|
|
25
|
-
*
|
|
26
|
-
* See __cosl.c for more details about the polynomial.
|
|
27
|
-
*/
|
|
28
|
-
static const long double
|
|
29
|
-
S1 = -0.166666666666666666671L; /* -0xaaaaaaaaaaaaaaab.0p-66 */
|
|
30
|
-
static const double
|
|
31
|
-
S2 = 0.0083333333333333332, /* 0x11111111111111.0p-59 */
|
|
32
|
-
S3 = -0.00019841269841269427, /* -0x1a01a01a019f81.0p-65 */
|
|
33
|
-
S4 = 0.0000027557319223597490, /* 0x171de3a55560f7.0p-71 */
|
|
34
|
-
S5 = -0.000000025052108218074604, /* -0x1ae64564f16cad.0p-78 */
|
|
35
|
-
S6 = 1.6059006598854211e-10, /* 0x161242b90243b5.0p-85 */
|
|
36
|
-
S7 = -7.6429779983024564e-13, /* -0x1ae42ebd1b2e00.0p-93 */
|
|
37
|
-
S8 = 2.6174587166648325e-15; /* 0x179372ea0b3f64.0p-101 */
|
|
38
|
-
#define POLY(z) (S2+z*(S3+z*(S4+z*(S5+z*(S6+z*(S7+z*S8))))))
|
|
39
|
-
#elif LDBL_MANT_DIG == 113
|
|
40
|
-
/*
|
|
41
|
-
* ld128 version of __sin.c. See __sin.c for most comments.
|
|
42
|
-
*/
|
|
43
|
-
/*
|
|
44
|
-
* Domain [-0.7854, 0.7854], range ~[-1.53e-37, 1.659e-37]
|
|
45
|
-
* |sin(x)/x - s(x)| < 2**-122.1
|
|
46
|
-
*
|
|
47
|
-
* See __cosl.c for more details about the polynomial.
|
|
48
|
-
*/
|
|
49
|
-
static const long double
|
|
50
|
-
S1 = -0.16666666666666666666666666666666666606732416116558L,
|
|
51
|
-
S2 = 0.0083333333333333333333333333333331135404851288270047L,
|
|
52
|
-
S3 = -0.00019841269841269841269841269839935785325638310428717L,
|
|
53
|
-
S4 = 0.27557319223985890652557316053039946268333231205686e-5L,
|
|
54
|
-
S5 = -0.25052108385441718775048214826384312253862930064745e-7L,
|
|
55
|
-
S6 = 0.16059043836821614596571832194524392581082444805729e-9L,
|
|
56
|
-
S7 = -0.76471637318198151807063387954939213287488216303768e-12L,
|
|
57
|
-
S8 = 0.28114572543451292625024967174638477283187397621303e-14L;
|
|
58
|
-
static const double
|
|
59
|
-
S9 = -0.82206352458348947812512122163446202498005154296863e-17,
|
|
60
|
-
S10 = 0.19572940011906109418080609928334380560135358385256e-19,
|
|
61
|
-
S11 = -0.38680813379701966970673724299207480965452616911420e-22,
|
|
62
|
-
S12 = 0.64038150078671872796678569586315881020659912139412e-25;
|
|
63
|
-
#define POLY(z) (S2+z*(S3+z*(S4+z*(S5+z*(S6+z*(S7+z*(S8+ \
|
|
64
|
-
z*(S9+z*(S10+z*(S11+z*S12))))))))))
|
|
65
|
-
#endif
|
|
66
|
-
|
|
67
|
-
long double __sinl(long double x, long double y, int iy)
|
|
68
|
-
{
|
|
69
|
-
long double z,r,v;
|
|
70
|
-
|
|
71
|
-
z = x*x;
|
|
72
|
-
v = z*x;
|
|
73
|
-
r = POLY(z);
|
|
74
|
-
if (iy == 0)
|
|
75
|
-
return x+v*(S1+z*r);
|
|
76
|
-
return x-((z*(0.5*y-v*r)-y)-v*S1);
|
|
77
|
-
}
|
|
78
|
-
#endif
|