[all-commits] [llvm/llvm-project] c9b282: [X86] Ensure the _mm_test_all_ones macro does not ...

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Wed Jan 25 02:56:20 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c9b28233599a753506687f2f8a4f96331cd5dbb2
      https://github.com/llvm/llvm-project/commit/c9b28233599a753506687f2f8a4f96331cd5dbb2
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2023-01-25 (Wed, 25 Jan 2023)

  Changed paths:
    M clang/lib/Headers/smmintrin.h
    M clang/test/CodeGen/X86/sse41-builtins.c

  Log Message:
  -----------
  [X86] Ensure the _mm_test_all_ones macro does not reuse argument (PR60006)

The macro _mm_test_all_ones(V) was defined as _mm_testc_si128((V), _mm_cmpeq_epi32((V), (V))) - which could cause side effects depending on the source of the V value.

The _mm_cmpeq_epi32((V), (V)) trick was just to materialize an all-ones value, which can be more safely generated with _mm_set1_epi32(-1) .

Fixes #60006

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




More information about the All-commits mailing list