[all-commits] [llvm/llvm-project] 09857a: [X86] Remove __builtin_ia32_padd/psub saturated in...

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Tue Feb 8 07:00:34 PST 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 09857a4bd166ca62a9610629731dfbf8f62cd955
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2022-02-08 (Tue, 08 Feb 2022)

  Changed paths:
    M clang/include/clang/Basic/BuiltinsX86.def
    M clang/lib/CodeGen/CGBuiltin.cpp
    M clang/lib/Headers/avx2intrin.h
    M clang/lib/Headers/avx512bwintrin.h
    M clang/lib/Headers/emmintrin.h
    M clang/test/CodeGen/builtins-x86.c

  Log Message:
  [X86] Remove __builtin_ia32_padd/psub saturated intrinsics and use generic __builtin_elementwise_add/sub_sat

D117898 added the generic __builtin_elementwise_add_sat and __builtin_elementwise_sub_sat with the same integer behaviour as the SSE/AVX instructions

This patch removes the __builtin_ia32_padd/psub saturated intrinsics and just uses the generics - the existing tests see no changes:

__m256i test_mm256_adds_epi8(__m256i a, __m256i b) {
  // CHECK-LABEL: test_mm256_adds_epi8
  // CHECK: call <32 x i8> @llvm.sadd.sat.v32i8(<32 x i8> %{{.*}}, <32 x i8> %{{.*}})
  return _mm256_adds_epi8(a, b);

More information about the All-commits mailing list