[PATCH] D112401: [Clang] Mutate printf bulitin names under IEEE128 on PPC64

Jinsong Ji via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 26 08:35:14 PDT 2021


jsji added inline comments.


================
Comment at: clang/lib/CodeGen/CGBuiltin.cpp:100
+  static SmallDenseMap<unsigned, StringRef, 8> F128Builtins{
+      {Builtin::BI__builtin_printf, "__printfieee128"},
+      {Builtin::BI__builtin_vsnprintf, "__vsnprintfieee128"},
----------------
Why only these printf builtins? I think there are full list of similar libcalls in `GLIBC_2.32` and later?


================
Comment at: clang/lib/CodeGen/CGBuiltin.cpp:117
+    if (getTriple().isPPC64() &&
+        &getTarget().getLongDoubleFormat() == &llvm::APFloat::IEEEquad() &&
+        F128Builtins.find(BuiltinID) != F128Builtins.end())
----------------
How do we deal with the glibc version? Do we assume that user has glibc newer than GLIBC_2.32?


================
Comment at: clang/lib/CodeGen/CGBuiltin.cpp:119
+        F128Builtins.find(BuiltinID) != F128Builtins.end())
+      Name = F128Builtins[BuiltinID];
+    else
----------------
Do we have to do it here? Can we just update the libcall names in `RuntimeLibcalls.def` or `setLibcallName` similar to others?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112401



More information about the cfe-commits mailing list