[PATCH] [complex] Teach Clang to preserve different-type operands to arithmeticoperators where one type is a C complex type, and to emit both the efficientand correct implementation for complex arithmetic according to C11 AnnexG using this extra...

hfinkel at anl.gov hfinkel at anl.gov
Thu Oct 9 13:18:20 PDT 2014


I agree with Steve, this looks good. To add one thing: I'd also like to skip the libcalls when possible in fast-math mode.

================
Comment at: lib/CodeGen/CGExprComplex.cpp:590
@@ +589,3 @@
+  if (Result->getType()->isVectorTy()) {
+  ResR = CGF.Builder.CreateExtractElement(Result, CGF.Builder.getInt32(0));
+  ResI = CGF.Builder.CreateExtractElement(Result, CGF.Builder.getInt32(1));
----------------
Indent?

http://reviews.llvm.org/D5698






More information about the cfe-commits mailing list