<span class="Apple-style-span" style="border-collapse:collapse;color:rgb(80,0,80);font-family:arial,sans-serif;font-size:13px">On Thu, Mar 1, 2012 at 6:28 PM, Demikhovsky, Elena <span dir="ltr"><<a href="mailto:elena.demikhovsky@intel.com" target="_blank" style="color:rgb(17,85,204)">elena.demikhovsky@intel.com</a>></span> wrote:</span><br>
<div class="gmail_quote"><span class="Apple-style-span" style="border-collapse:collapse;color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px"><div class="gmail_quote"><div class="im" style="color:rgb(80,0,80)">
<blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple">
<div><p class="MsoNormal" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Even if you explicitly specify –stack-alignment=16 the aligned movs are still generated.<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">It is not an issue related to ABI.</span></p>
<div><p class="MsoNormal" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><font color="#1f497d" face="Calibri, sans-serif"><span style="font-size:15px"><br></span></font></p></div></div></div></blockquote>
<div><br></div></div>Right, your issue is triggered by the code I sent out earlier:<div><br></div><div><span style="border-collapse:collapse;color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px"><div>> The faulty code can be found in function X86InstrInfo::storeRegToStackSlot(...) from</div>
<div>> /lib/Target/X86/X86InstrInfo.cpp.</div><div>></div><div>>> bool isAligned = (RI.getStackAlignment() >= 16) || RI.canRealignStack(MF);</div></span><div>></div></div><div> </div><div>In some cases, the stack is assumed to be aligned if it's on a 16 byte or greater boundary. Your desired alignment is 32 bytes, so aligned 256b moves are selected which is not correct. At runtime, your stack slots could still be aligned on a 16 byte boundary. You'll have to either: </div>
<div><br></div><div>1) Always use unaligned moves;</div><div>2) Update the code above to handle 32 byte alignment (Is this even possible at compile time? I wouldn't think so.);</div><div>3) Align the frame and stack to 32 bytes, so that AVX spill slots are always on 32 byte boundaries (This is what I'm proposing.);</div>
<div><br></div><div>-Cameron</div></div></span></div>