| author | |
| committer | |
| log | bdd3bc056ee998770ea48a93b4ec99521f069aed |
| tree | 761f67d3d1ef3f9d98678abe859b4f8abe889463 |
| parent | ecd5878b74940852e8a63154aba165047bca0e0a |
| parent | 7a3626d1c683aff6ba048bee19622a6a02df334a |
| signature |
Some miscellaneous LoongArch port work5 files changed, 13 insertions(+), 11 deletions(-)
lib/compiler_rt/clear_cache.zig+5-3| ... | ... | @@ -28,8 +28,10 @@ fn clear_cache(start: usize, end: usize) callconv(.C) void { |
| 28 | 28 | .aarch64, .aarch64_be => true, |
| 29 | 29 | else => false, |
| 30 | 30 | }; |
| 31 | const loongarch64 = switch (arch) { | |
| 32 | .loongarch64 => true, | |
| 31 | const loongarch = switch (arch) { | |
| 32 | .loongarch32, | |
| 33 | .loongarch64, | |
| 34 | => true, | |
| 33 | 35 | else => false, |
| 34 | 36 | }; |
| 35 | 37 | const mips = switch (arch) { |
| ... | ... | @@ -163,7 +165,7 @@ fn clear_cache(start: usize, end: usize) callconv(.C) void { |
| 163 | 165 | // On Darwin, sys_icache_invalidate() provides this functionality |
| 164 | 166 | sys_icache_invalidate(start, end - start); |
| 165 | 167 | exportIt(); |
| 166 | } else if (os == .linux and loongarch64) { | |
| 168 | } else if (os == .linux and loongarch) { | |
| 167 | 169 | // See: https://github.com/llvm/llvm-project/blob/cf54cae26b65fc3201eff7200ffb9b0c9e8f9a13/compiler-rt/lib/builtins/clear_cache.c#L94-L95 |
| 168 | 170 | asm volatile ( |
| 169 | 171 | \\ ibar 0 |
lib/std/Target.zig+2-2| ... | ... | @@ -2711,7 +2711,6 @@ pub fn cTypeAlignment(target: Target, c_type: CType) u16 { |
| 2711 | 2711 | .csky, |
| 2712 | 2712 | .x86, |
| 2713 | 2713 | .xcore, |
| 2714 | .loongarch32, | |
| 2715 | 2714 | .kalimba, |
| 2716 | 2715 | .spu_2, |
| 2717 | 2716 | .xtensa, |
| ... | ... | @@ -2735,6 +2734,7 @@ pub fn cTypeAlignment(target: Target, c_type: CType) u16 { |
| 2735 | 2734 | |
| 2736 | 2735 | .aarch64, |
| 2737 | 2736 | .aarch64_be, |
| 2737 | .loongarch32, | |
| 2738 | 2738 | .loongarch64, |
| 2739 | 2739 | .mips64, |
| 2740 | 2740 | .mips64el, |
| ... | ... | @@ -2815,7 +2815,6 @@ pub fn cTypePreferredAlignment(target: Target, c_type: CType) u16 { |
| 2815 | 2815 | |
| 2816 | 2816 | .csky, |
| 2817 | 2817 | .xcore, |
| 2818 | .loongarch32, | |
| 2819 | 2818 | .kalimba, |
| 2820 | 2819 | .spu_2, |
| 2821 | 2820 | .xtensa, |
| ... | ... | @@ -2845,6 +2844,7 @@ pub fn cTypePreferredAlignment(target: Target, c_type: CType) u16 { |
| 2845 | 2844 | |
| 2846 | 2845 | .aarch64, |
| 2847 | 2846 | .aarch64_be, |
| 2847 | .loongarch32, | |
| 2848 | 2848 | .loongarch64, |
| 2849 | 2849 | .mips64, |
| 2850 | 2850 | .mips64el, |
lib/std/Thread.zig+1-1| ... | ... | @@ -1338,7 +1338,7 @@ const LinuxThreadImpl = struct { |
| 1338 | 1338 | [len] "r" (self.mapped.len), |
| 1339 | 1339 | : "memory" |
| 1340 | 1340 | ), |
| 1341 | .loongarch64 => asm volatile ( | |
| 1341 | .loongarch32, .loongarch64 => asm volatile ( | |
| 1342 | 1342 | \\ or $a0, $zero, %[ptr] |
| 1343 | 1343 | \\ or $a1, $zero, %[len] |
| 1344 | 1344 | \\ ori $a7, $zero, 215 # SYS_munmap |
src/codegen/llvm.zig+5-1| ... | ... | @@ -520,6 +520,7 @@ const DataLayoutBuilder = struct { |
| 520 | 520 | .arm, |
| 521 | 521 | .armeb, |
| 522 | 522 | .csky, |
| 523 | .loongarch32, | |
| 523 | 524 | .mips, |
| 524 | 525 | .mipsel, |
| 525 | 526 | .powerpc, |
| ... | ... | @@ -535,6 +536,7 @@ const DataLayoutBuilder = struct { |
| 535 | 536 | .amdgcn, |
| 536 | 537 | .bpfeb, |
| 537 | 538 | .bpfel, |
| 539 | .loongarch64, | |
| 538 | 540 | .mips64, |
| 539 | 541 | .mips64el, |
| 540 | 542 | .powerpc64, |
| ... | ... | @@ -554,7 +556,6 @@ const DataLayoutBuilder = struct { |
| 554 | 556 | .nvptx64, |
| 555 | 557 | => &.{ 16, 32, 64 }, |
| 556 | 558 | .x86_64 => &.{ 8, 16, 32, 64 }, |
| 557 | .loongarch64 => &.{64}, | |
| 558 | 559 | else => &.{}, |
| 559 | 560 | }), 0..) |natural, index| switch (index) { |
| 560 | 561 | 0 => try writer.print("-n{d}", .{natural}), |
| ... | ... | @@ -12452,6 +12453,9 @@ fn backendSupportsF80(target: std.Target) bool { |
| 12452 | 12453 | /// if it produces miscompilations. |
| 12453 | 12454 | fn backendSupportsF16(target: std.Target) bool { |
| 12454 | 12455 | return switch (target.cpu.arch) { |
| 12456 | // LoongArch can be removed from this list with LLVM 20. | |
| 12457 | .loongarch32, | |
| 12458 | .loongarch64, | |
| 12455 | 12459 | .hexagon, |
| 12456 | 12460 | .powerpc, |
| 12457 | 12461 | .powerpcle, |
test/llvm_targets.zig-4| ... | ... | @@ -108,10 +108,6 @@ const targets = [_]std.Target.Query{ |
| 108 | 108 | .{ .cpu_arch = .lanai, .os_tag = .freestanding, .abi = .none }, |
| 109 | 109 | |
| 110 | 110 | .{ .cpu_arch = .loongarch32, .os_tag = .freestanding, .abi = .none }, |
| 111 | .{ .cpu_arch = .loongarch32, .os_tag = .linux, .abi = .gnu }, | |
| 112 | .{ .cpu_arch = .loongarch32, .os_tag = .linux, .abi = .gnuf32 }, | |
| 113 | .{ .cpu_arch = .loongarch32, .os_tag = .linux, .abi = .gnusf }, | |
| 114 | .{ .cpu_arch = .loongarch32, .os_tag = .linux, .abi = .musl }, | |
| 115 | 111 | .{ .cpu_arch = .loongarch32, .os_tag = .linux, .abi = .none }, |
| 116 | 112 | .{ .cpu_arch = .loongarch32, .os_tag = .uefi, .abi = .none }, |
| 117 | 113 |