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.
Paths
| Differential D122478
[PowerPC] Add max/min intrinsics to Clang and PPC backend ClosedPublic Authored by tingwang on Mar 25 2022, 6:22 AM.
Details
Summary Add support for builtin_[max|min] which has below prototype: Internally use SelectCC to get the result.
Diff Detail
Event TimelineComment Actions Since this is compatibility support, I'm trying to match the result from XLC in scenarios where there is all kinds of QNaN, SNaN, +/-Infinity, +/-ZERO. Currently maxfl and maxfs still give different result compared with XLC in above scenario. This is one thing I'm still looking into. Comment Actions Option -mlong-double-128 is not supported on AIX currently, and clang fails due to type mismatch in the fe case. Add check logic to print diag message in this case. qiucf added inline comments.
tingwang marked 11 inline comments as done. Comment ActionsUpdate based on Chaofan's suggestions.
Comment Actions Update based on comments: This revision is now accepted and ready to land.Apr 5 2022, 9:03 AM This revision was landed with ongoing or failed builds.Apr 5 2022, 7:48 PM Closed by commit rGb389354b2857: [Clang][PowerPC] Add max/min intrinsics to Clang and PPC backend (authored by tingwang). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 418485 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
|
Use err_target_unsupported_type?