[PATCH] D103615: [Clang] Add option for vector compare compatibility.

Stefan Pintilie via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 3 06:43:07 PDT 2021


stefanp created this revision.
stefanp added reviewers: nemanjai, lei, rsmith.
Herald added subscribers: dexonsmith, dang.
stefanp requested review of this revision.
Herald added a project: clang.

Added the option -vector-abi-compat=[default,gcc,xl]. The default behavior for
clang is for all vector compares to return a scalar unless the vectors being
compared are vector bool or vector pixel. In that case the compare returns a
vector. With the gcc case all vector compares return vectors and in the xl case
all vector compares return scalars.

This patch does not change the default behavior of clang.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D103615

Files:
  clang/include/clang/Basic/LangOptions.def
  clang/include/clang/Basic/LangOptions.h
  clang/include/clang/Driver/Options.td
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/lib/Sema/SemaExpr.cpp
  clang/test/CodeGen/vector-compat-pixel-bool-ternary.c
  clang/test/CodeGen/vector-compat-pixel-bool.c
  clang/test/CodeGen/vector-compat-ternary.c
  clang/test/CodeGen/vector-compat.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103615.349535.patch
Type: text/x-patch
Size: 35147 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210603/7f9001d2/attachment-0001.bin>


More information about the cfe-commits mailing list