<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>I assume that should be cmova or cmovg; you can't determine if b > a from the sign of b - a (due to overflow).</div><div><br></div><div>- Steve</div><br><div><div>On Apr 25, 2012, at 4:52 PM, Manman Ren <<a href="mailto:mren@apple.com">mren@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi Sean,</div><div><br></div><div>Thanks for providing the feedback.</div><div>This patch will generate </div><div>xorl %ecx, %ecx</div><div>subl %edx, %eax</div><div>cmovsl %ecx, %eax</div><div>while the proposed sequence has a dependency chain from 1st instruction to 2nd then to 3rd.</div><div><br></div><div>-- Manman</div><div><br><div><div>On Apr 25, 2012, at 11:01 AM, Sean Silva <<a href="mailto:silvas@purdue.edu">silvas@purdue.edu</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div class="gmail_extra">Why not turn it into e.g.</div><div class="gmail_extra"><br></div><div class="gmail_extra">cmp ebx, eax</div><div class="gmail_extra">cmovg ebx, eax</div><div class="gmail_extra">sub ebx, eax</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">?</div><div class="gmail_extra"><br></div><div class="gmail_extra">--Sean Silva</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Wed, Apr 25, 2012 at 12:33 PM, Manman Ren <span dir="ltr"><<a href="mailto:mren@apple.com" target="_blank">mren@apple.com</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; position: static; z-index: auto; ">
<br>
This patch is intended to optimize the following cases for x86:<br>
(b > a) ? (b-a) : 0<br>
(a < b) ? (b-a) : 0<br>
It will use cmovs in generated x86 code.<br>
<br>
The patch modified one source file: lib/Target/X86/X86ISelLowering.cpp<br>
<br>
Please review & provide feedback.<br>
Thanks,<br>
<br>
<br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a></blockquote></div></div></blockquote></div></div></div></blockquote></div></body></html>