| ... | @@ -429,26 +429,61 @@ pub const cache_line = switch (builtin.cpu.arch) { | ... | @@ -429,26 +429,61 @@ pub const cache_line = switch (builtin.cpu.arch) { |
| 429 | // - https://www.mono-project.com/news/2016/09/12/arm64-icache/ | 429 | // - https://www.mono-project.com/news/2016/09/12/arm64-icache/ |
| 430 | // - https://cpufun.substack.com/p/more-m1-fun-hardware-information | 430 | // - https://cpufun.substack.com/p/more-m1-fun-hardware-information |
| 431 | // | 431 | // |
| 432 | // powerpc64: PPC has 128-byte cache lines | 432 | // - https://github.com/torvalds/linux/blob/3a7e02c040b130b5545e4b115aada7bacd80a2b6/arch/arc/Kconfig#L212 |
| 433 | // - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_ppc64x.go#L9 | 433 | // - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_ppc64x.go#L9 |
| 434 | .x86_64, .aarch64, .powerpc64 => 128, | 434 | .x86_64, |
| | 435 | .aarch64, |
| | 436 | .aarch64_be, |
| | 437 | .arc, |
| | 438 | .powerpc64, |
| | 439 | .powerpc64le, |
| | 440 | => 128, |
| 435 | | 441 | |
| 436 | // These platforms reportedly have 32-byte cache lines | | |
| 437 | // - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_arm.go#L7 | 442 | // - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_arm.go#L7 |
| 438 | // - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_mips.go#L7 | 443 | // - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_mips.go#L7 |
| 439 | // - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_mipsle.go#L7 | 444 | // - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_mipsle.go#L7 |
| 440 | // - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_mips64x.go#L9 | 445 | // - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_mips64x.go#L9 |
| 441 | // - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_riscv64.go#L7 | 446 | // - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_riscv64.go#L7 |
| 442 | .arm, .mips, .mips64, .riscv64 => 32, | 447 | // - https://github.com/torvalds/linux/blob/3a7e02c040b130b5545e4b115aada7bacd80a2b6/arch/hexagon/include/asm/cache.h#L13 |
| | 448 | // - https://github.com/torvalds/linux/blob/3a7e02c040b130b5545e4b115aada7bacd80a2b6/arch/sparc/include/asm/cache.h#L14 |
| | 449 | .arm, |
| | 450 | .armeb, |
| | 451 | .thumb, |
| | 452 | .thumbeb, |
| | 453 | .hexagon, |
| | 454 | .mips, |
| | 455 | .mipsel, |
| | 456 | .mips64, |
| | 457 | .mips64el, |
| | 458 | .riscv32, |
| | 459 | .riscv64, |
| | 460 | .sparc, |
| | 461 | .sparcel, |
| | 462 | .sparc64, |
| | 463 | => 32, |
| | 464 | |
| | 465 | // - https://github.com/torvalds/linux/blob/3a7e02c040b130b5545e4b115aada7bacd80a2b6/arch/m68k/include/asm/cache.h#L10 |
| | 466 | .m68k, |
| | 467 | => 16, |
| | 468 | |
| | 469 | // - https://www.ti.com/lit/pdf/slaa498 |
| | 470 | .msp430, |
| | 471 | => 8, |
| 443 | | 472 | |
| 444 | // This platform reportedly has 256-byte cache lines | | |
| 445 | // - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_s390x.go#L7 | 473 | // - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_s390x.go#L7 |
| 446 | .s390x => 256, | 474 | // - https://sxauroratsubasa.sakura.ne.jp/documents/guide/pdfs/Aurora_ISA_guide.pdf |
| | 475 | .s390x, |
| | 476 | .ve, |
| | 477 | => 256, |
| 447 | | 478 | |
| 448 | // Other x86 and WASM platforms have 64-byte cache lines. | 479 | // Other x86 and WASM platforms have 64-byte cache lines. |
| 449 | // The rest of the architectures are assumed to be similar. | 480 | // The rest of the architectures are assumed to be similar. |
| 450 | // - https://github.com/golang/go/blob/dda2991c2ea0c5914714469c4defc2562a907230/src/internal/cpu/cpu_x86.go#L9 | 481 | // - https://github.com/golang/go/blob/dda2991c2ea0c5914714469c4defc2562a907230/src/internal/cpu/cpu_x86.go#L9 |
| | 482 | // - https://github.com/golang/go/blob/0a9321ad7f8c91e1b0c7184731257df923977eb9/src/internal/cpu/cpu_loong64.go#L11 |
| 451 | // - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_wasm.go#L7 | 483 | // - https://github.com/golang/go/blob/3dd58676054223962cd915bb0934d1f9f489d4d2/src/internal/cpu/cpu_wasm.go#L7 |
| | 484 | // - https://github.com/torvalds/linux/blob/3a7e02c040b130b5545e4b115aada7bacd80a2b6/arch/xtensa/variants/csp/include/variant/core.h#L209 |
| | 485 | // - https://github.com/torvalds/linux/blob/3a7e02c040b130b5545e4b115aada7bacd80a2b6/arch/csky/Kconfig#L183 |
| | 486 | // - https://www.xmos.com/download/The-XMOS-XS3-Architecture.pdf |
| 452 | else => 64, | 487 | else => 64, |
| 453 | }; | 488 | }; |
| 454 | | 489 | |