triton-windows 3.5.1.post21__cp313-cp313-win_amd64.whl
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.
- triton/_C/libtriton.pyd +0 -0
- triton/__init__.py +82 -0
- triton/_filecheck.py +97 -0
- triton/_internal_testing.py +255 -0
- triton/_utils.py +126 -0
- triton/backends/__init__.py +47 -0
- triton/backends/amd/__init__.py +0 -0
- triton/backends/amd/compiler.py +461 -0
- triton/backends/amd/driver.c +283 -0
- triton/backends/amd/driver.py +724 -0
- triton/backends/amd/lib/asanrtl.bc +0 -0
- triton/backends/amd/lib/ockl.bc +0 -0
- triton/backends/amd/lib/ocml.bc +0 -0
- triton/backends/compiler.py +90 -0
- triton/backends/driver.py +66 -0
- triton/backends/nvidia/__init__.py +0 -0
- triton/backends/nvidia/bin/ptxas.exe +0 -0
- triton/backends/nvidia/compiler.py +533 -0
- triton/backends/nvidia/driver.c +517 -0
- triton/backends/nvidia/driver.py +799 -0
- triton/backends/nvidia/include/cuda.h +26280 -0
- triton/backends/nvidia/lib/libdevice.10.bc +0 -0
- triton/backends/nvidia/lib/x64/cuda.lib +0 -0
- triton/compiler/__init__.py +7 -0
- triton/compiler/code_generator.py +1614 -0
- triton/compiler/compiler.py +509 -0
- triton/compiler/errors.py +51 -0
- triton/compiler/make_launcher.py +0 -0
- triton/errors.py +5 -0
- triton/experimental/__init__.py +0 -0
- triton/experimental/gluon/__init__.py +5 -0
- triton/experimental/gluon/_compiler.py +0 -0
- triton/experimental/gluon/_runtime.py +102 -0
- triton/experimental/gluon/language/__init__.py +119 -0
- triton/experimental/gluon/language/_core.py +490 -0
- triton/experimental/gluon/language/_layouts.py +583 -0
- triton/experimental/gluon/language/_math.py +20 -0
- triton/experimental/gluon/language/_semantic.py +380 -0
- triton/experimental/gluon/language/_standard.py +80 -0
- triton/experimental/gluon/language/amd/__init__.py +4 -0
- triton/experimental/gluon/language/amd/_layouts.py +96 -0
- triton/experimental/gluon/language/amd/cdna3/__init__.py +100 -0
- triton/experimental/gluon/language/amd/cdna4/__init__.py +48 -0
- triton/experimental/gluon/language/amd/cdna4/async_copy.py +151 -0
- triton/experimental/gluon/language/extra/__init__.py +3 -0
- triton/experimental/gluon/language/nvidia/__init__.py +4 -0
- triton/experimental/gluon/language/nvidia/ampere/__init__.py +3 -0
- triton/experimental/gluon/language/nvidia/ampere/async_copy.py +74 -0
- triton/experimental/gluon/language/nvidia/ampere/mbarrier.py +80 -0
- triton/experimental/gluon/language/nvidia/blackwell/__init__.py +387 -0
- triton/experimental/gluon/language/nvidia/blackwell/tma.py +52 -0
- triton/experimental/gluon/language/nvidia/hopper/__init__.py +132 -0
- triton/experimental/gluon/language/nvidia/hopper/mbarrier.py +34 -0
- triton/experimental/gluon/language/nvidia/hopper/tma.py +97 -0
- triton/experimental/gluon/nvidia/__init__.py +4 -0
- triton/experimental/gluon/nvidia/blackwell.py +3 -0
- triton/experimental/gluon/nvidia/hopper.py +45 -0
- triton/knobs.py +546 -0
- triton/language/__init__.py +342 -0
- triton/language/core.py +3405 -0
- triton/language/extra/__init__.py +26 -0
- triton/language/extra/cuda/__init__.py +16 -0
- triton/language/extra/cuda/gdc.py +42 -0
- triton/language/extra/cuda/libdevice.py +1629 -0
- triton/language/extra/cuda/utils.py +109 -0
- triton/language/extra/hip/__init__.py +5 -0
- triton/language/extra/hip/libdevice.py +491 -0
- triton/language/extra/hip/utils.py +35 -0
- triton/language/extra/libdevice.py +790 -0
- triton/language/math.py +249 -0
- triton/language/random.py +218 -0
- triton/language/semantic.py +1939 -0
- triton/language/standard.py +534 -0
- triton/language/target_info.py +54 -0
- triton/runtime/__init__.py +23 -0
- triton/runtime/_allocation.py +44 -0
- triton/runtime/_async_compile.py +55 -0
- triton/runtime/autotuner.py +476 -0
- triton/runtime/build.py +168 -0
- triton/runtime/cache.py +317 -0
- triton/runtime/driver.py +38 -0
- triton/runtime/errors.py +36 -0
- triton/runtime/interpreter.py +1414 -0
- triton/runtime/jit.py +1107 -0
- triton/runtime/tcc/include/_mingw.h +168 -0
- triton/runtime/tcc/include/assert.h +62 -0
- triton/runtime/tcc/include/conio.h +409 -0
- triton/runtime/tcc/include/ctype.h +281 -0
- triton/runtime/tcc/include/dir.h +31 -0
- triton/runtime/tcc/include/direct.h +68 -0
- triton/runtime/tcc/include/dirent.h +135 -0
- triton/runtime/tcc/include/dos.h +55 -0
- triton/runtime/tcc/include/errno.h +75 -0
- triton/runtime/tcc/include/excpt.h +123 -0
- triton/runtime/tcc/include/fcntl.h +52 -0
- triton/runtime/tcc/include/fenv.h +108 -0
- triton/runtime/tcc/include/float.h +75 -0
- triton/runtime/tcc/include/inttypes.h +297 -0
- triton/runtime/tcc/include/io.h +418 -0
- triton/runtime/tcc/include/iso646.h +36 -0
- triton/runtime/tcc/include/limits.h +116 -0
- triton/runtime/tcc/include/locale.h +91 -0
- triton/runtime/tcc/include/malloc.h +181 -0
- triton/runtime/tcc/include/math.h +497 -0
- triton/runtime/tcc/include/mem.h +13 -0
- triton/runtime/tcc/include/memory.h +40 -0
- triton/runtime/tcc/include/process.h +176 -0
- triton/runtime/tcc/include/sec_api/conio_s.h +42 -0
- triton/runtime/tcc/include/sec_api/crtdbg_s.h +19 -0
- triton/runtime/tcc/include/sec_api/io_s.h +33 -0
- triton/runtime/tcc/include/sec_api/mbstring_s.h +52 -0
- triton/runtime/tcc/include/sec_api/search_s.h +25 -0
- triton/runtime/tcc/include/sec_api/stdio_s.h +145 -0
- triton/runtime/tcc/include/sec_api/stdlib_s.h +67 -0
- triton/runtime/tcc/include/sec_api/stralign_s.h +30 -0
- triton/runtime/tcc/include/sec_api/string_s.h +41 -0
- triton/runtime/tcc/include/sec_api/sys/timeb_s.h +34 -0
- triton/runtime/tcc/include/sec_api/tchar_s.h +266 -0
- triton/runtime/tcc/include/sec_api/time_s.h +61 -0
- triton/runtime/tcc/include/sec_api/wchar_s.h +128 -0
- triton/runtime/tcc/include/setjmp.h +160 -0
- triton/runtime/tcc/include/share.h +28 -0
- triton/runtime/tcc/include/signal.h +63 -0
- triton/runtime/tcc/include/stdalign.h +16 -0
- triton/runtime/tcc/include/stdarg.h +14 -0
- triton/runtime/tcc/include/stdatomic.h +171 -0
- triton/runtime/tcc/include/stdbool.h +11 -0
- triton/runtime/tcc/include/stddef.h +42 -0
- triton/runtime/tcc/include/stdint.h +212 -0
- triton/runtime/tcc/include/stdio.h +429 -0
- triton/runtime/tcc/include/stdlib.h +591 -0
- triton/runtime/tcc/include/stdnoreturn.h +7 -0
- triton/runtime/tcc/include/string.h +164 -0
- triton/runtime/tcc/include/sys/fcntl.h +13 -0
- triton/runtime/tcc/include/sys/file.h +14 -0
- triton/runtime/tcc/include/sys/locking.h +30 -0
- triton/runtime/tcc/include/sys/stat.h +290 -0
- triton/runtime/tcc/include/sys/time.h +69 -0
- triton/runtime/tcc/include/sys/timeb.h +133 -0
- triton/runtime/tcc/include/sys/types.h +123 -0
- triton/runtime/tcc/include/sys/unistd.h +14 -0
- triton/runtime/tcc/include/sys/utime.h +146 -0
- triton/runtime/tcc/include/tcc/tcc_libm.h +618 -0
- triton/runtime/tcc/include/tccdefs.h +342 -0
- triton/runtime/tcc/include/tcclib.h +80 -0
- triton/runtime/tcc/include/tchar.h +1102 -0
- triton/runtime/tcc/include/tgmath.h +89 -0
- triton/runtime/tcc/include/time.h +287 -0
- triton/runtime/tcc/include/uchar.h +33 -0
- triton/runtime/tcc/include/unistd.h +1 -0
- triton/runtime/tcc/include/vadefs.h +11 -0
- triton/runtime/tcc/include/values.h +4 -0
- triton/runtime/tcc/include/varargs.h +12 -0
- triton/runtime/tcc/include/wchar.h +873 -0
- triton/runtime/tcc/include/wctype.h +172 -0
- triton/runtime/tcc/include/winapi/basetsd.h +149 -0
- triton/runtime/tcc/include/winapi/basetyps.h +85 -0
- triton/runtime/tcc/include/winapi/guiddef.h +156 -0
- triton/runtime/tcc/include/winapi/poppack.h +8 -0
- triton/runtime/tcc/include/winapi/pshpack1.h +8 -0
- triton/runtime/tcc/include/winapi/pshpack2.h +8 -0
- triton/runtime/tcc/include/winapi/pshpack4.h +8 -0
- triton/runtime/tcc/include/winapi/pshpack8.h +8 -0
- triton/runtime/tcc/include/winapi/qos.h +72 -0
- triton/runtime/tcc/include/winapi/shellapi.h +59 -0
- triton/runtime/tcc/include/winapi/winbase.h +2958 -0
- triton/runtime/tcc/include/winapi/wincon.h +309 -0
- triton/runtime/tcc/include/winapi/windef.h +293 -0
- triton/runtime/tcc/include/winapi/windows.h +127 -0
- triton/runtime/tcc/include/winapi/winerror.h +3166 -0
- triton/runtime/tcc/include/winapi/wingdi.h +4080 -0
- triton/runtime/tcc/include/winapi/winnls.h +778 -0
- triton/runtime/tcc/include/winapi/winnt.h +5837 -0
- triton/runtime/tcc/include/winapi/winreg.h +272 -0
- triton/runtime/tcc/include/winapi/winsock2.h +1474 -0
- triton/runtime/tcc/include/winapi/winuser.h +5651 -0
- triton/runtime/tcc/include/winapi/winver.h +160 -0
- triton/runtime/tcc/include/winapi/ws2ipdef.h +21 -0
- triton/runtime/tcc/include/winapi/ws2tcpip.h +391 -0
- triton/runtime/tcc/lib/cuda.def +697 -0
- triton/runtime/tcc/lib/gdi32.def +337 -0
- triton/runtime/tcc/lib/kernel32.def +770 -0
- triton/runtime/tcc/lib/libtcc1.a +0 -0
- triton/runtime/tcc/lib/msvcrt.def +1399 -0
- triton/runtime/tcc/lib/python3.def +810 -0
- triton/runtime/tcc/lib/python310.def +1610 -0
- triton/runtime/tcc/lib/python311.def +1633 -0
- triton/runtime/tcc/lib/python312.def +1703 -0
- triton/runtime/tcc/lib/python313.def +1651 -0
- triton/runtime/tcc/lib/python313t.def +1656 -0
- triton/runtime/tcc/lib/python314.def +1800 -0
- triton/runtime/tcc/lib/python314t.def +1809 -0
- triton/runtime/tcc/lib/python39.def +1644 -0
- triton/runtime/tcc/lib/python3t.def +905 -0
- triton/runtime/tcc/lib/user32.def +658 -0
- triton/runtime/tcc/libtcc.dll +0 -0
- triton/runtime/tcc/tcc.exe +0 -0
- triton/testing.py +543 -0
- triton/tools/__init__.py +0 -0
- triton/tools/build_extern.py +365 -0
- triton/tools/compile.py +210 -0
- triton/tools/disasm.py +143 -0
- triton/tools/extra/cuda/compile.c +70 -0
- triton/tools/extra/cuda/compile.h +14 -0
- triton/tools/extra/hip/compile.cpp +66 -0
- triton/tools/extra/hip/compile.h +13 -0
- triton/tools/link.py +322 -0
- triton/tools/mxfp.py +301 -0
- triton/tools/ragged_tma.py +92 -0
- triton/tools/tensor_descriptor.py +34 -0
- triton/windows_utils.py +405 -0
- triton_windows-3.5.1.post21.dist-info/METADATA +46 -0
- triton_windows-3.5.1.post21.dist-info/RECORD +217 -0
- triton_windows-3.5.1.post21.dist-info/WHEEL +5 -0
- triton_windows-3.5.1.post21.dist-info/entry_points.txt +3 -0
- triton_windows-3.5.1.post21.dist-info/licenses/LICENSE +23 -0
- triton_windows-3.5.1.post21.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file has no copyright assigned and is placed in the Public Domain.
|
|
3
|
+
* This file is part of the w64 mingw-runtime package.
|
|
4
|
+
* No warranty is given; refer to the file DISCLAIMER within this package.
|
|
5
|
+
*/
|
|
6
|
+
#ifndef _INC_SHARE
|
|
7
|
+
#define _INC_SHARE
|
|
8
|
+
|
|
9
|
+
#ifndef _WIN32
|
|
10
|
+
#error Only Win32 target is supported!
|
|
11
|
+
#endif
|
|
12
|
+
|
|
13
|
+
#define _SH_COMPAT 0x00
|
|
14
|
+
#define _SH_DENYRW 0x10
|
|
15
|
+
#define _SH_DENYWR 0x20
|
|
16
|
+
#define _SH_DENYRD 0x30
|
|
17
|
+
#define _SH_DENYNO 0x40
|
|
18
|
+
#define _SH_SECURE 0x80
|
|
19
|
+
|
|
20
|
+
#ifndef NO_OLDNAMES
|
|
21
|
+
#define SH_COMPAT _SH_COMPAT
|
|
22
|
+
#define SH_DENYRW _SH_DENYRW
|
|
23
|
+
#define SH_DENYWR _SH_DENYWR
|
|
24
|
+
#define SH_DENYRD _SH_DENYRD
|
|
25
|
+
#define SH_DENYNO _SH_DENYNO
|
|
26
|
+
#endif
|
|
27
|
+
|
|
28
|
+
#endif
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file has no copyright assigned and is placed in the Public Domain.
|
|
3
|
+
* This file is part of the w64 mingw-runtime package.
|
|
4
|
+
* No warranty is given; refer to the file DISCLAIMER within this package.
|
|
5
|
+
*/
|
|
6
|
+
#ifndef _INC_SIGNAL
|
|
7
|
+
#define _INC_SIGNAL
|
|
8
|
+
|
|
9
|
+
#include <_mingw.h>
|
|
10
|
+
|
|
11
|
+
#ifdef __cplusplus
|
|
12
|
+
extern "C" {
|
|
13
|
+
#endif
|
|
14
|
+
|
|
15
|
+
#ifndef _SIG_ATOMIC_T_DEFINED
|
|
16
|
+
#define _SIG_ATOMIC_T_DEFINED
|
|
17
|
+
typedef int sig_atomic_t;
|
|
18
|
+
#endif
|
|
19
|
+
|
|
20
|
+
#define NSIG 23
|
|
21
|
+
|
|
22
|
+
#define SIGHUP 1 /* hangup */
|
|
23
|
+
#define SIGINT 2
|
|
24
|
+
#define SIGQUIT 3 /* quit */
|
|
25
|
+
#define SIGILL 4
|
|
26
|
+
#define SIGTRAP 5 /* trace trap (not reset when caught) */
|
|
27
|
+
#define SIGIOT 6 /* IOT instruction */
|
|
28
|
+
#define SIGABRT 6 /* used by abort, replace SIGIOT in the future */
|
|
29
|
+
#define SIGEMT 7 /* EMT instruction */
|
|
30
|
+
#define SIGFPE 8
|
|
31
|
+
#define SIGKILL 9 /* kill (cannot be caught or ignored) */
|
|
32
|
+
#define SIGBUS 10 /* bus error */
|
|
33
|
+
#define SIGSEGV 11
|
|
34
|
+
#define SIGSYS 12 /* bad argument to system call */
|
|
35
|
+
#define SIGPIPE 13 /* write on a pipe with no one to read it */
|
|
36
|
+
#ifdef __USE_MINGW_ALARM
|
|
37
|
+
#define SIGALRM 14 /* alarm clock */
|
|
38
|
+
#endif
|
|
39
|
+
#define SIGTERM 15
|
|
40
|
+
#define SIGBREAK 21
|
|
41
|
+
#define SIGABRT2 22
|
|
42
|
+
|
|
43
|
+
#define SIGABRT_COMPAT 6
|
|
44
|
+
|
|
45
|
+
typedef void (*__p_sig_fn_t)(int);
|
|
46
|
+
|
|
47
|
+
#define SIG_DFL (__p_sig_fn_t)0
|
|
48
|
+
#define SIG_IGN (__p_sig_fn_t)1
|
|
49
|
+
#define SIG_GET (__p_sig_fn_t)2
|
|
50
|
+
#define SIG_SGE (__p_sig_fn_t)3
|
|
51
|
+
#define SIG_ACK (__p_sig_fn_t)4
|
|
52
|
+
#define SIG_ERR (__p_sig_fn_t)-1
|
|
53
|
+
|
|
54
|
+
extern void **__cdecl __pxcptinfoptrs(void);
|
|
55
|
+
#define _pxcptinfoptrs (*__pxcptinfoptrs())
|
|
56
|
+
|
|
57
|
+
__p_sig_fn_t __cdecl signal(int _SigNum,__p_sig_fn_t _Func);
|
|
58
|
+
int __cdecl raise(int _SigNum);
|
|
59
|
+
|
|
60
|
+
#ifdef __cplusplus
|
|
61
|
+
}
|
|
62
|
+
#endif
|
|
63
|
+
#endif
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#ifndef _STDALIGN_H
|
|
2
|
+
#define _STDALIGN_H
|
|
3
|
+
|
|
4
|
+
#if __STDC_VERSION__ < 201112L && (defined(__GNUC__) || defined(__TINYC__))
|
|
5
|
+
# define _Alignas(t) __attribute__((__aligned__(t)))
|
|
6
|
+
# define _Alignof(t) __alignof__(t)
|
|
7
|
+
#endif
|
|
8
|
+
|
|
9
|
+
#define alignas _Alignas
|
|
10
|
+
#define alignof _Alignof
|
|
11
|
+
|
|
12
|
+
#define __alignas_is_defined 1
|
|
13
|
+
#define __alignof_is_defined 1
|
|
14
|
+
|
|
15
|
+
#endif /* _STDALIGN_H */
|
|
16
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#ifndef _STDARG_H
|
|
2
|
+
#define _STDARG_H
|
|
3
|
+
|
|
4
|
+
typedef __builtin_va_list va_list;
|
|
5
|
+
#define va_start __builtin_va_start
|
|
6
|
+
#define va_arg __builtin_va_arg
|
|
7
|
+
#define va_copy __builtin_va_copy
|
|
8
|
+
#define va_end __builtin_va_end
|
|
9
|
+
|
|
10
|
+
/* fix a buggy dependency on GCC in libio.h */
|
|
11
|
+
typedef va_list __gnuc_va_list;
|
|
12
|
+
#define _VA_LIST_DEFINED
|
|
13
|
+
|
|
14
|
+
#endif /* _STDARG_H */
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/* This file is derived from clang's stdatomic.h */
|
|
2
|
+
|
|
3
|
+
/*===---- stdatomic.h - Standard header for atomic types and operations -----===
|
|
4
|
+
*
|
|
5
|
+
* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
6
|
+
* See https://llvm.org/LICENSE.txt for license information.
|
|
7
|
+
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
8
|
+
*
|
|
9
|
+
*===-----------------------------------------------------------------------===
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
#ifndef _STDATOMIC_H
|
|
13
|
+
#define _STDATOMIC_H
|
|
14
|
+
|
|
15
|
+
#include <stddef.h>
|
|
16
|
+
#include <stdint.h>
|
|
17
|
+
#include <stdbool.h>
|
|
18
|
+
|
|
19
|
+
#define __ATOMIC_RELAXED 0
|
|
20
|
+
#define __ATOMIC_CONSUME 1
|
|
21
|
+
#define __ATOMIC_ACQUIRE 2
|
|
22
|
+
#define __ATOMIC_RELEASE 3
|
|
23
|
+
#define __ATOMIC_ACQ_REL 4
|
|
24
|
+
#define __ATOMIC_SEQ_CST 5
|
|
25
|
+
|
|
26
|
+
/* Memory ordering */
|
|
27
|
+
typedef enum {
|
|
28
|
+
memory_order_relaxed = __ATOMIC_RELAXED,
|
|
29
|
+
memory_order_consume = __ATOMIC_CONSUME,
|
|
30
|
+
memory_order_acquire = __ATOMIC_ACQUIRE,
|
|
31
|
+
memory_order_release = __ATOMIC_RELEASE,
|
|
32
|
+
memory_order_acq_rel = __ATOMIC_ACQ_REL,
|
|
33
|
+
memory_order_seq_cst = __ATOMIC_SEQ_CST,
|
|
34
|
+
} memory_order;
|
|
35
|
+
|
|
36
|
+
/* Atomic typedefs */
|
|
37
|
+
typedef _Atomic(_Bool) atomic_bool;
|
|
38
|
+
typedef _Atomic(char) atomic_char;
|
|
39
|
+
typedef _Atomic(signed char) atomic_schar;
|
|
40
|
+
typedef _Atomic(unsigned char) atomic_uchar;
|
|
41
|
+
typedef _Atomic(short) atomic_short;
|
|
42
|
+
typedef _Atomic(unsigned short) atomic_ushort;
|
|
43
|
+
typedef _Atomic(int) atomic_int;
|
|
44
|
+
typedef _Atomic(unsigned int) atomic_uint;
|
|
45
|
+
typedef _Atomic(long) atomic_long;
|
|
46
|
+
typedef _Atomic(unsigned long) atomic_ulong;
|
|
47
|
+
typedef _Atomic(long long) atomic_llong;
|
|
48
|
+
typedef _Atomic(unsigned long long) atomic_ullong;
|
|
49
|
+
typedef _Atomic(uint_least16_t) atomic_char16_t;
|
|
50
|
+
typedef _Atomic(uint_least32_t) atomic_char32_t;
|
|
51
|
+
typedef _Atomic(wchar_t) atomic_wchar_t;
|
|
52
|
+
typedef _Atomic(int_least8_t) atomic_int_least8_t;
|
|
53
|
+
typedef _Atomic(uint_least8_t) atomic_uint_least8_t;
|
|
54
|
+
typedef _Atomic(int_least16_t) atomic_int_least16_t;
|
|
55
|
+
typedef _Atomic(uint_least16_t) atomic_uint_least16_t;
|
|
56
|
+
typedef _Atomic(int_least32_t) atomic_int_least32_t;
|
|
57
|
+
typedef _Atomic(uint_least32_t) atomic_uint_least32_t;
|
|
58
|
+
typedef _Atomic(int_least64_t) atomic_int_least64_t;
|
|
59
|
+
typedef _Atomic(uint_least64_t) atomic_uint_least64_t;
|
|
60
|
+
typedef _Atomic(int_fast8_t) atomic_int_fast8_t;
|
|
61
|
+
typedef _Atomic(uint_fast8_t) atomic_uint_fast8_t;
|
|
62
|
+
typedef _Atomic(int_fast16_t) atomic_int_fast16_t;
|
|
63
|
+
typedef _Atomic(uint_fast16_t) atomic_uint_fast16_t;
|
|
64
|
+
typedef _Atomic(int_fast32_t) atomic_int_fast32_t;
|
|
65
|
+
typedef _Atomic(uint_fast32_t) atomic_uint_fast32_t;
|
|
66
|
+
typedef _Atomic(int_fast64_t) atomic_int_fast64_t;
|
|
67
|
+
typedef _Atomic(uint_fast64_t) atomic_uint_fast64_t;
|
|
68
|
+
typedef _Atomic(intptr_t) atomic_intptr_t;
|
|
69
|
+
typedef _Atomic(uintptr_t) atomic_uintptr_t;
|
|
70
|
+
typedef _Atomic(size_t) atomic_size_t;
|
|
71
|
+
typedef _Atomic(ptrdiff_t) atomic_ptrdiff_t;
|
|
72
|
+
typedef _Atomic(intmax_t) atomic_intmax_t;
|
|
73
|
+
typedef _Atomic(uintmax_t) atomic_uintmax_t;
|
|
74
|
+
|
|
75
|
+
/* Atomic flag */
|
|
76
|
+
typedef struct {
|
|
77
|
+
atomic_bool value;
|
|
78
|
+
} atomic_flag;
|
|
79
|
+
|
|
80
|
+
#define ATOMIC_FLAG_INIT {0}
|
|
81
|
+
#define ATOMIC_VAR_INIT(value) (value)
|
|
82
|
+
|
|
83
|
+
/* Generic routines */
|
|
84
|
+
#define atomic_init(object, desired) \
|
|
85
|
+
atomic_store_explicit(object, desired, __ATOMIC_RELAXED)
|
|
86
|
+
|
|
87
|
+
#define __atomic_store_n(ptr, val, order) \
|
|
88
|
+
(*(ptr) = (val), __atomic_store((ptr), &(typeof(*(ptr))){val}, (order)))
|
|
89
|
+
#define atomic_store_explicit(object, desired, order) \
|
|
90
|
+
({ __typeof__ (object) ptr = (object); \
|
|
91
|
+
__typeof__ (*ptr) tmp = (desired); \
|
|
92
|
+
__atomic_store (ptr, &tmp, (order)); \
|
|
93
|
+
})
|
|
94
|
+
#define atomic_store(object, desired) \
|
|
95
|
+
atomic_store_explicit (object, desired, __ATOMIC_SEQ_CST)
|
|
96
|
+
|
|
97
|
+
#define __atomic_load_n(ptr, order) \
|
|
98
|
+
({ typeof(*(ptr)) __val; \
|
|
99
|
+
__atomic_load((ptr), &__val, (order)); \
|
|
100
|
+
__val; })
|
|
101
|
+
#define atomic_load_explicit(object, order) \
|
|
102
|
+
({ __typeof__ (object) ptr = (object); \
|
|
103
|
+
__typeof__ (*ptr) tmp; \
|
|
104
|
+
__atomic_load (ptr, &tmp, (order)); \
|
|
105
|
+
tmp; \
|
|
106
|
+
})
|
|
107
|
+
#define atomic_load(object) atomic_load_explicit (object, __ATOMIC_SEQ_CST)
|
|
108
|
+
|
|
109
|
+
#define atomic_exchange_explicit(object, desired, order) \
|
|
110
|
+
({ __typeof__ (object) ptr = (object); \
|
|
111
|
+
__typeof__ (*ptr) val = (desired); \
|
|
112
|
+
__typeof__ (*ptr) tmp; \
|
|
113
|
+
__atomic_exchange (ptr, &val, &tmp, (order)); \
|
|
114
|
+
tmp; \
|
|
115
|
+
})
|
|
116
|
+
#define atomic_exchange(object, desired) \
|
|
117
|
+
atomic_exchange_explicit (object, desired, __ATOMIC_SEQ_CST)
|
|
118
|
+
#define __atomic_compare_exchange_n(ptr, expected, desired, weak, success, failure) \
|
|
119
|
+
({ typeof(*(ptr)) __desired = (desired); \
|
|
120
|
+
__atomic_compare_exchange((ptr), (expected), &__desired, \
|
|
121
|
+
(weak), (success), (failure)); })
|
|
122
|
+
#define atomic_compare_exchange_strong_explicit(object, expected, desired, success, failure) \
|
|
123
|
+
({ __typeof__ (object) ptr = (object); \
|
|
124
|
+
__typeof__ (*ptr) tmp = desired; \
|
|
125
|
+
__atomic_compare_exchange(ptr, expected, &tmp, 0, success, failure); \
|
|
126
|
+
})
|
|
127
|
+
#define atomic_compare_exchange_strong(object, expected, desired) \
|
|
128
|
+
atomic_compare_exchange_strong_explicit (object, expected, desired, \
|
|
129
|
+
__ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)
|
|
130
|
+
#define atomic_compare_exchange_weak_explicit(object, expected, desired, success, failure) \
|
|
131
|
+
({ __typeof__ (object) ptr = (object); \
|
|
132
|
+
__typeof__ (*ptr) tmp = desired; \
|
|
133
|
+
__atomic_compare_exchange(ptr, expected, &tmp, 1, success, failure); \
|
|
134
|
+
})
|
|
135
|
+
#define atomic_compare_exchange_weak(object, expected, desired) \
|
|
136
|
+
atomic_compare_exchange_weak_explicit (object, expected, desired, \
|
|
137
|
+
__ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)
|
|
138
|
+
|
|
139
|
+
#define atomic_fetch_add(object, operand) \
|
|
140
|
+
__atomic_fetch_add(object, operand, __ATOMIC_SEQ_CST)
|
|
141
|
+
#define atomic_fetch_add_explicit __atomic_fetch_add
|
|
142
|
+
|
|
143
|
+
#define atomic_fetch_sub(object, operand) \
|
|
144
|
+
__atomic_fetch_sub(object, operand, __ATOMIC_SEQ_CST)
|
|
145
|
+
#define atomic_fetch_sub_explicit __atomic_fetch_sub
|
|
146
|
+
|
|
147
|
+
#define atomic_fetch_or(object, operand) \
|
|
148
|
+
__atomic_fetch_or(object, operand, __ATOMIC_SEQ_CST)
|
|
149
|
+
#define atomic_fetch_or_explicit __atomic_fetch_or
|
|
150
|
+
|
|
151
|
+
#define atomic_fetch_xor(object, operand) \
|
|
152
|
+
__atomic_fetch_xor(object, operand, __ATOMIC_SEQ_CST)
|
|
153
|
+
#define atomic_fetch_xor_explicit __atomic_fetch_xor
|
|
154
|
+
|
|
155
|
+
#define atomic_fetch_and(object, operand) \
|
|
156
|
+
__atomic_fetch_and(object, operand, __ATOMIC_SEQ_CST)
|
|
157
|
+
#define atomic_fetch_and_explicit __atomic_fetch_and
|
|
158
|
+
|
|
159
|
+
extern void atomic_thread_fence (memory_order);
|
|
160
|
+
#define __atomic_thread_fence(order) atomic_thread_fence (order)
|
|
161
|
+
extern void atomic_signal_fence (memory_order);
|
|
162
|
+
#define __atomic_signal_fence(order) atomic_signal_fence(order)
|
|
163
|
+
#define atomic_signal_fence(order) __atomic_signal_fence (order)
|
|
164
|
+
extern bool __atomic_is_lock_free(size_t size, void *ptr);
|
|
165
|
+
#define atomic_is_lock_free(OBJ) __atomic_is_lock_free (sizeof (*(OBJ)), (OBJ))
|
|
166
|
+
|
|
167
|
+
extern bool atomic_flag_test_and_set(void *object);
|
|
168
|
+
extern bool atomic_flag_test_and_set_explicit(void *object, memory_order order);
|
|
169
|
+
extern void atomic_flag_clear(void *object);
|
|
170
|
+
extern void atomic_flag_clear_explicit(void *object, memory_order order);
|
|
171
|
+
#endif /* _STDATOMIC_H */
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#ifndef _STDDEF_H
|
|
2
|
+
#define _STDDEF_H
|
|
3
|
+
#define _TINYC_STDDEF
|
|
4
|
+
|
|
5
|
+
typedef __SIZE_TYPE__ size_t;
|
|
6
|
+
typedef __PTRDIFF_TYPE__ ssize_t;
|
|
7
|
+
typedef __WCHAR_TYPE__ wchar_t;
|
|
8
|
+
typedef __PTRDIFF_TYPE__ ptrdiff_t;
|
|
9
|
+
typedef __PTRDIFF_TYPE__ intptr_t;
|
|
10
|
+
typedef __SIZE_TYPE__ uintptr_t;
|
|
11
|
+
|
|
12
|
+
#if __STDC_VERSION__ >= 201112L
|
|
13
|
+
typedef union { long long __ll; long double __ld; } max_align_t;
|
|
14
|
+
#endif
|
|
15
|
+
|
|
16
|
+
#ifndef NULL
|
|
17
|
+
#define NULL ((void*)0)
|
|
18
|
+
#endif
|
|
19
|
+
|
|
20
|
+
#undef offsetof
|
|
21
|
+
#define offsetof(type, field) __builtin_offsetof(type, field)
|
|
22
|
+
|
|
23
|
+
#if defined __i386__ || defined __x86_64__
|
|
24
|
+
void *alloca(size_t size);
|
|
25
|
+
#endif
|
|
26
|
+
|
|
27
|
+
#endif
|
|
28
|
+
|
|
29
|
+
/* Older glibc require a wint_t from <stddef.h> (when requested
|
|
30
|
+
by __need_wint_t, as otherwise stddef.h isn't allowed to
|
|
31
|
+
define this type). Note that this must be outside the normal
|
|
32
|
+
_STDDEF_H guard, so that it works even when we've included the file
|
|
33
|
+
already (without requiring wint_t). Some other libs define _WINT_T
|
|
34
|
+
if they've already provided that type, so we can use that as guard.
|
|
35
|
+
TCC defines __WINT_TYPE__ for us. */
|
|
36
|
+
#if defined (__need_wint_t)
|
|
37
|
+
#ifndef _WINT_T
|
|
38
|
+
#define _WINT_T
|
|
39
|
+
typedef __WINT_TYPE__ wint_t;
|
|
40
|
+
#endif
|
|
41
|
+
#undef __need_wint_t
|
|
42
|
+
#endif
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file has no copyright assigned and is placed in the Public Domain.
|
|
3
|
+
* This file is part of the w64 mingw-runtime package.
|
|
4
|
+
* No warranty is given; refer to the file DISCLAIMER within this package.
|
|
5
|
+
*/
|
|
6
|
+
/* ISO C9x 7.18 Integer types <stdint.h>
|
|
7
|
+
* Based on ISO/IEC SC22/WG14 9899 Committee draft (SC22 N2794)
|
|
8
|
+
*
|
|
9
|
+
* THIS SOFTWARE IS NOT COPYRIGHTED
|
|
10
|
+
*
|
|
11
|
+
* Contributor: Danny Smith <danny_r_smith_2001@yahoo.co.nz>
|
|
12
|
+
*
|
|
13
|
+
* This source code is offered for use in the public domain. You may
|
|
14
|
+
* use, modify or distribute it freely.
|
|
15
|
+
*
|
|
16
|
+
* This code is distributed in the hope that it will be useful but
|
|
17
|
+
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
|
18
|
+
* DISCLAIMED. This includes but is not limited to warranties of
|
|
19
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
20
|
+
*
|
|
21
|
+
* Date: 2000-12-02
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
#ifndef _STDINT_H
|
|
26
|
+
#define _STDINT_H
|
|
27
|
+
|
|
28
|
+
#include <_mingw.h>
|
|
29
|
+
|
|
30
|
+
#define __need_wint_t
|
|
31
|
+
#define __need_wchar_t
|
|
32
|
+
#include "stddef.h"
|
|
33
|
+
|
|
34
|
+
#ifndef __int8_t_defined
|
|
35
|
+
#define __int8_t_defined
|
|
36
|
+
/* 7.18.1.1 Exact-width integer types */
|
|
37
|
+
typedef signed char int8_t;
|
|
38
|
+
typedef unsigned char uint8_t;
|
|
39
|
+
typedef short int16_t;
|
|
40
|
+
typedef unsigned short uint16_t;
|
|
41
|
+
typedef int int32_t;
|
|
42
|
+
typedef unsigned uint32_t;
|
|
43
|
+
typedef long long int64_t;
|
|
44
|
+
typedef unsigned long long uint64_t;
|
|
45
|
+
#endif
|
|
46
|
+
|
|
47
|
+
/* 7.18.1.2 Minimum-width integer types */
|
|
48
|
+
typedef signed char int_least8_t;
|
|
49
|
+
typedef unsigned char uint_least8_t;
|
|
50
|
+
typedef short int_least16_t;
|
|
51
|
+
typedef unsigned short uint_least16_t;
|
|
52
|
+
typedef int int_least32_t;
|
|
53
|
+
typedef unsigned uint_least32_t;
|
|
54
|
+
typedef long long int_least64_t;
|
|
55
|
+
typedef unsigned long long uint_least64_t;
|
|
56
|
+
|
|
57
|
+
/* 7.18.1.3 Fastest minimum-width integer types
|
|
58
|
+
* Not actually guaranteed to be fastest for all purposes
|
|
59
|
+
* Here we use the exact-width types for 8 and 16-bit ints.
|
|
60
|
+
*/
|
|
61
|
+
typedef char int_fast8_t;
|
|
62
|
+
typedef unsigned char uint_fast8_t;
|
|
63
|
+
typedef short int_fast16_t;
|
|
64
|
+
typedef unsigned short uint_fast16_t;
|
|
65
|
+
typedef int int_fast32_t;
|
|
66
|
+
typedef unsigned int uint_fast32_t;
|
|
67
|
+
typedef long long int_fast64_t;
|
|
68
|
+
typedef unsigned long long uint_fast64_t;
|
|
69
|
+
|
|
70
|
+
/* 7.18.1.5 Greatest-width integer types */
|
|
71
|
+
typedef long long intmax_t;
|
|
72
|
+
typedef unsigned long long uintmax_t;
|
|
73
|
+
|
|
74
|
+
/* 7.18.2 Limits of specified-width integer types */
|
|
75
|
+
#if !defined ( __cplusplus) || defined (__STDC_LIMIT_MACROS)
|
|
76
|
+
|
|
77
|
+
/* 7.18.2.1 Limits of exact-width integer types */
|
|
78
|
+
#define INT8_MIN (-128)
|
|
79
|
+
#define INT16_MIN (-32768)
|
|
80
|
+
#define INT32_MIN (-2147483647 - 1)
|
|
81
|
+
#define INT64_MIN (-9223372036854775807LL - 1)
|
|
82
|
+
|
|
83
|
+
#define INT8_MAX 127
|
|
84
|
+
#define INT16_MAX 32767
|
|
85
|
+
#define INT32_MAX 2147483647
|
|
86
|
+
#define INT64_MAX 9223372036854775807LL
|
|
87
|
+
|
|
88
|
+
#define UINT8_MAX 0xff /* 255U */
|
|
89
|
+
#define UINT16_MAX 0xffff /* 65535U */
|
|
90
|
+
#define UINT32_MAX 0xffffffff /* 4294967295U */
|
|
91
|
+
#define UINT64_MAX 0xffffffffffffffffULL /* 18446744073709551615ULL */
|
|
92
|
+
|
|
93
|
+
/* 7.18.2.2 Limits of minimum-width integer types */
|
|
94
|
+
#define INT_LEAST8_MIN INT8_MIN
|
|
95
|
+
#define INT_LEAST16_MIN INT16_MIN
|
|
96
|
+
#define INT_LEAST32_MIN INT32_MIN
|
|
97
|
+
#define INT_LEAST64_MIN INT64_MIN
|
|
98
|
+
|
|
99
|
+
#define INT_LEAST8_MAX INT8_MAX
|
|
100
|
+
#define INT_LEAST16_MAX INT16_MAX
|
|
101
|
+
#define INT_LEAST32_MAX INT32_MAX
|
|
102
|
+
#define INT_LEAST64_MAX INT64_MAX
|
|
103
|
+
|
|
104
|
+
#define UINT_LEAST8_MAX UINT8_MAX
|
|
105
|
+
#define UINT_LEAST16_MAX UINT16_MAX
|
|
106
|
+
#define UINT_LEAST32_MAX UINT32_MAX
|
|
107
|
+
#define UINT_LEAST64_MAX UINT64_MAX
|
|
108
|
+
|
|
109
|
+
/* 7.18.2.3 Limits of fastest minimum-width integer types */
|
|
110
|
+
#define INT_FAST8_MIN INT8_MIN
|
|
111
|
+
#define INT_FAST16_MIN INT16_MIN
|
|
112
|
+
#define INT_FAST32_MIN INT32_MIN
|
|
113
|
+
#define INT_FAST64_MIN INT64_MIN
|
|
114
|
+
|
|
115
|
+
#define INT_FAST8_MAX INT8_MAX
|
|
116
|
+
#define INT_FAST16_MAX INT16_MAX
|
|
117
|
+
#define INT_FAST32_MAX INT32_MAX
|
|
118
|
+
#define INT_FAST64_MAX INT64_MAX
|
|
119
|
+
|
|
120
|
+
#define UINT_FAST8_MAX UINT8_MAX
|
|
121
|
+
#define UINT_FAST16_MAX UINT16_MAX
|
|
122
|
+
#define UINT_FAST32_MAX UINT32_MAX
|
|
123
|
+
#define UINT_FAST64_MAX UINT64_MAX
|
|
124
|
+
|
|
125
|
+
/* 7.18.2.4 Limits of integer types capable of holding
|
|
126
|
+
object pointers */
|
|
127
|
+
#ifdef _WIN64
|
|
128
|
+
#define INTPTR_MIN INT64_MIN
|
|
129
|
+
#define INTPTR_MAX INT64_MAX
|
|
130
|
+
#define UINTPTR_MAX UINT64_MAX
|
|
131
|
+
#else
|
|
132
|
+
#define INTPTR_MIN INT32_MIN
|
|
133
|
+
#define INTPTR_MAX INT32_MAX
|
|
134
|
+
#define UINTPTR_MAX UINT32_MAX
|
|
135
|
+
#endif
|
|
136
|
+
|
|
137
|
+
/* 7.18.2.5 Limits of greatest-width integer types */
|
|
138
|
+
#define INTMAX_MIN INT64_MIN
|
|
139
|
+
#define INTMAX_MAX INT64_MAX
|
|
140
|
+
#define UINTMAX_MAX UINT64_MAX
|
|
141
|
+
|
|
142
|
+
/* 7.18.3 Limits of other integer types */
|
|
143
|
+
#ifdef _WIN64
|
|
144
|
+
#define PTRDIFF_MIN INT64_MIN
|
|
145
|
+
#define PTRDIFF_MAX INT64_MAX
|
|
146
|
+
#else
|
|
147
|
+
#define PTRDIFF_MIN INT32_MIN
|
|
148
|
+
#define PTRDIFF_MAX INT32_MAX
|
|
149
|
+
#endif
|
|
150
|
+
|
|
151
|
+
#define SIG_ATOMIC_MIN INT32_MIN
|
|
152
|
+
#define SIG_ATOMIC_MAX INT32_MAX
|
|
153
|
+
|
|
154
|
+
#ifndef SIZE_MAX
|
|
155
|
+
#ifdef _WIN64
|
|
156
|
+
#define SIZE_MAX UINT64_MAX
|
|
157
|
+
#else
|
|
158
|
+
#define SIZE_MAX UINT32_MAX
|
|
159
|
+
#endif
|
|
160
|
+
#endif
|
|
161
|
+
|
|
162
|
+
#ifndef WCHAR_MIN /* also in wchar.h */
|
|
163
|
+
#define WCHAR_MIN 0
|
|
164
|
+
#define WCHAR_MAX ((wchar_t)-1) /* UINT16_MAX */
|
|
165
|
+
#endif
|
|
166
|
+
|
|
167
|
+
/*
|
|
168
|
+
* wint_t is unsigned short for compatibility with MS runtime
|
|
169
|
+
*/
|
|
170
|
+
#define WINT_MIN 0
|
|
171
|
+
#define WINT_MAX ((wint_t)-1) /* UINT16_MAX */
|
|
172
|
+
|
|
173
|
+
#endif /* !defined ( __cplusplus) || defined __STDC_LIMIT_MACROS */
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
/* 7.18.4 Macros for integer constants */
|
|
177
|
+
#if !defined ( __cplusplus) || defined (__STDC_CONSTANT_MACROS)
|
|
178
|
+
|
|
179
|
+
/* 7.18.4.1 Macros for minimum-width integer constants
|
|
180
|
+
|
|
181
|
+
According to Douglas Gwyn <gwyn@arl.mil>:
|
|
182
|
+
"This spec was changed in ISO/IEC 9899:1999 TC1; in ISO/IEC
|
|
183
|
+
9899:1999 as initially published, the expansion was required
|
|
184
|
+
to be an integer constant of precisely matching type, which
|
|
185
|
+
is impossible to accomplish for the shorter types on most
|
|
186
|
+
platforms, because C99 provides no standard way to designate
|
|
187
|
+
an integer constant with width less than that of type int.
|
|
188
|
+
TC1 changed this to require just an integer constant
|
|
189
|
+
*expression* with *promoted* type."
|
|
190
|
+
|
|
191
|
+
The trick used here is from Clive D W Feather.
|
|
192
|
+
*/
|
|
193
|
+
|
|
194
|
+
#define INT8_C(val) (INT_LEAST8_MAX-INT_LEAST8_MAX+(val))
|
|
195
|
+
#define INT16_C(val) (INT_LEAST16_MAX-INT_LEAST16_MAX+(val))
|
|
196
|
+
#define INT32_C(val) (INT_LEAST32_MAX-INT_LEAST32_MAX+(val))
|
|
197
|
+
/* The 'trick' doesn't work in C89 for long long because, without
|
|
198
|
+
suffix, (val) will be evaluated as int, not intmax_t */
|
|
199
|
+
#define INT64_C(val) val##LL
|
|
200
|
+
|
|
201
|
+
#define UINT8_C(val) (UINT_LEAST8_MAX-UINT_LEAST8_MAX+(val))
|
|
202
|
+
#define UINT16_C(val) (UINT_LEAST16_MAX-UINT_LEAST16_MAX+(val))
|
|
203
|
+
#define UINT32_C(val) (UINT_LEAST32_MAX-UINT_LEAST32_MAX+(val))
|
|
204
|
+
#define UINT64_C(val) val##ULL
|
|
205
|
+
|
|
206
|
+
/* 7.18.4.2 Macros for greatest-width integer constants */
|
|
207
|
+
#define INTMAX_C(val) val##LL
|
|
208
|
+
#define UINTMAX_C(val) val##ULL
|
|
209
|
+
|
|
210
|
+
#endif /* !defined ( __cplusplus) || defined __STDC_CONSTANT_MACROS */
|
|
211
|
+
|
|
212
|
+
#endif
|