<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div name="messageBodySection">
<div dir="auto">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 style="background-color:rgba(0, 0, 0, 0);font-family:Slack-Lato, appleLogo, sans-serif;font-size: 15px" href="https://llvm.org/docs/LangRef.html#constrained-floating-point-intrinsics" target="_blank">https://llvm.org/docs/LangRef.html#constrained-floating-point-intrinsics</a>, seems to be doing the trick. Here is the piece of code that I did:<br />
<br />
<em style="color:#fac29a;font-size: 12px">%5</em><span style="color:#bbbbbb;font-size: 12px"> = </span><strong style="color:#b877db;font-size: 12px">call</strong><span style="color:#bbbbbb;font-size: 12px"> </span><strong style="color:#b877db;font-size: 12px">double</strong><span style="color:#bbbbbb;font-size: 12px"> </span><em style="color:#fac29a;font-size: 12px">@llvm.experimental.constrained.fadd</em><span style="color:#bbbbbb;font-size: 12px">(</span><strong style="color:#b877db;font-size: 12px">double</strong><span style="color:#bbbbbb;font-size: 12px"> </span><em style="color:#fac29a;font-size: 12px">%0</em><span style="color:#bbbbbb;font-size: 12px">, </span><strong style="color:#b877db;font-size: 12px">double</strong><span style="color:#bbbbbb;font-size: 12px"> </span><em style="color:#fac29a;font-size: 12px">%2</em><span style="color:#bbbbbb;font-size: 12px">, </span><strong style="color:#b877db;font-size: 12px">metadata</strong><span style="color:#bbbbbb;font-size: 12px"> !</span><span style="color:#fab795;font-size: 12px">"round</span><span style="color:#25b0bc;font-size: 12px">.d</span><span style="color:#fab795;font-size: 12px">ownward"</span><span style="color:#bbbbbb;font-size: 12px">, </span><strong style="color:#b877db;font-size: 12px">metadata</strong><span style="color:#bbbbbb;font-size: 12px"> !</span><span style="color:#fab795;font-size: 12px">"fpexcept</span><span style="color:#25b0bc;font-size: 12px">.i</span><span style="color:#fab795;font-size: 12px">gnore"</span><span style="color:#bbbbbb;font-size: 12px">)</span><span style="font-size: 12px"><br /></span><span style="font-size: 12px"><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.</div>
</div>
<div name="messageSignatureSection"><br />
<div class="matchFont">Thank you
<div>Xuan Tang</div>
</div>
</div>
</body>
</html>