[cfe-dev] About ComplexExprEmitter

Shixiong Xu via cfe-dev cfe-dev at lists.llvm.org
Wed Sep 21 02:58:41 PDT 2016


Hi,

I am working on hardware support for complex floating-point numbers. I noticed that ComplexExprEmitter in Clang directly decomposes complex numbers in order to perform arithmetic operations such as add, sub. If the target has special float/double complex data types and a set of instructions to achieve the complex operations, what's the best way of utilizing these instructions? I guess only relying on the LLVM backend to do the instruction selection is not a good idea because the complex data types are represented as a record in LLVM IR. I am thinking of implementing another ExprEmitter, say HardwareComplexExprEmitter, to convert Clang complex types into target specific complex types, and related operations into intrinsic calls. But the disadvantages are 1) vectorizer won't be able to vectorize the transformed code without extensions and 2) it hurts the portability of code. Any suggestions? Thanks.

Cheers,

Shixiong (Jason) Xu

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160921/7813b36a/attachment.html>


More information about the cfe-dev mailing list