ペンティアム4てG4より速いんですか?その2
■ このスレッドは過去ログ倉庫に格納されています
0561MACオタ>476 さん
02/06/14 01:45ID:Z/i4ULUdとりあえず,あなたが一生ベンチマークプログラムなんて書けないってことだけわ
解ったす(笑) 豚に真珠とわ思うすけど,STREAMの最適化わ次のようになっているす。
面倒なんでCopyルーチンだけすけど,
-----最適化なし-----
for (j=0; j<N; j++)
c[j] = a[j];
-----601opt-----
for (; j<N; j+= 8) {
double temp0, temp1, temp2, temp3;
double temp4, temp5, temp6, temp7;
double *atmp, *ctmp;
atmp = &a[j];
ctmp = &c[j];
temp0 = atmp[0];
temp1 = atmp[1];
temp2 = atmp[2];
temp3 = atmp[3];
__dcbt( (void *)atmp, 64 );
__dcbz( (void *)&ctmp[4], 0 );
temp4 = atmp[4];
temp5 = atmp[5];
__dcbt( (void *)&atmp[4], 64 );
__dcbz( (void *)ctmp, 0 );
temp6 = atmp[6];
temp7 = atmp[7];
ctmp[0] = temp0;
ctmp[1] = temp1;
ctmp[2] = temp2;
ctmp[3] = temp3;
ctmp[4] = temp4;
ctmp[5] = temp5;
ctmp[6] = temp6;
ctmp[7] = temp7;
}
PowerPCの__dcbzと__dcbtという命令で次に読み書きするキャッシュラインを先読み
しているす。
■ このスレッドは過去ログ倉庫に格納されています