[PATCH] D111986: [Clang] Add elementwise abs builtin.

Florian Hahn via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 19 12:35:22 PDT 2021


fhahn updated this revision to Diff 380756.
fhahn added a comment.

In D111986#3072946 <https://reviews.llvm.org/D111986#3072946>, @scanon wrote:

> What's the rationale for making abs undefined on the minimum value? AFAIK every actual simd implementation defines the result and they agree (and even if one didn't, it would be pretty easy to get the "right" result. Introducing UB here just seems like punishing users for no reason.

Thanks! As making it UB does not really help with lowering I went back to allowing INT_MIN and updated the spec to explicitly spell out the behavior.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D111986

Files:
  clang/include/clang/Basic/Builtins.def
  clang/include/clang/Basic/DiagnosticSemaKinds.td
  clang/include/clang/Sema/Sema.h
  clang/lib/CodeGen/CGBuiltin.cpp
  clang/lib/Sema/SemaChecking.cpp
  clang/test/CodeGen/builtins-elementwise-math.c
  clang/test/Sema/builtins-elementwise-math.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D111986.380756.patch
Type: text/x-patch
Size: 8380 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20211019/501f6e0e/attachment.bin>


More information about the cfe-commits mailing list