prefetchw()
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));
}Paul
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
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