[PATCH] D122478: [PowerPC] Add max/min intrinsics to Clang and PPC backend

Ting Wang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 25 06:22:45 PDT 2022


tingwang created this revision.
tingwang added reviewers: PowerPC, jsji, nemanjai, shchenz.
tingwang added a project: LLVM.
Herald added subscribers: kbarton, hiraditya.
Herald added a project: All.
tingwang requested review of this revision.
Herald added a project: clang.
Herald added subscribers: llvm-commits, cfe-commits.

Add support for __builtin_[max|min] which has below prototype:
A __builtin_max (A1, A2, A3, ...)
All arguments must have the same type; they must all be float, double, or long double.

Internally use SelectCC to get the result, and depends on D122462 <https://reviews.llvm.org/D122462> to work properly for ppcf128.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D122478

Files:
  clang/include/clang/Basic/BuiltinsPPC.def
  clang/include/clang/Basic/DiagnosticSemaKinds.td
  clang/lib/Basic/Targets/PPC.cpp
  clang/lib/CodeGen/CGBuiltin.cpp
  clang/lib/Sema/SemaChecking.cpp
  clang/test/CodeGen/PowerPC/builtins-ppc.c
  clang/test/Sema/builtins-ppc.c
  llvm/include/llvm/IR/IntrinsicsPowerPC.td
  llvm/lib/Target/PowerPC/PPCISelLowering.cpp
  llvm/test/CodeGen/PowerPC/builtins-ppc-xlcompat-maxmin.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122478.418199.patch
Type: text/x-patch
Size: 17045 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220325/9bb526f9/attachment-0001.bin>


More information about the cfe-commits mailing list