[PATCH] D117798: [X86] Remove __builtin_ia32_pmax/min intrinsics and use generic __builtin_elementwise_max/min

Simon Pilgrim via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 20 09:08:50 PST 2022


RKSimon created this revision.
RKSimon added reviewers: pengfei, craig.topper, fhahn.
RKSimon requested review of this revision.
Herald added a project: clang.

D111985 <https://reviews.llvm.org/D111985> added the generic `__builtin_elementwise_max` and `__builtin_elementwise_min` intrinsics with the same integer behaviour as the SSE/AVX instructions

This patch removes the `__builtin_ia32_pmax/min` intrinsics and just uses `__builtin_elementwise_max/min` - the existing tests see no changes:

  __m256i test_mm256_max_epu32(__m256i a, __m256i b) {
    // CHECK-LABEL: test_mm256_max_epu32
    // CHECK: call <8 x i32> @llvm.umax.v8i32(<8 x i32> %{{.*}}, <8 x i32> %{{.*}})
    return _mm256_max_epu32(a, b);
  }

This requires us to add a `__v64qs` explicitly signed char vector type (we already have `__v16qs` and `__v32qs`).

Sibling patch to D117791 <https://reviews.llvm.org/D117791>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D117798

Files:
  clang/include/clang/Basic/BuiltinsX86.def
  clang/lib/CodeGen/CGBuiltin.cpp
  clang/lib/Headers/avx2intrin.h
  clang/lib/Headers/avx512bwintrin.h
  clang/lib/Headers/avx512fintrin.h
  clang/lib/Headers/avx512vlintrin.h
  clang/lib/Headers/emmintrin.h
  clang/lib/Headers/smmintrin.h
  clang/test/CodeGen/builtins-x86.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117798.401661.patch
Type: text/x-patch
Size: 27584 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220120/b78aa2b4/attachment-0001.bin>


More information about the cfe-commits mailing list