Skip to contentSkip to conversation

prefetchw()

DISCUSSION Paul Campbell 1 participant 2 messages Jun 27, 2021 RISC-V

lore
Share & tools
lore
#1 lore raw
Quoted 8 lines · NZST Paul Campbell

i noticed today that __builtin_prefetch() emits nothing (at least in my gcc)

i wonder if it makes sense to do this for riscv linux?

static inline void prefetchw( volatile void *addr)

{
        asm volatile("lb x0, 0(%0)" : : "r" (addr));
}

I should add that gcc __builtin_prefetch() promises not to fault while the kernel prefetchw(), from my quick look through the code doesn't seem to depend on that (in fact loops get unrolled in places to make sure)

Paul

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv