[PATCH] D117898: [Clang] Add elementwise saturated add/sub builtins
Simon Pilgrim via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 21 08:51:47 PST 2022
RKSimon created this revision.
RKSimon added reviewers: fhahn, aaron.ballman, scanon, craig.topper.
Herald added subscribers: pengfei, sunfish, kristof.beyls, dschuff.
RKSimon requested review of this revision.
Herald added a subscriber: aheejin.
Herald added a project: clang.
This patch implements `__builtin_elementwise_add_sat` and `__builtin_elementwise_sub_sat' builtins
These map to the add/sub saturated math intrinsics described here:
https://llvm.org/docs/LangRef.html#saturation-arithmetic-intrinsics
With this in place we should then be able to replace the x86 SSE adds/subs intrinsics with these generic variants - it looks like other targets should be able to use these as well (arm/aarch64/webassembly all have similar examples in cgbuiltin).
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D117898
Files:
clang/docs/LanguageExtensions.rst
clang/include/clang/Basic/Builtins.def
clang/lib/CodeGen/CGBuiltin.cpp
clang/lib/Sema/SemaChecking.cpp
clang/test/CodeGen/builtins-elementwise-math.c
clang/test/Sema/builtins-elementwise-math.c
clang/test/SemaCXX/builtins-elementwise-math.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117898.402003.patch
Type: text/x-patch
Size: 15475 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220121/4ebe3d0c/attachment.bin>
More information about the cfe-commits
mailing list