[all-commits] [llvm/llvm-project] e5147f: [X86] Remove __builtin_ia32_pabs intrinsics and us...

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Mon Jan 24 03:25:46 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e5147f82e1cba6791252d8f44c1a014cd9ea7927
      https://github.com/llvm/llvm-project/commit/e5147f82e1cba6791252d8f44c1a014cd9ea7927
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2022-01-24 (Mon, 24 Jan 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/avx512fintrin.h
    M clang/lib/Headers/avx512vlintrin.h
    M clang/lib/Headers/tmmintrin.h
    M clang/test/CodeGen/builtins-x86.c

  Log Message:
  -----------
  [X86] Remove __builtin_ia32_pabs intrinsics and use generic __builtin_elementwise_abs

D111986 added the generic `__builtin_elementwise_abs()` intrinsic with the same integer absolute behaviour as the SSE/AVX instructions (abs(INT_MIN) == INT_MIN)

This patch removes the `__builtin_ia32_pabs*` intrinsics and just uses `__builtin_elementwise_abs` - the existing tests see no changes:
```
__m256i test_mm256_abs_epi8(__m256i a) {
  // CHECK-LABEL: test_mm256_abs_epi8
  // CHECK: [[ABS:%.*]] = call <32 x i8> @llvm.abs.v32i8(<32 x i8> %{{.*}}, i1 false)
  return _mm256_abs_epi8(a);
}
```
This requires us to add a `__v64qs` explicitly signed char vector type (we already have `__v16qs` and `__v32qs`).

Differential Revision: https://reviews.llvm.org/D117791




More information about the All-commits mailing list