stackエンジンの進化
こいつの内容. stackoverflow.com
確かになぜcpuレベルでstackのpushやpopのサポートがあるかってのは聞かれてみたらよく話からんってなる. 実際に昔のcpu向けのcompileではmovで引き数渡しの処理が行われていたみたい
But Pentium-M introduced a "stack engine" in the front-end that eliminates the stack-adjustment part of stack ops like push/call/ret/pop. It effectively renames the stack pointer with zero latency. See Agner Fog's microarch guide and What is the stack engine in the Sandybridge microarchitecture?
そこから、pop/retなどの命令で自動的にrspが(ほぼゼロコストで)更新されるようにprocessorが進化したとのこと.
論理的にはmovができればPC上の計算においてpush/popなんぞ必要なさそうだけど、やはりそれだと遅いってことなんだろうか.
追記: 普通にwikiにもstackエンジンについての記述があった