prefetching
From: Christian Lande (IIZUXMKQOEHH_at_spammotel.com)
Date: 04/17/04
- Next message: elekis: "how is range on hard disk???"
- Previous message: elekis: "Re: a little probleme"
- Next in thread: Siberian Husky: "Re: prefetching"
- Reply: Siberian Husky: "Re: prefetching"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 17 Apr 2004 17:31:52 +0000 (UTC)
Hi,
playing arroud with some SSE commands I saw that some are confusing me.
I want to try the PREFETCHx ones. In this way I wrote a little gcc programm
(for XEON with Linux), which goes through an array (backward to prefent from
hardware prefetching), but whatever I do, prefetching don't want to bring
any gain in time.
Here is the code:
int a,b,c,d;
int *feld;
int size = 16777216;
feld = (int*)calloc(size+200,sizeof(int));
int block=16;
int *p;
for (d=size-block-1;d>=0;d-=block) {
p = &feld[d-(1*block)]; // <---------- (1)
asm("PREFETCHT0 %0 \n\t" : : "m" (p)); // <---------- (2)
for (b=0;b<100;b++) { // <---------- (3)
for (c=d;c<d+block;c+=8) {
feld[c]++;
feld[c+1]++;
feld[c+2]++;
feld[c+3]++;
feld[c+4]++;
feld[c+5]++;
feld[c+6]++;
feld[c+7]++;
}
}
}
The marked lines (1), (2) and (3) are the interesting ones.Whatever I do,
in (1), e.g. 2*block or 3*block
in (2), e.g. PREFETCHT1, PREFETCHT2
in (3), increasing number of passes
nothing helps. Working time is always near the same (at the moment I measure
with "time <prog>"). If anybody knows a bether methode for measuring, please
let me know.
Possibly somebody with more experience can give me some tips why it doesn't
work or how I can make it work.
Many thanks,
ChL
- Next message: elekis: "how is range on hard disk???"
- Previous message: elekis: "Re: a little probleme"
- Next in thread: Siberian Husky: "Re: prefetching"
- Reply: Siberian Husky: "Re: prefetching"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|