[llvm-dev] using experimental intrinsics failed

Kevin Neal via llvm-dev llvm-dev at lists.llvm.org
Wed Sep 16 15:19:45 PDT 2020


Note that the intrinsics don’t affect the rounding mode at run time.

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.

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.

I apologize for being behind in my email.
--
Kevin P. Neal
SAS/C and SAS/C++ Compiler
Compute Services
SAS Institute, Inc.



From: llvm-dev <llvm-dev-bounces at lists.llvm.org> On Behalf Of Xuan Tang via llvm-dev
Sent: Thursday, September 03, 2020 2:46 AM
To: llvm-dev at lists.llvm.org
Subject: [llvm-dev] using experimental intrinsics failed


EXTERNAL
Hi:

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.

The document I found https://llvm.org/docs/LangRef.html#constrained-floating-point-intrinsics<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>, seems to be doing the trick. Here is the piece of code that I did:

%5 = call double @llvm.experimental.constrained.fadd(double %0, double %2, metadata !"round.downward", metadata !"fpexcept.ignore")

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:

error: use of undefined value '@llvm.experimental.constrained.fadd'

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.

Thank you
Xuan Tang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200916/cdc2709a/attachment.html>


More information about the llvm-dev mailing list