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 {
2828 .aarch64, .aarch64_be => true,
2929 else => false,
3030 };
31 const loongarch64 = switch (arch) {
32 .loongarch64 => true,
31 const loongarch = switch (arch) {
32 .loongarch32,
33 .loongarch64,
34 => true,
3335 else => false,
3436 };
3537 const mips = switch (arch) {
......@@ -163,7 +165,7 @@ fn clear_cache(start: usize, end: usize) callconv(.C) void {
163165 // On Darwin, sys_icache_invalidate() provides this functionality
164166 sys_icache_invalidate(start, end - start);
165167 exportIt();
166 } else if (os == .linux and loongarch64) {
168 } else if (os == .linux and loongarch) {
167169 // See: https://github.com/llvm/llvm-project/blob/cf54cae26b65fc3201eff7200ffb9b0c9e8f9a13/compiler-rt/lib/builtins/clear_cache.c#L94-L95
168170 asm volatile (
169171 \\ ibar 0