authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-07-12 07:31:48+00:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2020-07-12 07:31:48+00:00
log2dcb70a6befc2cc0a8f46a7e64cde534d37f6f3e
tree641882c9894be33c628b929ca2bd803a3e450ed8
parentf23987db7d83403fc504b63171531e9ad1ffdc1a
parent9907116478efbdae5cac3de3879a1a8e42aecde8
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Merge pull request #5847 from Vexu/decl

Take advantage of new HashMap API's preserving order

17 files changed, 40 insertions(+), 749 deletions(-)

lib/std/target.zig+24-15
......@@ -903,25 +903,34 @@ pub const Target = struct {
903903 /// All processors Zig is aware of, sorted lexicographically by name.
904904 pub fn allCpuModels(arch: Arch) []const *const Cpu.Model {
905905 return switch (arch) {
906 .arm, .armeb, .thumb, .thumbeb => arm.all_cpus,
907 .aarch64, .aarch64_be, .aarch64_32 => aarch64.all_cpus,
908 .avr => avr.all_cpus,
909 .bpfel, .bpfeb => bpf.all_cpus,
910 .hexagon => hexagon.all_cpus,
911 .mips, .mipsel, .mips64, .mips64el => mips.all_cpus,
912 .msp430 => msp430.all_cpus,
913 .powerpc, .powerpc64, .powerpc64le => powerpc.all_cpus,
914 .amdgcn => amdgpu.all_cpus,
915 .riscv32, .riscv64 => riscv.all_cpus,
916 .sparc, .sparcv9, .sparcel => sparc.all_cpus,
917 .s390x => systemz.all_cpus,
918 .i386, .x86_64 => x86.all_cpus,
919 .nvptx, .nvptx64 => nvptx.all_cpus,
920 .wasm32, .wasm64 => wasm.all_cpus,
906 .arm, .armeb, .thumb, .thumbeb => comptime allCpusFromDecls(arm.cpu),
907 .aarch64, .aarch64_be, .aarch64_32 => comptime allCpusFromDecls(aarch64.cpu),
908 .avr => comptime allCpusFromDecls(avr.cpu),
909 .bpfel, .bpfeb => comptime allCpusFromDecls(bpf.cpu),
910 .hexagon => comptime allCpusFromDecls(hexagon.cpu),
911 .mips, .mipsel, .mips64, .mips64el => comptime allCpusFromDecls(mips.cpu),
912 .msp430 => comptime allCpusFromDecls(msp430.cpu),
913 .powerpc, .powerpc64, .powerpc64le => comptime allCpusFromDecls(powerpc.cpu),
914 .amdgcn => comptime allCpusFromDecls(amdgpu.cpu),
915 .riscv32, .riscv64 => comptime allCpusFromDecls(riscv.cpu),
916 .sparc, .sparcv9, .sparcel => comptime allCpusFromDecls(sparc.cpu),
917 .s390x => comptime allCpusFromDecls(systemz.cpu),
918 .i386, .x86_64 => comptime allCpusFromDecls(x86.cpu),
919 .nvptx, .nvptx64 => comptime allCpusFromDecls(nvptx.cpu),
920 .wasm32, .wasm64 => comptime allCpusFromDecls(wasm.cpu),
921921
922922 else => &[0]*const Model{},
923923 };
924924 }
925
926 fn allCpusFromDecls(comptime cpus: type) []const *const Cpu.Model {
927 const decls = std.meta.declarations(cpus);
928 var array: [decls.len]*const Cpu.Model = undefined;
929 for (decls) |decl, i| {
930 array[i] = &@field(cpus, decl.name);
931 }
932 return &array;
933 }
925934 };
926935
927936 pub const Model = struct {
lib/std/target/aarch64.zig-45
......@@ -1505,48 +1505,3 @@ pub const cpu = struct {
15051505 }),
15061506 };
15071507};
1508
1509/// All aarch64 CPUs, sorted alphabetically by name.
1510/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1
1511/// compiler has inefficient memory and CPU usage, affecting build times.
1512pub const all_cpus = &[_]*const CpuModel{
1513 &cpu.apple_a10,
1514 &cpu.apple_a11,
1515 &cpu.apple_a12,
1516 &cpu.apple_a13,
1517 &cpu.apple_a7,
1518 &cpu.apple_a8,
1519 &cpu.apple_a9,
1520 &cpu.apple_latest,
1521 &cpu.apple_s4,
1522 &cpu.apple_s5,
1523 &cpu.cortex_a35,
1524 &cpu.cortex_a53,
1525 &cpu.cortex_a55,
1526 &cpu.cortex_a57,
1527 &cpu.cortex_a65,
1528 &cpu.cortex_a65ae,
1529 &cpu.cortex_a72,
1530 &cpu.cortex_a73,
1531 &cpu.cortex_a75,
1532 &cpu.cortex_a76,
1533 &cpu.cortex_a76ae,
1534 &cpu.cyclone,
1535 &cpu.exynos_m1,
1536 &cpu.exynos_m2,
1537 &cpu.exynos_m3,
1538 &cpu.exynos_m4,
1539 &cpu.exynos_m5,
1540 &cpu.falkor,
1541 &cpu.generic,
1542 &cpu.kryo,
1543 &cpu.neoverse_e1,
1544 &cpu.neoverse_n1,
1545 &cpu.saphira,
1546 &cpu.thunderx,
1547 &cpu.thunderx2t99,
1548 &cpu.thunderxt81,
1549 &cpu.thunderxt83,
1550 &cpu.thunderxt88,
1551 &cpu.tsv110,
1552};
lib/std/target/amdgpu.zig-45
......@@ -1276,48 +1276,3 @@ pub const cpu = struct {
12761276 }),
12771277 };
12781278};
1279
1280/// All amdgpu CPUs, sorted alphabetically by name.
1281/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1
1282/// compiler has inefficient memory and CPU usage, affecting build times.
1283pub const all_cpus = &[_]*const CpuModel{
1284 &cpu.bonaire,
1285 &cpu.carrizo,
1286 &cpu.fiji,
1287 &cpu.generic,
1288 &cpu.generic_hsa,
1289 &cpu.gfx1010,
1290 &cpu.gfx1011,
1291 &cpu.gfx1012,
1292 &cpu.gfx600,
1293 &cpu.gfx601,
1294 &cpu.gfx700,
1295 &cpu.gfx701,
1296 &cpu.gfx702,
1297 &cpu.gfx703,
1298 &cpu.gfx704,
1299 &cpu.gfx801,
1300 &cpu.gfx802,
1301 &cpu.gfx803,
1302 &cpu.gfx810,
1303 &cpu.gfx900,
1304 &cpu.gfx902,
1305 &cpu.gfx904,
1306 &cpu.gfx906,
1307 &cpu.gfx908,
1308 &cpu.gfx909,
1309 &cpu.hainan,
1310 &cpu.hawaii,
1311 &cpu.iceland,
1312 &cpu.kabini,
1313 &cpu.kaveri,
1314 &cpu.mullins,
1315 &cpu.oland,
1316 &cpu.pitcairn,
1317 &cpu.polaris10,
1318 &cpu.polaris11,
1319 &cpu.stoney,
1320 &cpu.tahiti,
1321 &cpu.tonga,
1322 &cpu.verde,
1323};
lib/std/target/arm.zig-89
......@@ -2145,92 +2145,3 @@ pub const cpu = struct {
21452145 }),
21462146 };
21472147};
2148
2149/// All arm CPUs, sorted alphabetically by name.
2150/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1
2151/// compiler has inefficient memory and CPU usage, affecting build times.
2152pub const all_cpus = &[_]*const CpuModel{
2153 &cpu.arm1020e,
2154 &cpu.arm1020t,
2155 &cpu.arm1022e,
2156 &cpu.arm10e,
2157 &cpu.arm10tdmi,
2158 &cpu.arm1136j_s,
2159 &cpu.arm1136jf_s,
2160 &cpu.arm1156t2_s,
2161 &cpu.arm1156t2f_s,
2162 &cpu.arm1176j_s,
2163 &cpu.arm1176jz_s,
2164 &cpu.arm1176jzf_s,
2165 &cpu.arm710t,
2166 &cpu.arm720t,
2167 &cpu.arm7tdmi,
2168 &cpu.arm7tdmi_s,
2169 &cpu.arm8,
2170 &cpu.arm810,
2171 &cpu.arm9,
2172 &cpu.arm920,
2173 &cpu.arm920t,
2174 &cpu.arm922t,
2175 &cpu.arm926ej_s,
2176 &cpu.arm940t,
2177 &cpu.arm946e_s,
2178 &cpu.arm966e_s,
2179 &cpu.arm968e_s,
2180 &cpu.arm9e,
2181 &cpu.arm9tdmi,
2182 &cpu.cortex_a12,
2183 &cpu.cortex_a15,
2184 &cpu.cortex_a17,
2185 &cpu.cortex_a32,
2186 &cpu.cortex_a35,
2187 &cpu.cortex_a5,
2188 &cpu.cortex_a53,
2189 &cpu.cortex_a55,
2190 &cpu.cortex_a57,
2191 &cpu.cortex_a7,
2192 &cpu.cortex_a72,
2193 &cpu.cortex_a73,
2194 &cpu.cortex_a75,
2195 &cpu.cortex_a76,
2196 &cpu.cortex_a76ae,
2197 &cpu.cortex_a8,
2198 &cpu.cortex_a9,
2199 &cpu.cortex_m0,
2200 &cpu.cortex_m0plus,
2201 &cpu.cortex_m1,
2202 &cpu.cortex_m23,
2203 &cpu.cortex_m3,
2204 &cpu.cortex_m33,
2205 &cpu.cortex_m35p,
2206 &cpu.cortex_m4,
2207 &cpu.cortex_m7,
2208 &cpu.cortex_r4,
2209 &cpu.cortex_r4f,
2210 &cpu.cortex_r5,
2211 &cpu.cortex_r52,
2212 &cpu.cortex_r7,
2213 &cpu.cortex_r8,
2214 &cpu.cyclone,
2215 &cpu.ep9312,
2216 &cpu.exynos_m1,
2217 &cpu.exynos_m2,
2218 &cpu.exynos_m3,
2219 &cpu.exynos_m4,
2220 &cpu.exynos_m5,
2221 &cpu.generic,
2222 &cpu.iwmmxt,
2223 &cpu.krait,
2224 &cpu.kryo,
2225 &cpu.mpcore,
2226 &cpu.mpcorenovfp,
2227 &cpu.neoverse_n1,
2228 &cpu.sc000,
2229 &cpu.sc300,
2230 &cpu.strongarm,
2231 &cpu.strongarm110,
2232 &cpu.strongarm1100,
2233 &cpu.strongarm1110,
2234 &cpu.swift,
2235 &cpu.xscale,
2236};
lib/std/target/avr.zig-263
......@@ -2116,266 +2116,3 @@ pub const cpu = struct {
21162116 }),
21172117 };
21182118};
2119
2120/// All avr CPUs, sorted alphabetically by name.
2121/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1
2122/// compiler has inefficient memory and CPU usage, affecting build times.
2123pub const all_cpus = &[_]*const CpuModel{
2124 &cpu.at43usb320,
2125 &cpu.at43usb355,
2126 &cpu.at76c711,
2127 &cpu.at86rf401,
2128 &cpu.at90c8534,
2129 &cpu.at90can128,
2130 &cpu.at90can32,
2131 &cpu.at90can64,
2132 &cpu.at90pwm1,
2133 &cpu.at90pwm161,
2134 &cpu.at90pwm2,
2135 &cpu.at90pwm216,
2136 &cpu.at90pwm2b,
2137 &cpu.at90pwm3,
2138 &cpu.at90pwm316,
2139 &cpu.at90pwm3b,
2140 &cpu.at90pwm81,
2141 &cpu.at90s1200,
2142 &cpu.at90s2313,
2143 &cpu.at90s2323,
2144 &cpu.at90s2333,
2145 &cpu.at90s2343,
2146 &cpu.at90s4414,
2147 &cpu.at90s4433,
2148 &cpu.at90s4434,
2149 &cpu.at90s8515,
2150 &cpu.at90s8535,
2151 &cpu.at90scr100,
2152 &cpu.at90usb1286,
2153 &cpu.at90usb1287,
2154 &cpu.at90usb162,
2155 &cpu.at90usb646,
2156 &cpu.at90usb647,
2157 &cpu.at90usb82,
2158 &cpu.at94k,
2159 &cpu.ata5272,
2160 &cpu.ata5505,
2161 &cpu.ata5790,
2162 &cpu.ata5795,
2163 &cpu.ata6285,
2164 &cpu.ata6286,
2165 &cpu.ata6289,
2166 &cpu.atmega103,
2167 &cpu.atmega128,
2168 &cpu.atmega1280,
2169 &cpu.atmega1281,
2170 &cpu.atmega1284,
2171 &cpu.atmega1284p,
2172 &cpu.atmega1284rfr2,
2173 &cpu.atmega128a,
2174 &cpu.atmega128rfa1,
2175 &cpu.atmega128rfr2,
2176 &cpu.atmega16,
2177 &cpu.atmega161,
2178 &cpu.atmega162,
2179 &cpu.atmega163,
2180 &cpu.atmega164a,
2181 &cpu.atmega164p,
2182 &cpu.atmega164pa,
2183 &cpu.atmega165,
2184 &cpu.atmega165a,
2185 &cpu.atmega165p,
2186 &cpu.atmega165pa,
2187 &cpu.atmega168,
2188 &cpu.atmega168a,
2189 &cpu.atmega168p,
2190 &cpu.atmega168pa,
2191 &cpu.atmega169,
2192 &cpu.atmega169a,
2193 &cpu.atmega169p,
2194 &cpu.atmega169pa,
2195 &cpu.atmega16a,
2196 &cpu.atmega16hva,
2197 &cpu.atmega16hva2,
2198 &cpu.atmega16hvb,
2199 &cpu.atmega16hvbrevb,
2200 &cpu.atmega16m1,
2201 &cpu.atmega16u2,
2202 &cpu.atmega16u4,
2203 &cpu.atmega2560,
2204 &cpu.atmega2561,
2205 &cpu.atmega2564rfr2,
2206 &cpu.atmega256rfr2,
2207 &cpu.atmega32,
2208 &cpu.atmega323,
2209 &cpu.atmega324a,
2210 &cpu.atmega324p,
2211 &cpu.atmega324pa,
2212 &cpu.atmega325,
2213 &cpu.atmega3250,
2214 &cpu.atmega3250a,
2215 &cpu.atmega3250p,
2216 &cpu.atmega3250pa,
2217 &cpu.atmega325a,
2218 &cpu.atmega325p,
2219 &cpu.atmega325pa,
2220 &cpu.atmega328,
2221 &cpu.atmega328p,
2222 &cpu.atmega329,
2223 &cpu.atmega3290,
2224 &cpu.atmega3290a,
2225 &cpu.atmega3290p,
2226 &cpu.atmega3290pa,
2227 &cpu.atmega329a,
2228 &cpu.atmega329p,
2229 &cpu.atmega329pa,
2230 &cpu.atmega32a,
2231 &cpu.atmega32c1,
2232 &cpu.atmega32hvb,
2233 &cpu.atmega32hvbrevb,
2234 &cpu.atmega32m1,
2235 &cpu.atmega32u2,
2236 &cpu.atmega32u4,
2237 &cpu.atmega32u6,
2238 &cpu.atmega406,
2239 &cpu.atmega48,
2240 &cpu.atmega48a,
2241 &cpu.atmega48p,
2242 &cpu.atmega48pa,
2243 &cpu.atmega64,
2244 &cpu.atmega640,
2245 &cpu.atmega644,
2246 &cpu.atmega644a,
2247 &cpu.atmega644p,
2248 &cpu.atmega644pa,
2249 &cpu.atmega644rfr2,
2250 &cpu.atmega645,
2251 &cpu.atmega6450,
2252 &cpu.atmega6450a,
2253 &cpu.atmega6450p,
2254 &cpu.atmega645a,
2255 &cpu.atmega645p,
2256 &cpu.atmega649,
2257 &cpu.atmega6490,
2258 &cpu.atmega6490a,
2259 &cpu.atmega6490p,
2260 &cpu.atmega649a,
2261 &cpu.atmega649p,
2262 &cpu.atmega64a,
2263 &cpu.atmega64c1,
2264 &cpu.atmega64hve,
2265 &cpu.atmega64m1,
2266 &cpu.atmega64rfr2,
2267 &cpu.atmega8,
2268 &cpu.atmega8515,
2269 &cpu.atmega8535,
2270 &cpu.atmega88,
2271 &cpu.atmega88a,
2272 &cpu.atmega88p,
2273 &cpu.atmega88pa,
2274 &cpu.atmega8a,
2275 &cpu.atmega8hva,
2276 &cpu.atmega8u2,
2277 &cpu.attiny10,
2278 &cpu.attiny102,
2279 &cpu.attiny104,
2280 &cpu.attiny11,
2281 &cpu.attiny12,
2282 &cpu.attiny13,
2283 &cpu.attiny13a,
2284 &cpu.attiny15,
2285 &cpu.attiny1634,
2286 &cpu.attiny167,
2287 &cpu.attiny20,
2288 &cpu.attiny22,
2289 &cpu.attiny2313,
2290 &cpu.attiny2313a,
2291 &cpu.attiny24,
2292 &cpu.attiny24a,
2293 &cpu.attiny25,
2294 &cpu.attiny26,
2295 &cpu.attiny261,
2296 &cpu.attiny261a,
2297 &cpu.attiny28,
2298 &cpu.attiny4,
2299 &cpu.attiny40,
2300 &cpu.attiny4313,
2301 &cpu.attiny43u,
2302 &cpu.attiny44,
2303 &cpu.attiny44a,
2304 &cpu.attiny45,
2305 &cpu.attiny461,
2306 &cpu.attiny461a,
2307 &cpu.attiny48,
2308 &cpu.attiny5,
2309 &cpu.attiny828,
2310 &cpu.attiny84,
2311 &cpu.attiny84a,
2312 &cpu.attiny85,
2313 &cpu.attiny861,
2314 &cpu.attiny861a,
2315 &cpu.attiny87,
2316 &cpu.attiny88,
2317 &cpu.attiny9,
2318 &cpu.atxmega128a1,
2319 &cpu.atxmega128a1u,
2320 &cpu.atxmega128a3,
2321 &cpu.atxmega128a3u,
2322 &cpu.atxmega128a4u,
2323 &cpu.atxmega128b1,
2324 &cpu.atxmega128b3,
2325 &cpu.atxmega128c3,
2326 &cpu.atxmega128d3,
2327 &cpu.atxmega128d4,
2328 &cpu.atxmega16a4,
2329 &cpu.atxmega16a4u,
2330 &cpu.atxmega16c4,
2331 &cpu.atxmega16d4,
2332 &cpu.atxmega16e5,
2333 &cpu.atxmega192a3,
2334 &cpu.atxmega192a3u,
2335 &cpu.atxmega192c3,
2336 &cpu.atxmega192d3,
2337 &cpu.atxmega256a3,
2338 &cpu.atxmega256a3b,
2339 &cpu.atxmega256a3bu,
2340 &cpu.atxmega256a3u,
2341 &cpu.atxmega256c3,
2342 &cpu.atxmega256d3,
2343 &cpu.atxmega32a4,
2344 &cpu.atxmega32a4u,
2345 &cpu.atxmega32c4,
2346 &cpu.atxmega32d4,
2347 &cpu.atxmega32e5,
2348 &cpu.atxmega32x1,
2349 &cpu.atxmega384c3,
2350 &cpu.atxmega384d3,
2351 &cpu.atxmega64a1,
2352 &cpu.atxmega64a1u,
2353 &cpu.atxmega64a3,
2354 &cpu.atxmega64a3u,
2355 &cpu.atxmega64a4u,
2356 &cpu.atxmega64b1,
2357 &cpu.atxmega64b3,
2358 &cpu.atxmega64c3,
2359 &cpu.atxmega64d3,
2360 &cpu.atxmega64d4,
2361 &cpu.atxmega8e5,
2362 &cpu.avr1,
2363 &cpu.avr2,
2364 &cpu.avr25,
2365 &cpu.avr3,
2366 &cpu.avr31,
2367 &cpu.avr35,
2368 &cpu.avr4,
2369 &cpu.avr5,
2370 &cpu.avr51,
2371 &cpu.avr6,
2372 &cpu.avrtiny,
2373 &cpu.avrxmega1,
2374 &cpu.avrxmega2,
2375 &cpu.avrxmega3,
2376 &cpu.avrxmega4,
2377 &cpu.avrxmega5,
2378 &cpu.avrxmega6,
2379 &cpu.avrxmega7,
2380 &cpu.m3000,
2381};
lib/std/target/bpf.zig-11
......@@ -64,14 +64,3 @@ pub const cpu = struct {
6464 .features = featureSet(&[_]Feature{}),
6565 };
6666};
67
68/// All bpf CPUs, sorted alphabetically by name.
69/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1
70/// compiler has inefficient memory and CPU usage, affecting build times.
71pub const all_cpus = &[_]*const CpuModel{
72 &cpu.generic,
73 &cpu.probe,
74 &cpu.v1,
75 &cpu.v2,
76 &cpu.v3,
77};
lib/std/target/hexagon.zig-13
......@@ -298,16 +298,3 @@ pub const cpu = struct {
298298 }),
299299 };
300300};
301
302/// All hexagon CPUs, sorted alphabetically by name.
303/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1
304/// compiler has inefficient memory and CPU usage, affecting build times.
305pub const all_cpus = &[_]*const CpuModel{
306 &cpu.generic,
307 &cpu.hexagonv5,
308 &cpu.hexagonv55,
309 &cpu.hexagonv60,
310 &cpu.hexagonv62,
311 &cpu.hexagonv65,
312 &cpu.hexagonv66,
313};
lib/std/target/mips.zig-25
......@@ -524,28 +524,3 @@ pub const cpu = struct {
524524 }),
525525 };
526526};
527
528/// All mips CPUs, sorted alphabetically by name.
529/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1
530/// compiler has inefficient memory and CPU usage, affecting build times.
531pub const all_cpus = &[_]*const CpuModel{
532 &cpu.generic,
533 &cpu.mips1,
534 &cpu.mips2,
535 &cpu.mips3,
536 &cpu.mips32,
537 &cpu.mips32r2,
538 &cpu.mips32r3,
539 &cpu.mips32r5,
540 &cpu.mips32r6,
541 &cpu.mips4,
542 &cpu.mips5,
543 &cpu.mips64,
544 &cpu.mips64r2,
545 &cpu.mips64r3,
546 &cpu.mips64r5,
547 &cpu.mips64r6,
548 &cpu.octeon,
549 &cpu.@"octeon+",
550 &cpu.p5600,
551};
lib/std/target/msp430.zig-9
......@@ -62,12 +62,3 @@ pub const cpu = struct {
6262 }),
6363 };
6464};
65
66/// All msp430 CPUs, sorted alphabetically by name.
67/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1
68/// compiler has inefficient memory and CPU usage, affecting build times.
69pub const all_cpus = &[_]*const CpuModel{
70 &cpu.generic,
71 &cpu.msp430,
72 &cpu.msp430x,
73};
lib/std/target/nvptx.zig-21
......@@ -287,24 +287,3 @@ pub const cpu = struct {
287287 }),
288288 };
289289};
290
291/// All nvptx CPUs, sorted alphabetically by name.
292/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1
293/// compiler has inefficient memory and CPU usage, affecting build times.
294pub const all_cpus = &[_]*const CpuModel{
295 &cpu.sm_20,
296 &cpu.sm_21,
297 &cpu.sm_30,
298 &cpu.sm_32,
299 &cpu.sm_35,
300 &cpu.sm_37,
301 &cpu.sm_50,
302 &cpu.sm_52,
303 &cpu.sm_53,
304 &cpu.sm_60,
305 &cpu.sm_61,
306 &cpu.sm_62,
307 &cpu.sm_70,
308 &cpu.sm_72,
309 &cpu.sm_75,
310};
lib/std/target/powerpc.zig-44
......@@ -944,47 +944,3 @@ pub const cpu = struct {
944944 }),
945945 };
946946};
947
948/// All powerpc CPUs, sorted alphabetically by name.
949/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1
950/// compiler has inefficient memory and CPU usage, affecting build times.
951pub const all_cpus = &[_]*const CpuModel{
952 &cpu.@"440",
953 &cpu.@"450",
954 &cpu.@"601",
955 &cpu.@"602",
956 &cpu.@"603",
957 &cpu.@"603e",
958 &cpu.@"603ev",
959 &cpu.@"604",
960 &cpu.@"604e",
961 &cpu.@"620",
962 &cpu.@"7400",
963 &cpu.@"7450",
964 &cpu.@"750",
965 &cpu.@"970",
966 &cpu.a2,
967 &cpu.a2q,
968 &cpu.e500,
969 &cpu.e500mc,
970 &cpu.e5500,
971 &cpu.future,
972 &cpu.g3,
973 &cpu.g4,
974 &cpu.@"g4+",
975 &cpu.g5,
976 &cpu.generic,
977 &cpu.ppc,
978 &cpu.ppc32,
979 &cpu.ppc64,
980 &cpu.ppc64le,
981 &cpu.pwr3,
982 &cpu.pwr4,
983 &cpu.pwr5,
984 &cpu.pwr5x,
985 &cpu.pwr6,
986 &cpu.pwr6x,
987 &cpu.pwr7,
988 &cpu.pwr8,
989 &cpu.pwr9,
990};
lib/std/target/riscv.zig-10
......@@ -303,13 +303,3 @@ pub const cpu = struct {
303303 }),
304304 };
305305};
306
307/// All riscv CPUs, sorted alphabetically by name.
308/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1
309/// compiler has inefficient memory and CPU usage, affecting build times.
310pub const all_cpus = &[_]*const CpuModel{
311 &cpu.baseline_rv32,
312 &cpu.baseline_rv64,
313 &cpu.generic_rv32,
314 &cpu.generic_rv64,
315};
lib/std/target/sparc.zig-46
......@@ -448,49 +448,3 @@ pub const cpu = struct {
448448 }),
449449 };
450450};
451
452/// All sparc CPUs, sorted alphabetically by name.
453/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1
454/// compiler has inefficient memory and CPU usage, affecting build times.
455pub const all_cpus = &[_]*const CpuModel{
456 &cpu.at697e,
457 &cpu.at697f,
458 &cpu.f934,
459 &cpu.generic,
460 &cpu.gr712rc,
461 &cpu.gr740,
462 &cpu.hypersparc,
463 &cpu.leon2,
464 &cpu.leon3,
465 &cpu.leon4,
466 &cpu.ma2080,
467 &cpu.ma2085,
468 &cpu.ma2100,
469 &cpu.ma2150,
470 &cpu.ma2155,
471 &cpu.ma2450,
472 &cpu.ma2455,
473 &cpu.ma2480,
474 &cpu.ma2485,
475 &cpu.ma2x5x,
476 &cpu.ma2x8x,
477 &cpu.myriad2,
478 &cpu.myriad2_1,
479 &cpu.myriad2_2,
480 &cpu.myriad2_3,
481 &cpu.niagara,
482 &cpu.niagara2,
483 &cpu.niagara3,
484 &cpu.niagara4,
485 &cpu.sparclet,
486 &cpu.sparclite,
487 &cpu.sparclite86x,
488 &cpu.supersparc,
489 &cpu.tsc701,
490 &cpu.ultrasparc,
491 &cpu.ultrasparc3,
492 &cpu.ut699,
493 &cpu.v7,
494 &cpu.v8,
495 &cpu.v9,
496};
lib/std/target/systemz.zig-19
......@@ -532,22 +532,3 @@ pub const cpu = struct {
532532 }),
533533 };
534534};
535
536/// All systemz CPUs, sorted alphabetically by name.
537/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1
538/// compiler has inefficient memory and CPU usage, affecting build times.
539pub const all_cpus = &[_]*const CpuModel{
540 &cpu.arch10,
541 &cpu.arch11,
542 &cpu.arch12,
543 &cpu.arch13,
544 &cpu.arch8,
545 &cpu.arch9,
546 &cpu.generic,
547 &cpu.z10,
548 &cpu.z13,
549 &cpu.z14,
550 &cpu.z15,
551 &cpu.z196,
552 &cpu.zEC12,
553};
lib/std/target/wasm.zig-9
......@@ -104,12 +104,3 @@ pub const cpu = struct {
104104 .features = featureSet(&[_]Feature{}),
105105 };
106106};
107
108/// All wasm CPUs, sorted alphabetically by name.
109/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1
110/// compiler has inefficient memory and CPU usage, affecting build times.
111pub const all_cpus = &[_]*const CpuModel{
112 &cpu.bleeding_edge,
113 &cpu.generic,
114 &cpu.mvp,
115};
lib/std/target/x86.zig-85
......@@ -2943,88 +2943,3 @@ pub const cpu = struct {
29432943 }),
29442944 };
29452945};
2946
2947/// All x86 CPUs, sorted alphabetically by name.
2948/// TODO: Replace this with usage of `std.meta.declList`. It does work, but stage1
2949/// compiler has inefficient memory and CPU usage, affecting build times.
2950pub const all_cpus = &[_]*const CpuModel{
2951 &cpu.amdfam10,
2952 &cpu.athlon,
2953 &cpu.athlon_4,
2954 &cpu.athlon_fx,
2955 &cpu.athlon_mp,
2956 &cpu.athlon_tbird,
2957 &cpu.athlon_xp,
2958 &cpu.athlon64,
2959 &cpu.athlon64_sse3,
2960 &cpu.atom,
2961 &cpu.barcelona,
2962 &cpu.bdver1,
2963 &cpu.bdver2,
2964 &cpu.bdver3,
2965 &cpu.bdver4,
2966 &cpu.bonnell,
2967 &cpu.broadwell,
2968 &cpu.btver1,
2969 &cpu.btver2,
2970 &cpu.c3,
2971 &cpu.c3_2,
2972 &cpu.cannonlake,
2973 &cpu.cascadelake,
2974 &cpu.cooperlake,
2975 &cpu.core_avx_i,
2976 &cpu.core_avx2,
2977 &cpu.core2,
2978 &cpu.corei7,
2979 &cpu.corei7_avx,
2980 &cpu.generic,
2981 &cpu.geode,
2982 &cpu.goldmont,
2983 &cpu.goldmont_plus,
2984 &cpu.haswell,
2985 &cpu._i386,
2986 &cpu._i486,
2987 &cpu._i586,
2988 &cpu._i686,
2989 &cpu.icelake_client,
2990 &cpu.icelake_server,
2991 &cpu.ivybridge,
2992 &cpu.k6,
2993 &cpu.k6_2,
2994 &cpu.k6_3,
2995 &cpu.k8,
2996 &cpu.k8_sse3,
2997 &cpu.knl,
2998 &cpu.knm,
2999 &cpu.lakemont,
3000 &cpu.nehalem,
3001 &cpu.nocona,
3002 &cpu.opteron,
3003 &cpu.opteron_sse3,
3004 &cpu.penryn,
3005 &cpu.pentium,
3006 &cpu.pentium_m,
3007 &cpu.pentium_mmx,
3008 &cpu.pentium2,
3009 &cpu.pentium3,
3010 &cpu.pentium3m,
3011 &cpu.pentium4,
3012 &cpu.pentium4m,
3013 &cpu.pentiumpro,
3014 &cpu.prescott,
3015 &cpu.sandybridge,
3016 &cpu.silvermont,
3017 &cpu.skx,
3018 &cpu.skylake,
3019 &cpu.skylake_avx512,
3020 &cpu.slm,
3021 &cpu.tigerlake,
3022 &cpu.tremont,
3023 &cpu.westmere,
3024 &cpu.winchip_c6,
3025 &cpu.winchip2,
3026 &cpu.x86_64,
3027 &cpu.yonah,
3028 &cpu.znver1,
3029 &cpu.znver2,
3030};
test/stage1/behavior/type_info.zig+16
......@@ -409,3 +409,19 @@ test "type info: value is correctly copied" {
409409 expect(@typeInfo([]u32).Pointer.size == .Slice);
410410 }
411411}
412
413test "Declarations are returned in declaration order" {
414 const S = struct {
415 const a = 1;
416 const b = 2;
417 const c = 3;
418 const d = 4;
419 const e = 5;
420 };
421 const d = @typeInfo(S).Struct.decls;
422 expect(std.mem.eql(u8, d[0].name, "a"));
423 expect(std.mem.eql(u8, d[1].name, "b"));
424 expect(std.mem.eql(u8, d[2].name, "c"));
425 expect(std.mem.eql(u8, d[3].name, "d"));
426 expect(std.mem.eql(u8, d[4].name, "e"));
427}