authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-10-16 01:05:27+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-10-16 01:10:35+02:00
logdd983e12aa31a55c07f00984f0d830f6ce5cd4da
treeeb0c72c269bc38de7d3d5703c3e0bbc583342b28
parentf5beb50619579081c6a49a10f1572958dd2ec8f6
signature Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

compiler-rt: Use loongarch clear_cache() implementation for loongarch32 too.


1 files changed, 5 insertions(+), 3 deletions(-)

lib/compiler_rt/clear_cache.zig+5-3
...@@ -28,8 +28,10 @@ fn clear_cache(start: usize, end: usize) callconv(.C) void {...@@ -28,8 +28,10 @@ fn clear_cache(start: usize, end: usize) callconv(.C) void {
28 .aarch64, .aarch64_be => true,28 .aarch64, .aarch64_be => true,
29 else => false,29 else => false,
30 };30 };
31 const loongarch64 = switch (arch) {31 const loongarch = switch (arch) {
32 .loongarch64 => true,32 .loongarch32,
33 .loongarch64,
34 => true,
33 else => false,35 else => false,
34 };36 };
35 const mips = switch (arch) {37 const mips = switch (arch) {
...@@ -163,7 +165,7 @@ fn clear_cache(start: usize, end: usize) callconv(.C) void {...@@ -163,7 +165,7 @@ fn clear_cache(start: usize, end: usize) callconv(.C) void {
163 // On Darwin, sys_icache_invalidate() provides this functionality165 // On Darwin, sys_icache_invalidate() provides this functionality
164 sys_icache_invalidate(start, end - start);166 sys_icache_invalidate(start, end - start);
165 exportIt();167 exportIt();
166 } else if (os == .linux and loongarch64) {168 } else if (os == .linux and loongarch) {
167 // See: https://github.com/llvm/llvm-project/blob/cf54cae26b65fc3201eff7200ffb9b0c9e8f9a13/compiler-rt/lib/builtins/clear_cache.c#L94-L95169 // See: https://github.com/llvm/llvm-project/blob/cf54cae26b65fc3201eff7200ffb9b0c9e8f9a13/compiler-rt/lib/builtins/clear_cache.c#L94-L95
168 asm volatile (170 asm volatile (
169 \\ ibar 0171 \\ ibar 0