<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Calibri" size="2"><span style="font-size:11pt;">
<div>Hi</div>
<div> </div>
<div>The attached patch file includes a fix for the following bug in AVX codegen for double-to-int conversions:</div>
<ul style="margin:0;padding-left:36pt;">
<li>"fptosi" and "fptoui" IR instructions are defined with round-to-zero rounding mode.</li><li>Currently for AVX mode for <4xdouble> and <8xdouble>  the "VCVTPD2DQ.128" and "VCVTPD2DQ.256" instructions are selected (for “fp_to_sint” DAG node operation ) by AVX codegen. However they use round-to-nearest-even rounding mode.</li><li>Consequently, the conversion produces incorrect numbers.</li></ul>
<div style="padding-left:36pt;"> </div>
<div>The fix is to replace selection of VCVTPD2DQ instructions with VCVTTPD2DQ instructions. The latter use truncate (i.e. round-to-zero) rounding mode. </div>
<div>As “fp_to_sint” DAG node operation is used only for lowering of  "fptosi" and "fptoui" IR instructions, the fix in X86InstrSSE.td definition file doesn’t have an impact on other LLVM flows.</div>
<div> </div>
<div>The patch includes changes in the .td file, LIT test for the changes and a fix in a legacy LIT test (which produced asm code conflicting with LLVN IR spec). </div>
<div> </div>
<div>I’d like to commit the fix to the LLVM trunk, and your feedback will be mostly appreciated.</div>
<div> </div>
<div> </div>
<div>Thanks,</div>
<div>    Victor</div>
<div> </div>
<div> </div>
</span></font>
<font face="monospace">---------------------------------------------------------------------<br>
Intel Israel (74) Limited<br>
<br>
This e-mail and any attachments may contain confidential material for<br>
the sole use of the intended recipient(s). Any review or distribution<br>
by others is strictly prohibited. If you are not the intended<br>
recipient, please contact the sender and delete all copies.</font></body>
</html>