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.
Files changed (217) hide show
  1. triton/_C/libtriton.pyd +0 -0
  2. triton/__init__.py +82 -0
  3. triton/_filecheck.py +97 -0
  4. triton/_internal_testing.py +255 -0
  5. triton/_utils.py +126 -0
  6. triton/backends/__init__.py +47 -0
  7. triton/backends/amd/__init__.py +0 -0
  8. triton/backends/amd/compiler.py +461 -0
  9. triton/backends/amd/driver.c +283 -0
  10. triton/backends/amd/driver.py +724 -0
  11. triton/backends/amd/lib/asanrtl.bc +0 -0
  12. triton/backends/amd/lib/ockl.bc +0 -0
  13. triton/backends/amd/lib/ocml.bc +0 -0
  14. triton/backends/compiler.py +90 -0
  15. triton/backends/driver.py +66 -0
  16. triton/backends/nvidia/__init__.py +0 -0
  17. triton/backends/nvidia/bin/ptxas.exe +0 -0
  18. triton/backends/nvidia/compiler.py +533 -0
  19. triton/backends/nvidia/driver.c +517 -0
  20. triton/backends/nvidia/driver.py +799 -0
  21. triton/backends/nvidia/include/cuda.h +26280 -0
  22. triton/backends/nvidia/lib/libdevice.10.bc +0 -0
  23. triton/backends/nvidia/lib/x64/cuda.lib +0 -0
  24. triton/compiler/__init__.py +7 -0
  25. triton/compiler/code_generator.py +1614 -0
  26. triton/compiler/compiler.py +509 -0
  27. triton/compiler/errors.py +51 -0
  28. triton/compiler/make_launcher.py +0 -0
  29. triton/errors.py +5 -0
  30. triton/experimental/__init__.py +0 -0
  31. triton/experimental/gluon/__init__.py +5 -0
  32. triton/experimental/gluon/_compiler.py +0 -0
  33. triton/experimental/gluon/_runtime.py +102 -0
  34. triton/experimental/gluon/language/__init__.py +119 -0
  35. triton/experimental/gluon/language/_core.py +490 -0
  36. triton/experimental/gluon/language/_layouts.py +583 -0
  37. triton/experimental/gluon/language/_math.py +20 -0
  38. triton/experimental/gluon/language/_semantic.py +380 -0
  39. triton/experimental/gluon/language/_standard.py +80 -0
  40. triton/experimental/gluon/language/amd/__init__.py +4 -0
  41. triton/experimental/gluon/language/amd/_layouts.py +96 -0
  42. triton/experimental/gluon/language/amd/cdna3/__init__.py +100 -0
  43. triton/experimental/gluon/language/amd/cdna4/__init__.py +48 -0
  44. triton/experimental/gluon/language/amd/cdna4/async_copy.py +151 -0
  45. triton/experimental/gluon/language/extra/__init__.py +3 -0
  46. triton/experimental/gluon/language/nvidia/__init__.py +4 -0
  47. triton/experimental/gluon/language/nvidia/ampere/__init__.py +3 -0
  48. triton/experimental/gluon/language/nvidia/ampere/async_copy.py +74 -0
  49. triton/experimental/gluon/language/nvidia/ampere/mbarrier.py +80 -0
  50. triton/experimental/gluon/language/nvidia/blackwell/__init__.py +387 -0
  51. triton/experimental/gluon/language/nvidia/blackwell/tma.py +52 -0
  52. triton/experimental/gluon/language/nvidia/hopper/__init__.py +132 -0
  53. triton/experimental/gluon/language/nvidia/hopper/mbarrier.py +34 -0
  54. triton/experimental/gluon/language/nvidia/hopper/tma.py +97 -0
  55. triton/experimental/gluon/nvidia/__init__.py +4 -0
  56. triton/experimental/gluon/nvidia/blackwell.py +3 -0
  57. triton/experimental/gluon/nvidia/hopper.py +45 -0
  58. triton/knobs.py +546 -0
  59. triton/language/__init__.py +342 -0
  60. triton/language/core.py +3405 -0
  61. triton/language/extra/__init__.py +26 -0
  62. triton/language/extra/cuda/__init__.py +16 -0
  63. triton/language/extra/cuda/gdc.py +42 -0
  64. triton/language/extra/cuda/libdevice.py +1629 -0
  65. triton/language/extra/cuda/utils.py +109 -0
  66. triton/language/extra/hip/__init__.py +5 -0
  67. triton/language/extra/hip/libdevice.py +491 -0
  68. triton/language/extra/hip/utils.py +35 -0
  69. triton/language/extra/libdevice.py +790 -0
  70. triton/language/math.py +249 -0
  71. triton/language/random.py +218 -0
  72. triton/language/semantic.py +1939 -0
  73. triton/language/standard.py +534 -0
  74. triton/language/target_info.py +54 -0
  75. triton/runtime/__init__.py +23 -0
  76. triton/runtime/_allocation.py +44 -0
  77. triton/runtime/_async_compile.py +55 -0
  78. triton/runtime/autotuner.py +476 -0
  79. triton/runtime/build.py +168 -0
  80. triton/runtime/cache.py +317 -0
  81. triton/runtime/driver.py +38 -0
  82. triton/runtime/errors.py +36 -0
  83. triton/runtime/interpreter.py +1414 -0
  84. triton/runtime/jit.py +1107 -0
  85. triton/runtime/tcc/include/_mingw.h +168 -0
  86. triton/runtime/tcc/include/assert.h +62 -0
  87. triton/runtime/tcc/include/conio.h +409 -0
  88. triton/runtime/tcc/include/ctype.h +281 -0
  89. triton/runtime/tcc/include/dir.h +31 -0
  90. triton/runtime/tcc/include/direct.h +68 -0
  91. triton/runtime/tcc/include/dirent.h +135 -0
  92. triton/runtime/tcc/include/dos.h +55 -0
  93. triton/runtime/tcc/include/errno.h +75 -0
  94. triton/runtime/tcc/include/excpt.h +123 -0
  95. triton/runtime/tcc/include/fcntl.h +52 -0
  96. triton/runtime/tcc/include/fenv.h +108 -0
  97. triton/runtime/tcc/include/float.h +75 -0
  98. triton/runtime/tcc/include/inttypes.h +297 -0
  99. triton/runtime/tcc/include/io.h +418 -0
  100. triton/runtime/tcc/include/iso646.h +36 -0
  101. triton/runtime/tcc/include/limits.h +116 -0
  102. triton/runtime/tcc/include/locale.h +91 -0
  103. triton/runtime/tcc/include/malloc.h +181 -0
  104. triton/runtime/tcc/include/math.h +497 -0
  105. triton/runtime/tcc/include/mem.h +13 -0
  106. triton/runtime/tcc/include/memory.h +40 -0
  107. triton/runtime/tcc/include/process.h +176 -0
  108. triton/runtime/tcc/include/sec_api/conio_s.h +42 -0
  109. triton/runtime/tcc/include/sec_api/crtdbg_s.h +19 -0
  110. triton/runtime/tcc/include/sec_api/io_s.h +33 -0
  111. triton/runtime/tcc/include/sec_api/mbstring_s.h +52 -0
  112. triton/runtime/tcc/include/sec_api/search_s.h +25 -0
  113. triton/runtime/tcc/include/sec_api/stdio_s.h +145 -0
  114. triton/runtime/tcc/include/sec_api/stdlib_s.h +67 -0
  115. triton/runtime/tcc/include/sec_api/stralign_s.h +30 -0
  116. triton/runtime/tcc/include/sec_api/string_s.h +41 -0
  117. triton/runtime/tcc/include/sec_api/sys/timeb_s.h +34 -0
  118. triton/runtime/tcc/include/sec_api/tchar_s.h +266 -0
  119. triton/runtime/tcc/include/sec_api/time_s.h +61 -0
  120. triton/runtime/tcc/include/sec_api/wchar_s.h +128 -0
  121. triton/runtime/tcc/include/setjmp.h +160 -0
  122. triton/runtime/tcc/include/share.h +28 -0
  123. triton/runtime/tcc/include/signal.h +63 -0
  124. triton/runtime/tcc/include/stdalign.h +16 -0
  125. triton/runtime/tcc/include/stdarg.h +14 -0
  126. triton/runtime/tcc/include/stdatomic.h +171 -0
  127. triton/runtime/tcc/include/stdbool.h +11 -0
  128. triton/runtime/tcc/include/stddef.h +42 -0
  129. triton/runtime/tcc/include/stdint.h +212 -0
  130. triton/runtime/tcc/include/stdio.h +429 -0
  131. triton/runtime/tcc/include/stdlib.h +591 -0
  132. triton/runtime/tcc/include/stdnoreturn.h +7 -0
  133. triton/runtime/tcc/include/string.h +164 -0
  134. triton/runtime/tcc/include/sys/fcntl.h +13 -0
  135. triton/runtime/tcc/include/sys/file.h +14 -0
  136. triton/runtime/tcc/include/sys/locking.h +30 -0
  137. triton/runtime/tcc/include/sys/stat.h +290 -0
  138. triton/runtime/tcc/include/sys/time.h +69 -0
  139. triton/runtime/tcc/include/sys/timeb.h +133 -0
  140. triton/runtime/tcc/include/sys/types.h +123 -0
  141. triton/runtime/tcc/include/sys/unistd.h +14 -0
  142. triton/runtime/tcc/include/sys/utime.h +146 -0
  143. triton/runtime/tcc/include/tcc/tcc_libm.h +618 -0
  144. triton/runtime/tcc/include/tccdefs.h +342 -0
  145. triton/runtime/tcc/include/tcclib.h +80 -0
  146. triton/runtime/tcc/include/tchar.h +1102 -0
  147. triton/runtime/tcc/include/tgmath.h +89 -0
  148. triton/runtime/tcc/include/time.h +287 -0
  149. triton/runtime/tcc/include/uchar.h +33 -0
  150. triton/runtime/tcc/include/unistd.h +1 -0
  151. triton/runtime/tcc/include/vadefs.h +11 -0
  152. triton/runtime/tcc/include/values.h +4 -0
  153. triton/runtime/tcc/include/varargs.h +12 -0
  154. triton/runtime/tcc/include/wchar.h +873 -0
  155. triton/runtime/tcc/include/wctype.h +172 -0
  156. triton/runtime/tcc/include/winapi/basetsd.h +149 -0
  157. triton/runtime/tcc/include/winapi/basetyps.h +85 -0
  158. triton/runtime/tcc/include/winapi/guiddef.h +156 -0
  159. triton/runtime/tcc/include/winapi/poppack.h +8 -0
  160. triton/runtime/tcc/include/winapi/pshpack1.h +8 -0
  161. triton/runtime/tcc/include/winapi/pshpack2.h +8 -0
  162. triton/runtime/tcc/include/winapi/pshpack4.h +8 -0
  163. triton/runtime/tcc/include/winapi/pshpack8.h +8 -0
  164. triton/runtime/tcc/include/winapi/qos.h +72 -0
  165. triton/runtime/tcc/include/winapi/shellapi.h +59 -0
  166. triton/runtime/tcc/include/winapi/winbase.h +2958 -0
  167. triton/runtime/tcc/include/winapi/wincon.h +309 -0
  168. triton/runtime/tcc/include/winapi/windef.h +293 -0
  169. triton/runtime/tcc/include/winapi/windows.h +127 -0
  170. triton/runtime/tcc/include/winapi/winerror.h +3166 -0
  171. triton/runtime/tcc/include/winapi/wingdi.h +4080 -0
  172. triton/runtime/tcc/include/winapi/winnls.h +778 -0
  173. triton/runtime/tcc/include/winapi/winnt.h +5837 -0
  174. triton/runtime/tcc/include/winapi/winreg.h +272 -0
  175. triton/runtime/tcc/include/winapi/winsock2.h +1474 -0
  176. triton/runtime/tcc/include/winapi/winuser.h +5651 -0
  177. triton/runtime/tcc/include/winapi/winver.h +160 -0
  178. triton/runtime/tcc/include/winapi/ws2ipdef.h +21 -0
  179. triton/runtime/tcc/include/winapi/ws2tcpip.h +391 -0
  180. triton/runtime/tcc/lib/cuda.def +697 -0
  181. triton/runtime/tcc/lib/gdi32.def +337 -0
  182. triton/runtime/tcc/lib/kernel32.def +770 -0
  183. triton/runtime/tcc/lib/libtcc1.a +0 -0
  184. triton/runtime/tcc/lib/msvcrt.def +1399 -0
  185. triton/runtime/tcc/lib/python3.def +810 -0
  186. triton/runtime/tcc/lib/python310.def +1610 -0
  187. triton/runtime/tcc/lib/python311.def +1633 -0
  188. triton/runtime/tcc/lib/python312.def +1703 -0
  189. triton/runtime/tcc/lib/python313.def +1651 -0
  190. triton/runtime/tcc/lib/python313t.def +1656 -0
  191. triton/runtime/tcc/lib/python314.def +1800 -0
  192. triton/runtime/tcc/lib/python314t.def +1809 -0
  193. triton/runtime/tcc/lib/python39.def +1644 -0
  194. triton/runtime/tcc/lib/python3t.def +905 -0
  195. triton/runtime/tcc/lib/user32.def +658 -0
  196. triton/runtime/tcc/libtcc.dll +0 -0
  197. triton/runtime/tcc/tcc.exe +0 -0
  198. triton/testing.py +543 -0
  199. triton/tools/__init__.py +0 -0
  200. triton/tools/build_extern.py +365 -0
  201. triton/tools/compile.py +210 -0
  202. triton/tools/disasm.py +143 -0
  203. triton/tools/extra/cuda/compile.c +70 -0
  204. triton/tools/extra/cuda/compile.h +14 -0
  205. triton/tools/extra/hip/compile.cpp +66 -0
  206. triton/tools/extra/hip/compile.h +13 -0
  207. triton/tools/link.py +322 -0
  208. triton/tools/mxfp.py +301 -0
  209. triton/tools/ragged_tma.py +92 -0
  210. triton/tools/tensor_descriptor.py +34 -0
  211. triton/windows_utils.py +405 -0
  212. triton_windows-3.5.1.post21.dist-info/METADATA +46 -0
  213. triton_windows-3.5.1.post21.dist-info/RECORD +217 -0
  214. triton_windows-3.5.1.post21.dist-info/WHEEL +5 -0
  215. triton_windows-3.5.1.post21.dist-info/entry_points.txt +3 -0
  216. triton_windows-3.5.1.post21.dist-info/licenses/LICENSE +23 -0
  217. triton_windows-3.5.1.post21.dist-info/top_level.txt +1 -0
@@ -0,0 +1,123 @@
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_EXCPT
7
+ #define _INC_EXCPT
8
+
9
+ #include <_mingw.h>
10
+
11
+ #pragma pack(push,_CRT_PACKING)
12
+
13
+ #ifdef __cplusplus
14
+ extern "C" {
15
+ #endif
16
+
17
+ struct _EXCEPTION_POINTERS;
18
+
19
+ #ifndef EXCEPTION_DISPOSITION
20
+ #define EXCEPTION_DISPOSITION int
21
+ #endif
22
+ #define ExceptionContinueExecution 0
23
+ #define ExceptionContinueSearch 1
24
+ #define ExceptionNestedException 2
25
+ #define ExceptionCollidedUnwind 3
26
+
27
+ #if (defined(_X86_) && !defined(__x86_64))
28
+ struct _EXCEPTION_RECORD;
29
+ struct _CONTEXT;
30
+
31
+ EXCEPTION_DISPOSITION __cdecl _except_handler(struct _EXCEPTION_RECORD *_ExceptionRecord,void *_EstablisherFrame,struct _CONTEXT *_ContextRecord,void *_DispatcherContext);
32
+ #elif defined(__ia64__)
33
+
34
+ typedef struct _EXCEPTION_POINTERS *Exception_info_ptr;
35
+ struct _EXCEPTION_RECORD;
36
+ struct _CONTEXT;
37
+ struct _DISPATCHER_CONTEXT;
38
+
39
+ _CRTIMP EXCEPTION_DISPOSITION __cdecl __C_specific_handler (struct _EXCEPTION_RECORD *_ExceptionRecord,unsigned __int64 _MemoryStackFp,unsigned __int64 _BackingStoreFp,struct _CONTEXT *_ContextRecord,struct _DISPATCHER_CONTEXT *_DispatcherContext,unsigned __int64 _GlobalPointer);
40
+ #elif defined(__x86_64)
41
+
42
+ struct _EXCEPTION_RECORD;
43
+ struct _CONTEXT;
44
+ #endif
45
+
46
+ #define GetExceptionCode _exception_code
47
+ #define exception_code _exception_code
48
+ #define GetExceptionInformation (struct _EXCEPTION_POINTERS *)_exception_info
49
+ #define exception_info (struct _EXCEPTION_POINTERS *)_exception_info
50
+ #define AbnormalTermination _abnormal_termination
51
+ #define abnormal_termination _abnormal_termination
52
+
53
+ unsigned long __cdecl _exception_code(void);
54
+ void *__cdecl _exception_info(void);
55
+ int __cdecl _abnormal_termination(void);
56
+
57
+ #define EXCEPTION_EXECUTE_HANDLER 1
58
+ #define EXCEPTION_CONTINUE_SEARCH 0
59
+ #define EXCEPTION_CONTINUE_EXECUTION -1
60
+
61
+ /* CRT stuff */
62
+ typedef void (__cdecl * _PHNDLR)(int);
63
+
64
+ struct _XCPT_ACTION {
65
+ unsigned long XcptNum;
66
+ int SigNum;
67
+ _PHNDLR XcptAction;
68
+ };
69
+
70
+ extern struct _XCPT_ACTION _XcptActTab[];
71
+ extern int _XcptActTabCount;
72
+ extern int _XcptActTabSize;
73
+ extern int _First_FPE_Indx;
74
+ extern int _Num_FPE;
75
+
76
+ int __cdecl __CppXcptFilter(unsigned long _ExceptionNum,struct _EXCEPTION_POINTERS * _ExceptionPtr);
77
+ int __cdecl _XcptFilter(unsigned long _ExceptionNum,struct _EXCEPTION_POINTERS * _ExceptionPtr);
78
+
79
+ /*
80
+ * The type of function that is expected as an exception handler to be
81
+ * installed with _try1.
82
+ */
83
+ typedef EXCEPTION_DISPOSITION (*PEXCEPTION_HANDLER)(struct _EXCEPTION_RECORD*, void*, struct _CONTEXT*, void*);
84
+
85
+ #ifndef HAVE_NO_SEH
86
+ /*
87
+ * This is not entirely necessary, but it is the structure installed by
88
+ * the _try1 primitive below.
89
+ */
90
+ typedef struct _EXCEPTION_REGISTRATION {
91
+ struct _EXCEPTION_REGISTRATION *prev;
92
+ EXCEPTION_DISPOSITION (*handler)(struct _EXCEPTION_RECORD*, void*, struct _CONTEXT*, void*);
93
+ } EXCEPTION_REGISTRATION, *PEXCEPTION_REGISTRATION;
94
+
95
+ typedef EXCEPTION_REGISTRATION EXCEPTION_REGISTRATION_RECORD;
96
+ typedef PEXCEPTION_REGISTRATION PEXCEPTION_REGISTRATION_RECORD;
97
+ #endif
98
+
99
+ #if (defined(_X86_) && !defined(__x86_64))
100
+ #define __try1(pHandler) \
101
+ __asm__ ("pushl %0;pushl %%fs:0;movl %%esp,%%fs:0;" : : "g" (pHandler));
102
+
103
+ #define __except1 \
104
+ __asm__ ("movl (%%esp),%%eax;movl %%eax,%%fs:0;addl $8,%%esp;" \
105
+ : : : "%eax");
106
+ #elif defined(__x86_64)
107
+ #define __try1(pHandler) \
108
+ __asm__ ("pushq %0;pushq %%gs:0;movq %%rsp,%%gs:0;" : : "g" (pHandler));
109
+
110
+ #define __except1 \
111
+ __asm__ ("movq (%%rsp),%%rax;movq %%rax,%%gs:0;addq $16,%%rsp;" \
112
+ : : : "%rax");
113
+ #else
114
+ #define __try1(pHandler)
115
+ #define __except1
116
+ #endif
117
+
118
+ #ifdef __cplusplus
119
+ }
120
+ #endif
121
+
122
+ #pragma pack(pop)
123
+ #endif
@@ -0,0 +1,52 @@
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
+ #include <_mingw.h>
7
+
8
+ #include <io.h>
9
+
10
+ #ifndef _INC_FCNTL
11
+ #define _INC_FCNTL
12
+
13
+ #define _O_RDONLY 0x0000
14
+ #define _O_WRONLY 0x0001
15
+ #define _O_RDWR 0x0002
16
+ #define _O_APPEND 0x0008
17
+ #define _O_CREAT 0x0100
18
+ #define _O_TRUNC 0x0200
19
+ #define _O_EXCL 0x0400
20
+ #define _O_TEXT 0x4000
21
+ #define _O_BINARY 0x8000
22
+ #define _O_WTEXT 0x10000
23
+ #define _O_U16TEXT 0x20000
24
+ #define _O_U8TEXT 0x40000
25
+ #define _O_ACCMODE (_O_RDONLY|_O_WRONLY|_O_RDWR)
26
+
27
+ #define _O_RAW _O_BINARY
28
+ #define _O_NOINHERIT 0x0080
29
+ #define _O_TEMPORARY 0x0040
30
+ #define _O_SHORT_LIVED 0x1000
31
+
32
+ #define _O_SEQUENTIAL 0x0020
33
+ #define _O_RANDOM 0x0010
34
+
35
+ #if !defined(NO_OLDNAMES) || defined(_POSIX)
36
+ #define O_RDONLY _O_RDONLY
37
+ #define O_WRONLY _O_WRONLY
38
+ #define O_RDWR _O_RDWR
39
+ #define O_APPEND _O_APPEND
40
+ #define O_CREAT _O_CREAT
41
+ #define O_TRUNC _O_TRUNC
42
+ #define O_EXCL _O_EXCL
43
+ #define O_TEXT _O_TEXT
44
+ #define O_BINARY _O_BINARY
45
+ #define O_RAW _O_BINARY
46
+ #define O_TEMPORARY _O_TEMPORARY
47
+ #define O_NOINHERIT _O_NOINHERIT
48
+ #define O_SEQUENTIAL _O_SEQUENTIAL
49
+ #define O_RANDOM _O_RANDOM
50
+ #define O_ACCMODE _O_ACCMODE
51
+ #endif
52
+ #endif
@@ -0,0 +1,108 @@
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 _FENV_H_
7
+ #define _FENV_H_
8
+
9
+ #include <_mingw.h>
10
+
11
+ /* FPU status word exception flags */
12
+ #define FE_INVALID 0x01
13
+ #define FE_DENORMAL 0x02
14
+ #define FE_DIVBYZERO 0x04
15
+ #define FE_OVERFLOW 0x08
16
+ #define FE_UNDERFLOW 0x10
17
+ #define FE_INEXACT 0x20
18
+ #define FE_ALL_EXCEPT (FE_INVALID | FE_DENORMAL | FE_DIVBYZERO \
19
+ | FE_OVERFLOW | FE_UNDERFLOW | FE_INEXACT)
20
+
21
+ /* FPU control word rounding flags */
22
+ #define FE_TONEAREST 0x0000
23
+ #define FE_DOWNWARD 0x0400
24
+ #define FE_UPWARD 0x0800
25
+ #define FE_TOWARDZERO 0x0c00
26
+
27
+ /* The MXCSR exception flags are the same as the
28
+ FE flags. */
29
+ #define __MXCSR_EXCEPT_FLAG_SHIFT 0
30
+
31
+ /* How much to shift FE status word exception flags
32
+ to get MXCSR rounding flags, */
33
+ #define __MXCSR_ROUND_FLAG_SHIFT 3
34
+
35
+ #ifndef RC_INVOKED
36
+ /*
37
+ For now, support only for the basic abstraction of flags that are
38
+ either set or clear. fexcept_t could be structure that holds more
39
+ info about the fp environment.
40
+ */
41
+ typedef unsigned short fexcept_t;
42
+
43
+ /* This 32-byte struct represents the entire floating point
44
+ environment as stored by fnstenv or fstenv, augmented by
45
+ the contents of the MXCSR register, as stored by stmxcsr
46
+ (if CPU supports it). */
47
+ typedef struct
48
+ {
49
+ unsigned short __control_word;
50
+ unsigned short __unused0;
51
+ unsigned short __status_word;
52
+ unsigned short __unused1;
53
+ unsigned short __tag_word;
54
+ unsigned short __unused2;
55
+ unsigned int __ip_offset; /* instruction pointer offset */
56
+ unsigned short __ip_selector;
57
+ unsigned short __opcode;
58
+ unsigned int __data_offset;
59
+ unsigned short __data_selector;
60
+ unsigned short __unused3;
61
+ unsigned int __mxcsr; /* contents of the MXCSR register */
62
+ } fenv_t;
63
+
64
+
65
+ /*The C99 standard (7.6.9) allows us to define implementation-specific macros for
66
+ different fp environments */
67
+
68
+ /* The default Intel x87 floating point environment (64-bit mantissa) */
69
+ #define FE_PC64_ENV ((const fenv_t *)-1)
70
+
71
+ /* The floating point environment set by MSVCRT _fpreset (53-bit mantissa) */
72
+ #define FE_PC53_ENV ((const fenv_t *)-2)
73
+
74
+ /* The FE_DFL_ENV macro is required by standard.
75
+ fesetenv will use the environment set at app startup.*/
76
+ #define FE_DFL_ENV ((const fenv_t *) 0)
77
+
78
+ #ifdef __cplusplus
79
+ extern "C" {
80
+ #endif
81
+
82
+ /*TODO: Some of these could be inlined */
83
+ /* 7.6.2 Exception */
84
+
85
+ extern int __cdecl feclearexcept (int);
86
+ extern int __cdecl fegetexceptflag (fexcept_t * flagp, int excepts);
87
+ extern int __cdecl feraiseexcept (int excepts );
88
+ extern int __cdecl fesetexceptflag (const fexcept_t *, int);
89
+ extern int __cdecl fetestexcept (int excepts);
90
+
91
+ /* 7.6.3 Rounding */
92
+
93
+ extern int __cdecl fegetround (void);
94
+ extern int __cdecl fesetround (int mode);
95
+
96
+ /* 7.6.4 Environment */
97
+
98
+ extern int __cdecl fegetenv(fenv_t * envp);
99
+ extern int __cdecl fesetenv(const fenv_t * );
100
+ extern int __cdecl feupdateenv(const fenv_t *);
101
+ extern int __cdecl feholdexcept(fenv_t *);
102
+
103
+ #ifdef __cplusplus
104
+ }
105
+ #endif
106
+ #endif /* Not RC_INVOKED */
107
+
108
+ #endif /* ndef _FENV_H */
@@ -0,0 +1,75 @@
1
+ #ifndef _FLOAT_H_
2
+ #define _FLOAT_H_
3
+
4
+ #define FLT_RADIX 2
5
+
6
+ /* IEEE float */
7
+ #define FLT_MANT_DIG 24
8
+ #define FLT_DIG 6
9
+ #define FLT_ROUNDS 1
10
+ #define FLT_EPSILON 1.19209290e-07F
11
+ #define FLT_MIN_EXP (-125)
12
+ #define FLT_MIN 1.17549435e-38F
13
+ #define FLT_MIN_10_EXP (-37)
14
+ #define FLT_MAX_EXP 128
15
+ #define FLT_MAX 3.40282347e+38F
16
+ #define FLT_MAX_10_EXP 38
17
+
18
+ /* IEEE double */
19
+ #define DBL_MANT_DIG 53
20
+ #define DBL_DIG 15
21
+ #define DBL_EPSILON 2.2204460492503131e-16
22
+ #define DBL_MIN_EXP (-1021)
23
+ #define DBL_MIN 2.2250738585072014e-308
24
+ #define DBL_MIN_10_EXP (-307)
25
+ #define DBL_MAX_EXP 1024
26
+ #define DBL_MAX 1.7976931348623157e+308
27
+ #define DBL_MAX_10_EXP 308
28
+
29
+ /* horrible intel long double */
30
+ #if defined __i386__ || defined __x86_64__
31
+
32
+ #define LDBL_MANT_DIG 64
33
+ #define LDBL_DIG 18
34
+ #define LDBL_EPSILON 1.08420217248550443401e-19L
35
+ #define LDBL_MIN_EXP (-16381)
36
+ #define LDBL_MIN 3.36210314311209350626e-4932L
37
+ #define LDBL_MIN_10_EXP (-4931)
38
+ #define LDBL_MAX_EXP 16384
39
+ #define LDBL_MAX 1.18973149535723176502e+4932L
40
+ #define LDBL_MAX_10_EXP 4932
41
+ #define DECIMAL_DIG 21
42
+
43
+ #elif defined __aarch64__ || defined __riscv
44
+ /*
45
+ * Use values from:
46
+ * gcc -dM -E -xc /dev/null | grep LDBL | sed -e "s/__//g"
47
+ */
48
+ #define LDBL_MANT_DIG 113
49
+ #define LDBL_DIG 33
50
+ #define LDBL_EPSILON 1.92592994438723585305597794258492732e-34L
51
+ #define LDBL_MIN_EXP (-16381)
52
+ #define LDBL_MIN 3.36210314311209350626267781732175260e-4932L
53
+ #define LDBL_MIN_10_EXP (-4931)
54
+ #define LDBL_MAX_EXP 16384
55
+ #define LDBL_MAX 1.18973149535723176508575932662800702e+4932L
56
+ #define LDBL_MAX_10_EXP 4932
57
+ #define DECIMAL_DIG 36
58
+
59
+ #else
60
+
61
+ /* same as IEEE double */
62
+ #define LDBL_MANT_DIG 53
63
+ #define LDBL_DIG 15
64
+ #define LDBL_EPSILON 2.2204460492503131e-16L
65
+ #define LDBL_MIN_EXP (-1021)
66
+ #define LDBL_MIN 2.2250738585072014e-308L
67
+ #define LDBL_MIN_10_EXP (-307)
68
+ #define LDBL_MAX_EXP 1024
69
+ #define LDBL_MAX 1.7976931348623157e+308L
70
+ #define LDBL_MAX_10_EXP 308
71
+ #define DECIMAL_DIG 17
72
+
73
+ #endif
74
+
75
+ #endif /* _FLOAT_H_ */
@@ -0,0 +1,297 @@
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
+ /* 7.8 Format conversion of integer types <inttypes.h> */
7
+
8
+ #ifndef _INTTYPES_H_
9
+ #define _INTTYPES_H_
10
+
11
+ #include <_mingw.h>
12
+ #include <stdint.h>
13
+ #define __need_wchar_t
14
+ #include <stddef.h>
15
+
16
+ #ifdef __cplusplus
17
+ extern "C" {
18
+ #endif
19
+
20
+ typedef struct {
21
+ intmax_t quot;
22
+ intmax_t rem;
23
+ } imaxdiv_t;
24
+
25
+ #if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS)
26
+
27
+ /* 7.8.1 Macros for format specifiers
28
+ *
29
+ * MS runtime does not yet understand C9x standard "ll"
30
+ * length specifier. It appears to treat "ll" as "l".
31
+ * The non-standard I64 length specifier causes warning in GCC,
32
+ * but understood by MS runtime functions.
33
+ */
34
+
35
+ /* fprintf macros for signed types */
36
+ #define PRId8 "d"
37
+ #define PRId16 "d"
38
+ #define PRId32 "d"
39
+ #define PRId64 "I64d"
40
+
41
+ #define PRIdLEAST8 "d"
42
+ #define PRIdLEAST16 "d"
43
+ #define PRIdLEAST32 "d"
44
+ #define PRIdLEAST64 "I64d"
45
+
46
+ #define PRIdFAST8 "d"
47
+ #define PRIdFAST16 "d"
48
+ #define PRIdFAST32 "d"
49
+ #define PRIdFAST64 "I64d"
50
+
51
+ #define PRIdMAX "I64d"
52
+
53
+ #define PRIi8 "i"
54
+ #define PRIi16 "i"
55
+ #define PRIi32 "i"
56
+ #define PRIi64 "I64i"
57
+
58
+ #define PRIiLEAST8 "i"
59
+ #define PRIiLEAST16 "i"
60
+ #define PRIiLEAST32 "i"
61
+ #define PRIiLEAST64 "I64i"
62
+
63
+ #define PRIiFAST8 "i"
64
+ #define PRIiFAST16 "i"
65
+ #define PRIiFAST32 "i"
66
+ #define PRIiFAST64 "I64i"
67
+
68
+ #define PRIiMAX "I64i"
69
+
70
+ #define PRIo8 "o"
71
+ #define PRIo16 "o"
72
+ #define PRIo32 "o"
73
+ #define PRIo64 "I64o"
74
+
75
+ #define PRIoLEAST8 "o"
76
+ #define PRIoLEAST16 "o"
77
+ #define PRIoLEAST32 "o"
78
+ #define PRIoLEAST64 "I64o"
79
+
80
+ #define PRIoFAST8 "o"
81
+ #define PRIoFAST16 "o"
82
+ #define PRIoFAST32 "o"
83
+ #define PRIoFAST64 "I64o"
84
+
85
+ #define PRIoMAX "I64o"
86
+
87
+ /* fprintf macros for unsigned types */
88
+ #define PRIu8 "u"
89
+ #define PRIu16 "u"
90
+ #define PRIu32 "u"
91
+ #define PRIu64 "I64u"
92
+
93
+
94
+ #define PRIuLEAST8 "u"
95
+ #define PRIuLEAST16 "u"
96
+ #define PRIuLEAST32 "u"
97
+ #define PRIuLEAST64 "I64u"
98
+
99
+ #define PRIuFAST8 "u"
100
+ #define PRIuFAST16 "u"
101
+ #define PRIuFAST32 "u"
102
+ #define PRIuFAST64 "I64u"
103
+
104
+ #define PRIuMAX "I64u"
105
+
106
+ #define PRIx8 "x"
107
+ #define PRIx16 "x"
108
+ #define PRIx32 "x"
109
+ #define PRIx64 "I64x"
110
+
111
+ #define PRIxLEAST8 "x"
112
+ #define PRIxLEAST16 "x"
113
+ #define PRIxLEAST32 "x"
114
+ #define PRIxLEAST64 "I64x"
115
+
116
+ #define PRIxFAST8 "x"
117
+ #define PRIxFAST16 "x"
118
+ #define PRIxFAST32 "x"
119
+ #define PRIxFAST64 "I64x"
120
+
121
+ #define PRIxMAX "I64x"
122
+
123
+ #define PRIX8 "X"
124
+ #define PRIX16 "X"
125
+ #define PRIX32 "X"
126
+ #define PRIX64 "I64X"
127
+
128
+ #define PRIXLEAST8 "X"
129
+ #define PRIXLEAST16 "X"
130
+ #define PRIXLEAST32 "X"
131
+ #define PRIXLEAST64 "I64X"
132
+
133
+ #define PRIXFAST8 "X"
134
+ #define PRIXFAST16 "X"
135
+ #define PRIXFAST32 "X"
136
+ #define PRIXFAST64 "I64X"
137
+
138
+ #define PRIXMAX "I64X"
139
+
140
+ /*
141
+ * fscanf macros for signed int types
142
+ * NOTE: if 32-bit int is used for int_fast8_t and int_fast16_t
143
+ * (see stdint.h, 7.18.1.3), FAST8 and FAST16 should have
144
+ * no length identifiers
145
+ */
146
+
147
+ #define SCNd16 "hd"
148
+ #define SCNd32 "d"
149
+ #define SCNd64 "I64d"
150
+
151
+ #define SCNdLEAST16 "hd"
152
+ #define SCNdLEAST32 "d"
153
+ #define SCNdLEAST64 "I64d"
154
+
155
+ #define SCNdFAST16 "hd"
156
+ #define SCNdFAST32 "d"
157
+ #define SCNdFAST64 "I64d"
158
+
159
+ #define SCNdMAX "I64d"
160
+
161
+ #define SCNi16 "hi"
162
+ #define SCNi32 "i"
163
+ #define SCNi64 "I64i"
164
+
165
+ #define SCNiLEAST16 "hi"
166
+ #define SCNiLEAST32 "i"
167
+ #define SCNiLEAST64 "I64i"
168
+
169
+ #define SCNiFAST16 "hi"
170
+ #define SCNiFAST32 "i"
171
+ #define SCNiFAST64 "I64i"
172
+
173
+ #define SCNiMAX "I64i"
174
+
175
+ #define SCNo16 "ho"
176
+ #define SCNo32 "o"
177
+ #define SCNo64 "I64o"
178
+
179
+ #define SCNoLEAST16 "ho"
180
+ #define SCNoLEAST32 "o"
181
+ #define SCNoLEAST64 "I64o"
182
+
183
+ #define SCNoFAST16 "ho"
184
+ #define SCNoFAST32 "o"
185
+ #define SCNoFAST64 "I64o"
186
+
187
+ #define SCNoMAX "I64o"
188
+
189
+ #define SCNx16 "hx"
190
+ #define SCNx32 "x"
191
+ #define SCNx64 "I64x"
192
+
193
+ #define SCNxLEAST16 "hx"
194
+ #define SCNxLEAST32 "x"
195
+ #define SCNxLEAST64 "I64x"
196
+
197
+ #define SCNxFAST16 "hx"
198
+ #define SCNxFAST32 "x"
199
+ #define SCNxFAST64 "I64x"
200
+
201
+ #define SCNxMAX "I64x"
202
+
203
+ /* fscanf macros for unsigned int types */
204
+
205
+ #define SCNu16 "hu"
206
+ #define SCNu32 "u"
207
+ #define SCNu64 "I64u"
208
+
209
+ #define SCNuLEAST16 "hu"
210
+ #define SCNuLEAST32 "u"
211
+ #define SCNuLEAST64 "I64u"
212
+
213
+ #define SCNuFAST16 "hu"
214
+ #define SCNuFAST32 "u"
215
+ #define SCNuFAST64 "I64u"
216
+
217
+ #define SCNuMAX "I64u"
218
+
219
+ #ifdef _WIN64
220
+ #define PRIdPTR "I64d"
221
+ #define PRIiPTR "I64i"
222
+ #define PRIoPTR "I64o"
223
+ #define PRIuPTR "I64u"
224
+ #define PRIxPTR "I64x"
225
+ #define PRIXPTR "I64X"
226
+ #define SCNdPTR "I64d"
227
+ #define SCNiPTR "I64i"
228
+ #define SCNoPTR "I64o"
229
+ #define SCNxPTR "I64x"
230
+ #define SCNuPTR "I64u"
231
+ #else
232
+ #define PRIdPTR "d"
233
+ #define PRIiPTR "i"
234
+ #define PRIoPTR "o"
235
+ #define PRIuPTR "u"
236
+ #define PRIxPTR "x"
237
+ #define PRIXPTR "X"
238
+ #define SCNdPTR "d"
239
+ #define SCNiPTR "i"
240
+ #define SCNoPTR "o"
241
+ #define SCNxPTR "x"
242
+ #define SCNuPTR "u"
243
+ #endif
244
+
245
+ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
246
+ /*
247
+ * no length modifier for char types prior to C9x
248
+ * MS runtime scanf appears to treat "hh" as "h"
249
+ */
250
+
251
+ /* signed char */
252
+ #define SCNd8 "hhd"
253
+ #define SCNdLEAST8 "hhd"
254
+ #define SCNdFAST8 "hhd"
255
+
256
+ #define SCNi8 "hhi"
257
+ #define SCNiLEAST8 "hhi"
258
+ #define SCNiFAST8 "hhi"
259
+
260
+ #define SCNo8 "hho"
261
+ #define SCNoLEAST8 "hho"
262
+ #define SCNoFAST8 "hho"
263
+
264
+ #define SCNx8 "hhx"
265
+ #define SCNxLEAST8 "hhx"
266
+ #define SCNxFAST8 "hhx"
267
+
268
+ /* unsigned char */
269
+ #define SCNu8 "hhu"
270
+ #define SCNuLEAST8 "hhu"
271
+ #define SCNuFAST8 "hhu"
272
+ #endif /* __STDC_VERSION__ >= 199901 */
273
+
274
+ #endif /* !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) */
275
+
276
+ intmax_t __cdecl imaxabs (intmax_t j);
277
+ __CRT_INLINE intmax_t __cdecl imaxabs (intmax_t j)
278
+ {return (j >= 0 ? j : -j);}
279
+ imaxdiv_t __cdecl imaxdiv (intmax_t numer, intmax_t denom);
280
+
281
+ /* 7.8.2 Conversion functions for greatest-width integer types */
282
+
283
+ intmax_t __cdecl strtoimax (const char* __restrict__ nptr,
284
+ char** __restrict__ endptr, int base);
285
+ uintmax_t __cdecl strtoumax (const char* __restrict__ nptr,
286
+ char** __restrict__ endptr, int base);
287
+
288
+ intmax_t __cdecl wcstoimax (const wchar_t* __restrict__ nptr,
289
+ wchar_t** __restrict__ endptr, int base);
290
+ uintmax_t __cdecl wcstoumax (const wchar_t* __restrict__ nptr,
291
+ wchar_t** __restrict__ endptr, int base);
292
+
293
+ #ifdef __cplusplus
294
+ }
295
+ #endif
296
+
297
+ #endif /* ndef _INTTYPES_H */