Digital Mars C++ コンパイラでアセンブリを学習し、インライン化を行っています。プログラムを改善するためにいくつかのことを検索し、プログラムを調整するためにこれらのパラメーターを用意しました。
use better C++ compiler//thinking of GCC or intel compiler
use assembly only in critical part of program
find better algorithm
Cache miss, cache contention.
Loop-carried dependency chain.
Instruction fetching time.
Instruction decoding time.
Instruction retirement.
Register read stalls.
Execution port throughput.
Execution unit throughput.
Suboptimal reordering and scheduling of micro-ops.
Branch misprediction.
Floating point exception.
「レジスタ読み取りストール」以外はすべて理解できました。
質問: CPU と「スーパースカラー」形式の「順不同実行」でこれがどのように起こっているか教えてもらえますか? 通常の「順不同」は論理的に見えましたが、「スーパースカラー」形式の論理的な説明を見つけることができませんでした。
質問 2: コードの実際のボトルネックを見つけるために、SSE SSE2 および新しい CPU の適切な命令リストを、できれば micro-ops テーブル、ポート スループット、ユニット、およびレイテンシの計算テーブルとともに誰かが提供できますか?
次のような小さな例があれば幸いです。
//loop carried dependency chain breaking:
__asm
{
loop_begin:
....
....
sub edx,05h //rather than taking i*5 in each iteration, we sub 5 each iteration
sub ecx,01h //i-- counter
...
...
jnz loop_begin//edit: sub ecx must have been after the sub edx for jnz
}
//while sub edx makes us get rid of a multiplication also makes that independent of ecx, making independent
ありがとうございました。
コンピューター: Pentium-M 2GHz、Windows XP-32 ビット