| ... | ... | @@ -50,6 +50,7 @@ pub const Os = struct { |
| 50 | 50 | |
| 51 | 51 | @"3ds", |
| 52 | 52 | wiiu, |
| 53 | @"switch", |
| 53 | 54 | |
| 54 | 55 | psx, |
| 55 | 56 | ps3, |
| ... | ... | @@ -74,14 +75,6 @@ pub const Os = struct { |
| 74 | 75 | |
| 75 | 76 | ashetos, |
| 76 | 77 | |
| 77 | | // LLVM tags deliberately omitted: |
| 78 | | // - bridgeos |
| 79 | | // - cheriotrtos |
| 80 | | // - darwin |
| 81 | | // - kfreebsd |
| 82 | | // - nacl |
| 83 | | // - shadermodel |
| 84 | | |
| 85 | 78 | pub inline fn isDarwin(tag: Tag) bool { |
| 86 | 79 | return switch (tag) { |
| 87 | 80 | .driverkit, |
| ... | ... | @@ -204,6 +197,7 @@ pub const Os = struct { |
| 204 | 197 | |
| 205 | 198 | .@"3ds", |
| 206 | 199 | .wiiu, |
| 200 | .@"switch", |
| 207 | 201 | |
| 208 | 202 | .psp, |
| 209 | 203 | .vita, |
| ... | ... | @@ -640,6 +634,13 @@ pub const Os = struct { |
| 640 | 634 | }, |
| 641 | 635 | }, |
| 642 | 636 | |
| 637 | .@"switch" => .{ |
| 638 | .semver = .{ |
| 639 | .min = .{ .major = 1, .minor = 0, .patch = 0 }, |
| 640 | .max = .{ .major = 22, .minor = 5, .patch = 0 }, |
| 641 | }, |
| 642 | }, |
| 643 | |
| 643 | 644 | .psp => .{ |
| 644 | 645 | .semver = .{ |
| 645 | 646 | // https://www.psdevwiki.com/psp/Official_Firmware_(OFW)#1.XX_Kernel |
| ... | ... | @@ -825,33 +826,6 @@ pub const Abi = enum { |
| 825 | 826 | ohoseabi, |
| 826 | 827 | call0, |
| 827 | 828 | |
| 828 | | // LLVM tags deliberately omitted: |
| 829 | | // - amplification |
| 830 | | // - anyhit |
| 831 | | // - callable |
| 832 | | // - closesthit |
| 833 | | // - compute |
| 834 | | // - coreclr |
| 835 | | // - domain |
| 836 | | // - geometry |
| 837 | | // - gnueabit64 |
| 838 | | // - gnueabihft64 |
| 839 | | // - gnuf64 |
| 840 | | // - gnut64 |
| 841 | | // - hull |
| 842 | | // - intersection |
| 843 | | // - library |
| 844 | | // - llvm |
| 845 | | // - mesh |
| 846 | | // - miss |
| 847 | | // - mlibc |
| 848 | | // - mtia |
| 849 | | // - pauthtest |
| 850 | | // - pixel |
| 851 | | // - raygeneration |
| 852 | | // - rootsignature |
| 853 | | // - vertex |
| 854 | | |
| 855 | 829 | pub fn default(arch: Cpu.Arch, os_tag: Os.Tag) Abi { |
| 856 | 830 | return switch (os_tag) { |
| 857 | 831 | .freestanding, .other => switch (arch) { |
| ... | ... | @@ -979,6 +953,7 @@ pub const Abi = enum { |
| 979 | 953 | .tvos, |
| 980 | 954 | .visionos, |
| 981 | 955 | .watchos, |
| 956 | .@"switch", |
| 982 | 957 | .ps3, |
| 983 | 958 | .ps4, |
| 984 | 959 | .ps5, |
| ... | ... | @@ -1079,9 +1054,6 @@ pub const ObjectFormat = enum { |
| 1079 | 1054 | /// The WebAssembly binary format. |
| 1080 | 1055 | wasm, |
| 1081 | 1056 | |
| 1082 | | // LLVM tags deliberately omitted: |
| 1083 | | // - dxcontainer |
| 1084 | | |
| 1085 | 1057 | pub fn fileExt(of: ObjectFormat, arch: Cpu.Arch) [:0]const u8 { |
| 1086 | 1058 | return switch (of) { |
| 1087 | 1059 | .c => ".c", |
| ... | ... | @@ -1439,24 +1411,6 @@ pub const Cpu = struct { |
| 1439 | 1411 | xtensa, |
| 1440 | 1412 | xtensaeb, |
| 1441 | 1413 | |
| 1442 | | // LLVM tags deliberately omitted: |
| 1443 | | // - aarch64_32 |
| 1444 | | // - amdil |
| 1445 | | // - amdil64 |
| 1446 | | // - dxil |
| 1447 | | // - r600 |
| 1448 | | // - hsail |
| 1449 | | // - hsail64 |
| 1450 | | // - renderscript32 |
| 1451 | | // - renderscript64 |
| 1452 | | // - shave |
| 1453 | | // - sparcel |
| 1454 | | // - spir |
| 1455 | | // - spir64 |
| 1456 | | // - spirv |
| 1457 | | // - tce |
| 1458 | | // - tcele |
| 1459 | | |
| 1460 | 1414 | /// An architecture family can encompass multiple architectures as represented by `Arch`. |
| 1461 | 1415 | /// For a given family tag, it is guaranteed that an `std.Target.<tag>` namespace exists |
| 1462 | 1416 | /// containing CPU model and feature data. |
| ... | ... | @@ -2096,6 +2050,7 @@ pub const Cpu = struct { |
| 2096 | 2050 | .ios, .tvos => &aarch64.cpu.apple_a7, |
| 2097 | 2051 | .visionos => &aarch64.cpu.apple_m2, |
| 2098 | 2052 | .watchos => &aarch64.cpu.apple_s4, |
| 2053 | .@"switch" => &aarch64.cpu.cortex_a57, |
| 2099 | 2054 | else => generic(arch), |
| 2100 | 2055 | }, |
| 2101 | 2056 | .avr => &avr.cpu.avr2, |
| ... | ... | @@ -2327,8 +2282,9 @@ pub fn requiresLibC(target: *const Target) bool { |
| 2327 | 2282 | .plan9, |
| 2328 | 2283 | .other, |
| 2329 | 2284 | .@"3ds", |
| 2330 | | .tios, |
| 2331 | 2285 | .wiiu, |
| 2286 | .@"switch", |
| 2287 | .tios, |
| 2332 | 2288 | .ashetos, |
| 2333 | 2289 | => false, |
| 2334 | 2290 | }; |
| ... | ... | @@ -2477,6 +2433,7 @@ pub const DynamicLinker = struct { |
| 2477 | 2433 | |
| 2478 | 2434 | .@"3ds", |
| 2479 | 2435 | .wiiu, |
| 2436 | .@"switch", |
| 2480 | 2437 | |
| 2481 | 2438 | .emscripten, |
| 2482 | 2439 | .wasi, |
| ... | ... | @@ -2696,7 +2653,6 @@ pub const DynamicLinker = struct { |
| 2696 | 2653 | .or1k, |
| 2697 | 2654 | => |arch| if (abi == .gnu) initFmt("/lib/ld-linux-{s}.so.1", .{@tagName(arch)}) else none, |
| 2698 | 2655 | |
| 2699 | | // TODO: `-be` architecture support. |
| 2700 | 2656 | .csky => initFmt("/lib/ld-linux-cskyv2{s}.so.1", .{switch (abi) { |
| 2701 | 2657 | .gnueabi => "", |
| 2702 | 2658 | .gnueabihf => "-hf", |
| ... | ... | @@ -2902,6 +2858,7 @@ pub const DynamicLinker = struct { |
| 2902 | 2858 | |
| 2903 | 2859 | .@"3ds", |
| 2904 | 2860 | .wiiu, |
| 2861 | .@"switch", |
| 2905 | 2862 | |
| 2906 | 2863 | .psx, |
| 2907 | 2864 | .psp, |
| ... | ... | @@ -3467,6 +3424,14 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 { |
| 3467 | 3424 | .longlong, .ulonglong, .double, .longdouble => return 64, |
| 3468 | 3425 | }, |
| 3469 | 3426 | |
| 3427 | .@"switch" => switch (c_type) { |
| 3428 | .char => return 8, |
| 3429 | .short, .ushort => return 16, |
| 3430 | .int, .uint, .float => return 32, |
| 3431 | .long, .ulong, .longlong, .ulonglong, .double => return 64, |
| 3432 | .longdouble => return 128, |
| 3433 | }, |
| 3434 | |
| 3470 | 3435 | .psx => switch (c_type) { |
| 3471 | 3436 | .char => return 8, |
| 3472 | 3437 | .short, .ushort => return 16, |