[all-commits] [llvm/llvm-project] 952b12: [X86] Allow PSHUFD/PSHUFLW/PSHUFW intrinsics in co...

Nagraj Gaonkar via All-commits all-commits at lists.llvm.org
Fri Oct 3 07:52:42 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 952b12394ecffce6cf2430aa29b193dd7dc897a8
      https://github.com/llvm/llvm-project/commit/952b12394ecffce6cf2430aa29b193dd7dc897a8
  Author: Nagraj Gaonkar <nagrajgaonkarmumbai749 at gmail.com>
  Date:   2025-10-03 (Fri, 03 Oct 2025)

  Changed paths:
    M clang/include/clang/Basic/BuiltinsX86.td
    M clang/lib/AST/ByteCode/InterpBuiltin.cpp
    M clang/lib/AST/ExprConstant.cpp
    M clang/test/CodeGen/X86/avx2-builtins.c
    M clang/test/CodeGen/X86/avx512bw-builtins.c
    M clang/test/CodeGen/X86/avx512f-builtins.c
    M clang/test/CodeGen/X86/avx512vl-builtins.c
    M clang/test/CodeGen/X86/avx512vlbw-builtins.c
    M clang/test/CodeGen/X86/mmx-builtins.c
    M clang/test/CodeGen/X86/sse2-builtins.c

  Log Message:
  -----------
  [X86] Allow PSHUFD/PSHUFLW/PSHUFW intrinsics in constexpr. (#161210)

The i16/i32 shuffle intrinsics (`pshufw`, `pshuflw`, `pshufhw`,
`pshufd`) currently cannot be used in constant expressions. This patch
adds support in both bytecode interpreter (InterpBuiltin.cpp) and
constant evaluator
(ExprConstant.cpp) for pshuf intrinsics, enabling their use in constant
expressions.
## Intrinsics covered
- `_mm_shuffle_pi16` (MMX `pshufw`)
- `_mm_shufflelo_epi16` / `_mm_shufflehi_epi16`
- `_mm_shuffle_epi32`
- Their AVX2/AVX512 vector-width variants
- Masked and maskz forms (handled indirectly via
`__builtin_ia32_select*`)

Fixes #156611



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list