我正在将我的程序移植到ml64,一半用于运动,一半用于查看我可以获得多少性能。了解快速调用堆栈帧
不管怎么说,我目前正试图了解堆栈帧的设置,在这个例子中,据我所知:
push rbp ; inherited, base pointer of caller, pushed on stack for storage
mov rbp, rsp ; inherited, base pointer of the callee, moved to rbp for use as base pointer
sub rsp, 32 ; intel guide says each frame must reserve 32 bytes for the storage of the
; 4 arguments usually passed through registers
and spl, -16 ; 16 byte alignment?
mov rsp, rbp ; put your base pointer back in the callee register
pop rbp ; restore callers base pointer
的2周的事情,我没有得到的
从RSP中减去32怎么做呢?据我所知,除了从一个堆栈帧到另一个堆栈帧的职责之外,它只是另一个寄存器,对吧?我怀疑它进入另一个堆栈框架而不是用于当前的框架。
什么是SPL,为什么掩盖它使16个字节对齐?
1)它分配空间(因为栈顶指向由定义RSP)2)SPL是可吸入悬浮粒子的低8位,所以你可以尽管通常使用RSP – Jester
您可能还需要考虑使用用于对齐[为什么这个C++代码比我手写的程序集更快?](https://stackoverflow.com/questions/40354978/why-is-this-c-code-faster-than-my-hand-written-assembly-for -testing-the-collat):-) –