<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Courier New";
        color:#44546A;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-family:"Courier New";color:#44546A">Note that the intrinsics don’t affect the rounding mode at run time.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#44546A"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#44546A">What they do is the tell llvm what rounding mode llvm should expect the code to be using when it does eventually get run. You’ll need to change the rounding mode in your fp environment
 yourself by calling fpsetround() or whatever your system uses.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#44546A"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#44546A">Also, note that the work to implement the constrained intrinsics is ongoing. Some hosts support it (X86, SystemZ, and recently PowerPC), but roughly no optimizations are enabled yet.
 So don’t expect performance yet.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#44546A"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#44546A">I apologize for being behind in my email.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:#44546A">--</span><span style="color:#44546A">
<br>
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#44546A">Kevin P. Neal</span><span style="color:#44546A"><br>
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#44546A">SAS/C and SAS/C++ Compiler<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:#44546A">Compute Services<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New";color:#44546A">SAS Institute, Inc.</span><span style="color:#44546A"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#44546A"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#44546A"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New";color:#44546A"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> llvm-dev <llvm-dev-bounces@lists.llvm.org> <b>On Behalf Of
</b>Xuan Tang via llvm-dev<br>
<b>Sent:</b> Thursday, September 03, 2020 2:46 AM<br>
<b>To:</b> llvm-dev@lists.llvm.org<br>
<b>Subject:</b> [llvm-dev] using experimental intrinsics failed<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p><b><i><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:red">EXTERNAL</span></i></b><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:red">
</span><o:p></o:p></p>
<div>
<div name="messageBodySection">
<div>
<p class="MsoNormal">Hi:<br>
<br>
Sorry I need to send email directly. I am new to llvm and trying to write interval arithmetic, which requires changing rounding mode during computation.<br>
<br>
The document I found <a href="https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fllvm.org%2Fdocs%2FLangRef.html%23constrained-floating-point-intrinsics&data=02%7C01%7Ckevin.neal%40sas.com%7C56cf4859d8c74a71fee008d8506a9f99%7Cb1c14d5c362545b3a4309552373a0c2f%7C0%7C0%7C637347766165256247&sdata=1L%2FOWIXGU%2BLZZwCr5T1SaoPFEY%2FBwF10V6azvtyHs2I%3D&reserved=0" target="_blank"><span style="font-size:11.5pt;font-family:"Arial",sans-serif">https://llvm.org/docs/LangRef.html#constrained-floating-point-intrinsics</span></a>,
 seems to be doing the trick. Here is the piece of code that I did:<br>
<br>
<em><span style="font-size:9.0pt;font-family:"Calibri",sans-serif;color:#FAC29A">%5</span></em><span style="font-size:9.0pt;color:#BBBBBB"> = </span><strong><span style="font-size:9.0pt;font-family:"Calibri",sans-serif;color:#B877DB">call</span></strong><span style="font-size:9.0pt;color:#BBBBBB"> </span><strong><span style="font-size:9.0pt;font-family:"Calibri",sans-serif;color:#B877DB">double</span></strong><span style="font-size:9.0pt;color:#BBBBBB"> </span><em><span style="font-size:9.0pt;font-family:"Calibri",sans-serif;color:#FAC29A">@llvm.experimental.constrained.fadd</span></em><span style="font-size:9.0pt;color:#BBBBBB">(</span><strong><span style="font-size:9.0pt;font-family:"Calibri",sans-serif;color:#B877DB">double</span></strong><span style="font-size:9.0pt;color:#BBBBBB"> </span><em><span style="font-size:9.0pt;font-family:"Calibri",sans-serif;color:#FAC29A">%0</span></em><span style="font-size:9.0pt;color:#BBBBBB">, </span><strong><span style="font-size:9.0pt;font-family:"Calibri",sans-serif;color:#B877DB">double</span></strong><span style="font-size:9.0pt;color:#BBBBBB"> </span><em><span style="font-size:9.0pt;font-family:"Calibri",sans-serif;color:#FAC29A">%2</span></em><span style="font-size:9.0pt;color:#BBBBBB">, </span><strong><span style="font-size:9.0pt;font-family:"Calibri",sans-serif;color:#B877DB">metadata</span></strong><span style="font-size:9.0pt;color:#BBBBBB"> !</span><span style="font-size:9.0pt;color:#FAB795">"round</span><span style="font-size:9.0pt;color:#25B0BC">.d</span><span style="font-size:9.0pt;color:#FAB795">ownward"</span><span style="font-size:9.0pt;color:#BBBBBB">, </span><strong><span style="font-size:9.0pt;font-family:"Calibri",sans-serif;color:#B877DB">metadata</span></strong><span style="font-size:9.0pt;color:#BBBBBB"> !</span><span style="font-size:9.0pt;color:#FAB795">"fpexcept</span><span style="font-size:9.0pt;color:#25B0BC">.i</span><span style="font-size:9.0pt;color:#FAB795">gnore"</span><span style="font-size:9.0pt;color:#BBBBBB">)</span><span style="font-size:9.0pt"><br>
<br>
</span>It is taking the first and third argument and adding them together with the downward rounding mode. However, when I try to convert it to bit code, I got the error:<br>
<br>
error: use of undefined value '@llvm.experimental.constrained.fadd'<br>
<br>
Is there any flags I need to add in order to use this intrinsic? Or this is just a wrong function call. I am using the llvm version 10.0.1.<o:p></o:p></p>
</div>
</div>
<div name="messageSignatureSection">
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Thank you <o:p></o:p></p>
<div>
<p class="MsoNormal">Xuan Tang<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>