authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-10-02 08:13:50+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-10-03 09:12:35+02:00
log6dd19961b3f274728f57e15c10ad517d129ffcf9
treea6e7b0072a2eda8587c45ba472ec02720f7cf15e
parentc560e26fb7f7aee4f4a998970c1b7a73b3cae2ca
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.atomic: Provide a more accurate cache_line value for hexagon v73+.


1 files changed, 4 insertions(+), 2 deletions(-)

lib/std/atomic.zig+4-2
......@@ -459,18 +459,20 @@ pub const cache_line = switch (builtin.cpu.arch) {
459459 .powerpc64le,
460460 => 128,
461461
462 // https://github.com/llvm/llvm-project/blob/e379094328e49731a606304f7e3559d4f1fa96f9/clang/lib/Basic/Targets/Hexagon.h#L145-L151
463 .hexagon,
464 => if (std.Target.hexagon.featureSetHas(builtin.target.cpu.features, .v73)) 64 else 32,
465
462466 // - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_arm.go#L7
463467 // - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_mips.go#L7
464468 // - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_mipsle.go#L7
465469 // - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_mips64x.go#L9
466470 // - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_riscv64.go#L7
467 // - https://github.com/torvalds/linux/blob/3a7e02c040b130b5545e4b115aada7bacd80a2b6/arch/hexagon/include/asm/cache.h#L13
468471 // - https://github.com/torvalds/linux/blob/3a7e02c040b130b5545e4b115aada7bacd80a2b6/arch/sparc/include/asm/cache.h#L14
469472 .arm,
470473 .armeb,
471474 .thumb,
472475 .thumbeb,
473 .hexagon,
474476 .mips,
475477 .mipsel,
476478 .mips64,