[PowerPC] Implement trap and conversion builtins for XL compatibility
authorAlbion Fung <albionapc@gmail.com>
Mon, 12 Jul 2021 03:16:27 +0000 (22:16 -0500)
committerAlbion Fung <albionapc@gmail.com>
Mon, 12 Jul 2021 16:04:17 +0000 (11:04 -0500)
commitef49d925e2a788248473b847a0e51835c6ca854f
tree977dc8ff7817d3c63538a291b8b5f3098716abfe
parent0144e625b9672d27b25196346134a7ac40e00e29
[PowerPC] Implement trap and conversion builtins for XL compatibility

This patch implements trap and FP to and from double conversions. The builtins
generate code that mirror what is generated from the XL compiler. Intrinsics
are named conventionally with builtin_ppc, but are aliased to provide the same
builtin names as the XL compiler.

Differential Revision: https://reviews.llvm.org/D103668
13 files changed:
clang/include/clang/Basic/BuiltinsPPC.def
clang/lib/Basic/Targets/PPC.cpp
clang/lib/Sema/SemaChecking.cpp
clang/test/CodeGen/builtins-ppc-xlcompat-conversionfunc.c [new file with mode: 0644]
clang/test/CodeGen/builtins-ppc-xlcompat-error.c [new file with mode: 0644]
clang/test/CodeGen/builtins-ppc-xlcompat-trap-64bit-only.c [new file with mode: 0644]
clang/test/CodeGen/builtins-ppc-xlcompat-trap.c [new file with mode: 0644]
llvm/include/llvm/IR/IntrinsicsPowerPC.td
llvm/lib/Target/PowerPC/PPCInstr64Bit.td
llvm/lib/Target/PowerPC/PPCInstrInfo.td
llvm/test/CodeGen/PowerPC/builtins-ppc-xlcompat-conversionfunc.ll [new file with mode: 0644]
llvm/test/CodeGen/PowerPC/builtins-ppc-xlcompat-trap-64bit-only.ll [new file with mode: 0644]
llvm/test/CodeGen/PowerPC/builtins-ppc-xlcompat-trap.ll [new file with mode: 0644]