<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 3, 2015 at 1:10 PM, Chad Rosier <span dir="ltr"><<a href="mailto:mcrosier@codeaurora.org" target="_blank">mcrosier@codeaurora.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":fos" class="a3s" style="overflow:hidden">Hi Simon,<br>
MVT::getVectorNumElements() has an 'unsigned' return type.<br>
<br>
Would it make more sense to change NumElements to unsigned and fix the<br>
induction variables for those loops that compare NumElements, rather than<br>
using a cast in the assert?</div></blockquote></div><br>I strongly prefer not to.</div><div class="gmail_extra"><br></div><div class="gmail_extra">We are often doing subtraction and other things, and in fact using them with values which can be -1. Using unsigned anywhere in this code is just wrong.</div><div class="gmail_extra"><br></div><div class="gmail_extra">The nice thing about casting to an int is that UBSan can throw an error if it is out-of-range.</div></div>