[PATCH] D107138: [PowerPC] Implement cmplxl builtins

Nemanja Ivanovic via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 30 05:49:49 PDT 2021


nemanjai requested changes to this revision.
nemanjai added inline comments.
This revision now requires changes to proceed.


================
Comment at: clang/include/clang/Basic/BuiltinsPPC.def:146
 BUILTIN(__builtin_ppc_stfiw, "viC*d", "")
+BUILTIN(__builtin_ppc_cmplxl, "XLdLdLd", "")
 
----------------
Please remove this. The preprocessor will replace this and the builtin call will never make it to the front end.


================
Comment at: clang/lib/Basic/Targets/PPC.cpp:238
   Builder.defineMacro("__fsqrts", "__builtin_ppc_fsqrts");
+  Builder.defineMacro("__builtin_ppc_cmplxl", "__builtin_complex");
+  Builder.defineMacro("__cmplxl", "__builtin_complex");
----------------
I don't see a compelling reason to have this. Users that want this functionality in new code (that doesn't already use `__cmplxl`) can simply use `__builtin_complex`.


================
Comment at: clang/test/CodeGen/builtins-ppc-xlcompat-complex.c:45
+  // CHECK-AIX-NEXT: ret { double, double } %.fca.1.insert
+  return __cmplxl(lda, ldb);
+}
----------------
We really only need this test case and we should be able to just add it to one of the existing XL-compat clang test cases.


================
Comment at: llvm/test/CodeGen/PowerPC/builtins-ppc-xlcompat-complex-32bit-only.ll:1
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc -verify-machineinstrs -mtriple=powerpc-unknown-aix \
----------------
I don't think we need the back end tests. No new IR is produced in this patch.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107138/new/

https://reviews.llvm.org/D107138



More information about the cfe-commits mailing list