linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* prefetchw()
@ 2021-06-27  3:31 Paul Campbell
  2021-06-27  3:44 ` prefetchw() Paul Campbell
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Campbell @ 2021-06-27  3:31 UTC (permalink / raw)
  To: linux-riscv

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
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: prefetchw()
  2021-06-27  3:31 prefetchw() Paul Campbell
@ 2021-06-27  3:44 ` Paul Campbell
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Campbell @ 2021-06-27  3:44 UTC (permalink / raw)
  To: linux-riscv

On Sunday, 27 June 2021 3:31:18 PM NZST Paul Campbell wrote:
> 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
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-27  3:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-27  3:31 prefetchw() Paul Campbell
2021-06-27  3:44 ` prefetchw() Paul Campbell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).