<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Tue, Jun 23, 2015 at 1:27 PM Paweł Bylica <<a href="mailto:chfast@gmail.com">chfast@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi LLVM,<div><br></div><div>I have painfully found out that APInt comparison with uint64_t using methods like .ult() is done with the precision of the APInt instance. The uint64_t argument is usually silently truncated then. E.g. APInt{8, 1}.ult(256) is false.</div><div><br></div><div>I propose to change that and do the comparison with 64 bit precision. I think it is much more useful as APInts representing the value of a constant is often compared with the size of a type.</div><div><br></div><div>There are no unit tests for APInt comparisons. I've changed the implementation locally and haven't spot any regressions.</div></div></blockquote><div><br></div><div>I haven't found any issues in self-hosted check-all and test-suite.</div><div>Patch: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D10655&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=jgaZabbN3EYIkBXqi-3PWTM9N-zDvPS9EH044wGfXwA&s=L6ogmgVmdpQQQceDSwTgfdc6l5hVlXz42oKc4_Mco9c&e=">http://reviews.llvm.org/D10655</a></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>If the proposal is accepted I will send the patch for review and do self-hosted testing.</div><div><br></div><div>Cheers,</div><div>- Paweł</div></div></blockquote></div></div>