[clang] [CIR][X86] Add support for kunpck builtins (PR #168757)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 19 16:03:00 PST 2025


================
@@ -0,0 +1,92 @@
+// RUN: %clang_cc1 -x c -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +avx512f -target-feature +avx512bw -fclangir -emit-cir -o %t.cir -Wall -Werror
+// RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s
+// RUN: %clang_cc1 -x c -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +avx512f -target-feature +avx512bw -fclangir -emit-llvm -o %t.ll -Wall -Werror
+// RUN: FileCheck --check-prefixes=LLVM --input-file=%t.ll %s
+
+// RUN: %clang_cc1 -x c -flax-vector-conversions=none -ffreestanding %s -triple=x86_64-unknown-linux -target-feature +avx512f -target-feature +avx512bw -emit-llvm -o - -Wall -Werror | FileCheck %s -check-prefix=OGCG
+
+// This test exercises the kunpck (mask unpack) builtins for AVX-512.
+
+#include <immintrin.h>
+
+__mmask16 test_mm512_kunpackb(__mmask16 __A, __mmask16 __B) {
----------------
andykaylor wrote:

Please add these tests to `clang/test/CodeGen/X86/avx512f-builtins.c` (not yet upstreamed) instead. Compiling `immintrin.h` takes a painfully long amount of time, so breaking out individual tests is unusually expensive.

https://github.com/llvm/llvm-project/pull/168757


More information about the cfe-commits mailing list