|
34 | 34 | TARGET_CPU_MIPS - Compiler is generating MIPS instructions |
35 | 35 | TARGET_CPU_SPARC - Compiler is generating Sparc instructions |
36 | 36 | TARGET_CPU_ALPHA - Compiler is generating Dec Alpha instructions |
| 37 | + TARGET_CPU_WASM32 - Compiler is generating WebAssembly instructions for 32-bit mode |
37 | 38 |
|
38 | 39 |
|
39 | 40 | TARGET_OS_* |
|
47 | 48 | TARGET_OS_WIN32 - Generated code will run under 32-bit Windows |
48 | 49 | TARGET_OS_UNIX - Generated code will run under some Unix (not OSX) |
49 | 50 | TARGET_OS_CYGWIN - Generated code will run under 64-bit Cygwin |
| 51 | + TARGET_OS_WASI - Generated code will run under WebAssembly System Interface |
50 | 52 | TARGET_OS_MAC - Generated code will run under Mac OS X variant |
51 | 53 | TARGET_OS_IPHONE - Generated code for firmware, devices, or simulator |
52 | 54 | TARGET_OS_IOS - Generated code will run under iOS |
|
79 | 81 | #define TARGET_OS_BSD 0 |
80 | 82 | #define TARGET_OS_ANDROID 0 |
81 | 83 | #define TARGET_OS_CYGWIN 0 |
| 84 | +#define TARGET_OS_WASI 0 |
82 | 85 | #elif __ANDROID__ |
83 | 86 | #define TARGET_OS_DARWIN 0 |
84 | 87 | #define TARGET_OS_LINUX 1 |
85 | 88 | #define TARGET_OS_WINDOWS 0 |
86 | 89 | #define TARGET_OS_BSD 0 |
87 | 90 | #define TARGET_OS_ANDROID 1 |
88 | 91 | #define TARGET_OS_CYGWIN 0 |
| 92 | +#define TARGET_OS_WASI 0 |
89 | 93 | #elif __linux__ |
90 | 94 | #define TARGET_OS_DARWIN 0 |
91 | 95 | #define TARGET_OS_LINUX 1 |
92 | 96 | #define TARGET_OS_WINDOWS 0 |
93 | 97 | #define TARGET_OS_BSD 0 |
94 | 98 | #define TARGET_OS_ANDROID 0 |
95 | 99 | #define TARGET_OS_CYGWIN 0 |
| 100 | +#define TARGET_OS_WASI 0 |
96 | 101 | #elif __CYGWIN__ |
97 | 102 | #define TARGET_OS_DARWIN 0 |
98 | 103 | #define TARGET_OS_LINUX 1 |
99 | 104 | #define TARGET_OS_WINDOWS 0 |
100 | 105 | #define TARGET_OS_BSD 0 |
101 | 106 | #define TARGET_OS_ANDROID 0 |
102 | 107 | #define TARGET_OS_CYGWIN 1 |
| 108 | +#define TARGET_OS_WASI 0 |
103 | 109 | #elif _WIN32 || _WIN64 |
104 | 110 | #define TARGET_OS_DARWIN 0 |
105 | 111 | #define TARGET_OS_LINUX 0 |
106 | 112 | #define TARGET_OS_WINDOWS 1 |
107 | 113 | #define TARGET_OS_BSD 0 |
108 | 114 | #define TARGET_OS_ANDROID 0 |
| 115 | +#define TARGET_OS_WASI 0 |
109 | 116 | #elif __unix__ |
110 | 117 | #define TARGET_OS_DARWIN 0 |
111 | 118 | #define TARGET_OS_LINUX 0 |
112 | 119 | #define TARGET_OS_WINDOWS 0 |
113 | 120 | #define TARGET_OS_BSD 1 |
114 | 121 | #define TARGET_OS_ANDROID 0 |
| 122 | +#define TARGET_OS_WASI 0 |
| 123 | +#elif __wasi__ |
| 124 | +#define TARGET_OS_DARWIN 0 |
| 125 | +#define TARGET_OS_LINUX 0 |
| 126 | +#define TARGET_OS_WINDOWS 0 |
| 127 | +#define TARGET_OS_BSD 0 |
| 128 | +#define TARGET_OS_ANDROID 0 |
| 129 | +#define TARGET_OS_WASI 1 |
115 | 130 | #else |
116 | 131 | #error unknown operating system |
117 | 132 | #endif |
|
130 | 145 | #define TARGET_CPU_MIPS 0 |
131 | 146 | #define TARGET_CPU_MIPS64 0 |
132 | 147 | #define TARGET_CPU_S390X 0 |
| 148 | +#define TARGET_CPU_WASM32 0 |
133 | 149 | #elif __arm64__ || __aarch64__ |
134 | 150 | #define TARGET_CPU_PPC 0 |
135 | 151 | #define TARGET_CPU_PPC64 0 |
|
140 | 156 | #define TARGET_CPU_MIPS 0 |
141 | 157 | #define TARGET_CPU_MIPS64 0 |
142 | 158 | #define TARGET_CPU_S390X 0 |
| 159 | +#define TARGET_CPU_WASM32 0 |
143 | 160 | #elif __mips64__ |
144 | 161 | #define TARGET_CPU_PPC 0 |
145 | 162 | #define TARGET_CPU_PPC64 0 |
|
150 | 167 | #define TARGET_CPU_MIPS 0 |
151 | 168 | #define TARGET_CPU_MIPS64 1 |
152 | 169 | #define TARGET_CPU_S390X 0 |
| 170 | +#define TARGET_CPU_WASM32 0 |
153 | 171 | #elif __powerpc64__ |
154 | 172 | #define TARGET_CPU_PPC 0 |
155 | 173 | #define TARGET_CPU_PPC64 1 |
|
160 | 178 | #define TARGET_CPU_MIPS 0 |
161 | 179 | #define TARGET_CPU_MIPS64 0 |
162 | 180 | #define TARGET_CPU_S390X 0 |
| 181 | +#define TARGET_CPU_WASM32 0 |
163 | 182 | #elif __i386__ |
164 | 183 | #define TARGET_CPU_PPC 0 |
165 | 184 | #define TARGET_CPU_PPC64 0 |
|
170 | 189 | #define TARGET_CPU_MIPS 0 |
171 | 190 | #define TARGET_CPU_MIPS64 0 |
172 | 191 | #define TARGET_CPU_S390X 0 |
| 192 | +#define TARGET_CPU_WASM32 0 |
173 | 193 | #elif __arm__ |
174 | 194 | #define TARGET_CPU_PPC 0 |
175 | 195 | #define TARGET_CPU_PPC64 0 |
|
180 | 200 | #define TARGET_CPU_MIPS 0 |
181 | 201 | #define TARGET_CPU_MIPS64 0 |
182 | 202 | #define TARGET_CPU_S390X 0 |
| 203 | +#define TARGET_CPU_WASM32 0 |
183 | 204 | #elif __mips__ |
184 | 205 | #define TARGET_CPU_PPC 0 |
185 | 206 | #define TARGET_CPU_PPC64 0 |
|
190 | 211 | #define TARGET_CPU_MIPS 1 |
191 | 212 | #define TARGET_CPU_MIPS64 0 |
192 | 213 | #define TARGET_CPU_S390X 0 |
| 214 | +#define TARGET_CPU_WASM32 0 |
193 | 215 | #elif __powerpc__ |
194 | 216 | #define TARGET_CPU_PPC 1 |
195 | 217 | #define TARGET_CPU_PPC64 0 |
|
200 | 222 | #define TARGET_CPU_MIPS 0 |
201 | 223 | #define TARGET_CPU_MIPS64 0 |
202 | 224 | #define TARGET_CPU_S390X 0 |
| 225 | +#define TARGET_CPU_WASM32 0 |
203 | 226 | #elif __s390x__ |
204 | 227 | #define TARGET_CPU_PPC 0 |
205 | 228 | #define TARGET_CPU_PPC64 0 |
|
210 | 233 | #define TARGET_CPU_MIPS 0 |
211 | 234 | #define TARGET_CPU_MIPS64 0 |
212 | 235 | #define TARGET_CPU_S390X 1 |
| 236 | +#define TARGET_CPU_WASM32 0 |
| 237 | +#elif __wasm32__ |
| 238 | +#define TARGET_CPU_PPC 0 |
| 239 | +#define TARGET_CPU_PPC64 0 |
| 240 | +#define TARGET_CPU_X86 0 |
| 241 | +#define TARGET_CPU_X86_64 0 |
| 242 | +#define TARGET_CPU_ARM 0 |
| 243 | +#define TARGET_CPU_ARM64 0 |
| 244 | +#define TARGET_CPU_MIPS 0 |
| 245 | +#define TARGET_CPU_MIPS64 0 |
| 246 | +#define TARGET_CPU_S390X 0 |
| 247 | +#define TARGET_CPU_WASM32 1 |
213 | 248 | #else |
214 | 249 | #error unknown architecture |
215 | 250 | #endif |
|
0 commit comments