Skip to content

Commit 35c21dd

Browse files
authored
Prefetch CHUNK size cache line ahead in loop (#4)
1 parent d79048c commit 35c21dd

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

rust-toolchain.toml

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/aarch64.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ pub fn encode_str<S: AsRef<str>>(input: S) -> String {
2222
while i + CHUNK <= n {
2323
let ptr = b.as_ptr().add(i);
2424

25-
/* ---- L1 prefetch: one cache line ahead ---- */
26-
core::arch::asm!("prfm pldl1keep, [{0}, #128]", in(reg) ptr);
25+
/* ---- L1 prefetch: CHUNK size ahead ---- */
26+
core::arch::asm!("prfm pldl1keep, [{0}, #64]", in(reg) ptr);
2727
/* ------------------------------------------ */
2828

2929
// load 64 B (four q-regs)

0 commit comments

Comments
 (0)