<div>On Fri, Mar 2, 2012 at 11:32 AM, Evandro Menezes <<a href="mailto:emenezes@codeaurora.org">emenezes@codeaurora.org</a>> wrote:</div><div>...</div><div>> Figure 3.3 on page 16 of <a href="http://www.x86-64.org/documentation/abi.pdf">www.x86-64.org/documentation/abi.pdf</a> is not</div>
<div>> normative.  See foot note 7 in the same page.  Figure 3.4 on page 21</div><div>> confirms that the use of a frame-pointer is optional.</div><div>></div><div>> So, if one doesn't use ENTER in the prologue and uses RSP to access local</div>
<div>> variables, RBP may be used as a calee-saved GPR.</div><div><br></div><div>I am not sure if I am completely following. The issue that required aligning the frame to 32 bytes is when there are variable sized objects on the stack (e.g. alloca). In that case, the RBP frame pointer is required to access the spill slots. If I'm not mistaken, calculating the address of spill slots off of RSP would be costly in this case.</div>
<div><br></div><div>Are you suggesting that there is a way to base spill slots off of RSP when the stack size is unknown at compile time?</div><div><br></div><div>This does bring up an interesting idea though. If we wanted to punt, it would be possible to check for variable sized objects on the stack and then only issue unaligned moves for 256b spills/reloads. Not ideal for performance, but it would work as a stopgap.</div>
<div><br></div><div>-Cameron</div>