<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 4 February 2014 02:04, Renato Golin <span dir="ltr"><<a href="mailto:renato.golin@linaro.org" target="_blank">renato.golin@linaro.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">
<div class="">On 4 February 2014 09:50, Stepan Dyatkovskiy <span dir="ltr"><<a href="mailto:stpworld@narod.ru" target="_blank">stpworld@narod.ru</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">unsigned Padding =<br>
((ArgRegsSize + AFI->getArgRegsSaveSize() + Align - 1) & ~(Align-1)) -<br>
(ArgRegsSize + AFI->getArgRegsSaveSize());<br>
<br>
It works only if Align is power of 2. It fails for Align == 24 for example. So we need to check it then..<br></blockquote><div><br></div></div><div>It seems to work for all powers of two, and it's a good assert to check if Align is a power of 2, so we should be safe for now.</div>
</div></div></div></blockquote><div><br></div><div>How about using OffsetToAlignment() so that the alignment arithmetic isn't open-coded? This happens to support non-powers-of-2. I've changed <a href="http://llvm-reviews.chandlerc.com/D2677">http://llvm-reviews.chandlerc.com/D2677</a> to use that.</div>
<div><br></div><div>Cheers,</div><div>Mark</div><div><br></div></div></div></div>