Re: prefetch seem don't work ?!
- From: Robert Redelmeier <redelm@xxxxxxxxxxxxxxx>
- Date: Sun, 23 Apr 2006 23:07:16 GMT
Claudio Daffra <spamtrap@xxxxxxxxxx> wrote in part:
I'm trying to use prefetch instrunction on AMD64 (939 3200+),
without result. I have compile program with gcc in two
different ways : - with prefetch instruction and without
but the time is same in both test and in other test.
Prefetch won't help much for simple calcs. It only permits calcs
to run in parallel with a fetch for later. With only an add,
you're totally fetch-bound and there isn't much to save.
how can improve this program ? [snippage]
for (i=0; i<LARGE_NUM; i++) a[i] = b[i] + c[i] ;
movlpd (%rax) , %xmm0
addsd (%rbx) , %xmm0
movsd %xmm0 , (%rcx)
You sould try MOVNTQ to store a[i]. This saves the cacheline
fetch, and you might get 25% time reduction.
-- Robert
.
- Follow-Ups:
- Re: prefetch seem don't work ?!
- From: Claudio Daffra
- Re: prefetch seem don't work ?!
- References:
- prefetch seem don't work ?!
- From: Claudio Daffra
- prefetch seem don't work ?!
- Prev by Date: Re: [Clax86list] Re: Linux assembly
- Next by Date: MASM question...
- Previous by thread: prefetch seem don't work ?!
- Next by thread: Re: prefetch seem don't work ?!
- Index(es):