| author | |
| committer | |
| log | fdf19984b8af9781cd68dda3fcbcc44ac8ade80e |
| tree | b311b856fabfda36135aed3a37746c38c1ca320e |
| parent | b4d134a0d2ee238cab70f1e967b2172edbec1b41 |
5 files changed, 31 insertions(+), 3 deletions(-)
lib/std/Target.zig+18-2| ... | ... | @@ -53,6 +53,7 @@ pub const Os = struct { |
| 53 | 53 | ps3, |
| 54 | 54 | ps4, |
| 55 | 55 | ps5, |
| 56 | psp, | |
| 56 | 57 | vita, |
| 57 | 58 | |
| 58 | 59 | emscripten, |
| ... | ... | @@ -194,6 +195,7 @@ pub const Os = struct { |
| 194 | 195 | |
| 195 | 196 | .@"3ds", |
| 196 | 197 | |
| 198 | .psp, | |
| 197 | 199 | .vita, |
| 198 | 200 | |
| 199 | 201 | .wasi, |
| ... | ... | @@ -612,6 +614,13 @@ pub const Os = struct { |
| 612 | 614 | }, |
| 613 | 615 | }, |
| 614 | 616 | |
| 617 | .psp => .{ | |
| 618 | .semver = .{ | |
| 619 | .min = .{ .major = 1, .minor = 0, .patch = 0 }, | |
| 620 | .max = .{ .major = 6, .minor = 61, .patch = 0 }, | |
| 621 | }, | |
| 622 | }, | |
| 623 | ||
| 615 | 624 | .vita => .{ |
| 616 | 625 | .semver = .{ |
| 617 | 626 | // 1.3 is the first public release |
| ... | ... | @@ -919,6 +928,7 @@ pub const Abi = enum { |
| 919 | 928 | .tvos, |
| 920 | 929 | .visionos, |
| 921 | 930 | .watchos, |
| 931 | .psp, | |
| 922 | 932 | .ps3, |
| 923 | 933 | .ps4, |
| 924 | 934 | .ps5, |
| ... | ... | @@ -2023,7 +2033,10 @@ pub const Cpu = struct { |
| 2023 | 2033 | .lanai => &lanai.cpu.v11, // clang does not have a generic lanai model. |
| 2024 | 2034 | .loongarch64 => &loongarch.cpu.la64v1_0, |
| 2025 | 2035 | .m68k => &m68k.cpu.M68000, |
| 2026 | .mips, .mipsel => &mips.cpu.mips32r2, | |
| 2036 | .mips, .mipsel => switch (os.tag) { | |
| 2037 | .psp => &mips.cpu.mips2, // mips2 with some custom instructions, no trap instructions | |
| 2038 | else => &mips.cpu.mips32r2, | |
| 2039 | }, | |
| 2027 | 2040 | .mips64, .mips64el => &mips.cpu.mips64r2, |
| 2028 | 2041 | .msp430 => &msp430.cpu.msp430, |
| 2029 | 2042 | .nvptx, .nvptx64 => &nvptx.cpu.sm_52, |
| ... | ... | @@ -2204,6 +2217,7 @@ pub fn requiresLibC(target: *const Target) bool { |
| 2204 | 2217 | .amdhsa, |
| 2205 | 2218 | .ps4, |
| 2206 | 2219 | .ps5, |
| 2220 | .psp, | |
| 2207 | 2221 | .vita, |
| 2208 | 2222 | .mesa3d, |
| 2209 | 2223 | .contiki, |
| ... | ... | @@ -2379,6 +2393,7 @@ pub const DynamicLinker = struct { |
| 2379 | 2393 | .ps3, |
| 2380 | 2394 | .ps4, |
| 2381 | 2395 | .ps5, |
| 2396 | .psp, | |
| 2382 | 2397 | .vita, |
| 2383 | 2398 | => .none, |
| 2384 | 2399 | }; |
| ... | ... | @@ -2783,6 +2798,7 @@ pub const DynamicLinker = struct { |
| 2783 | 2798 | |
| 2784 | 2799 | .@"3ds", |
| 2785 | 2800 | |
| 2801 | .psp, | |
| 2786 | 2802 | .vita, |
| 2787 | 2803 | |
| 2788 | 2804 | .emscripten, |
| ... | ... | @@ -3338,7 +3354,7 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 { |
| 3338 | 3354 | .longlong, .ulonglong, .double => return 64, |
| 3339 | 3355 | .longdouble => return 80, |
| 3340 | 3356 | }, |
| 3341 | .vita => switch (c_type) { | |
| 3357 | .psp, .vita => switch (c_type) { | |
| 3342 | 3358 | .char => return 8, |
| 3343 | 3359 | .short, .ushort => return 16, |
| 3344 | 3360 | .int, .uint, .float => return 32, |
lib/std/heap.zig+10| ... | ... | @@ -805,6 +805,11 @@ const page_size_min_default: ?usize = switch (builtin.os.tag) { |
| 805 | 805 | .x86, .x86_64 => 16 << 10, |
| 806 | 806 | else => null, |
| 807 | 807 | }, |
| 808 | .psp => switch (builtin.cpu.arch) { | |
| 809 | // minimum block allocation by testing sceKernel | |
| 810 | .mips, .mipsel => 1 << 8, // 256 | |
| 811 | else => null, | |
| 812 | }, | |
| 808 | 813 | // system/lib/libc/musl/arch/emscripten/bits/limits.h |
| 809 | 814 | .emscripten => 64 << 10, |
| 810 | 815 | .linux => switch (builtin.cpu.arch) { |
| ... | ... | @@ -963,6 +968,11 @@ const page_size_max_default: ?usize = switch (builtin.os.tag) { |
| 963 | 968 | .x86, .x86_64 => 16 << 10, |
| 964 | 969 | else => null, |
| 965 | 970 | }, |
| 971 | .psp => switch (builtin.cpu.arch) { | |
| 972 | // minimum block allocation by testing sceKernel | |
| 973 | .mips, .mipsel => 1 << 8, // 256 | |
| 974 | else => null, | |
| 975 | }, | |
| 966 | 976 | // system/lib/libc/musl/arch/emscripten/bits/limits.h |
| 967 | 977 | .emscripten => 64 << 10, |
| 968 | 978 | .linux => switch (builtin.cpu.arch) { |
lib/std/start.zig+1-1| ... | ... | @@ -65,7 +65,7 @@ comptime { |
| 65 | 65 | // case it's not required to provide an entrypoint such as main. |
| 66 | 66 | if (!@hasDecl(root, start_sym_name) and @hasDecl(root, "main")) @export(&wasm_freestanding_start, .{ .name = start_sym_name }); |
| 67 | 67 | } else switch (native_os) { |
| 68 | .other, .freestanding, .@"3ds", .vita => {}, | |
| 68 | .other, .freestanding, .@"3ds", .psp, .vita => {}, | |
| 69 | 69 | else => if (!@hasDecl(root, start_sym_name)) @export(&_start, .{ .name = start_sym_name }), |
| 70 | 70 | } |
| 71 | 71 | } |
src/Compilation.zig+1| ... | ... | @@ -6420,6 +6420,7 @@ fn addCommonCCArgs( |
| 6420 | 6420 | .illumos => try argv.append("__illumos__"), |
| 6421 | 6421 | // Homebrew targets without LLVM support; use communities's preferred macros. |
| 6422 | 6422 | .@"3ds" => try argv.append("-D__3DS__"), |
| 6423 | .psp => try argv.append("-D__PSP__"), | |
| 6423 | 6424 | .vita => try argv.append("-D__vita__"), |
| 6424 | 6425 | else => {}, |
| 6425 | 6426 | } |
src/codegen/llvm.zig+1| ... | ... | @@ -247,6 +247,7 @@ pub fn targetTriple(allocator: Allocator, target: *const std.Target) ![]const u8 |
| 247 | 247 | .opengl, |
| 248 | 248 | .other, |
| 249 | 249 | .plan9, |
| 250 | .psp, | |
| 250 | 251 | .vita, |
| 251 | 252 | => "unknown", |
| 252 | 253 | }; |