[clang] [llvm] [X86] AVX10_V2_AUX Implementation (PR #206888)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 15 07:43:54 PDT 2026
================
@@ -0,0 +1,1067 @@
+/*===------------ avx10_2_v2auxintrin.h - AVX10_2_V2AUX -------------------===
+ *
+ * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+ * See https://llvm.org/LICENSE.txt for license information.
+ * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+ *
+ *===-----------------------------------------------------------------------===
+ */
+#ifndef __IMMINTRIN_H
+#error \
+ "Never use <avx10_2_v2auxintrin.h> directly; include <immintrin.h> instead."
+#endif // __IMMINTRIN_H
+
+#ifdef __SSE2__
+
+#ifndef __AVX10_2_V2AUXINTRIN_H
+#define __AVX10_2_V2AUXINTRIN_H
+
+/* Define the default attributes for the functions in this file. */
+#define __DEFAULT_FN_ATTRS128 \
+ __attribute__((__always_inline__, __nodebug__, __target__("avx10-v2-aux"), \
+ __min_vector_width__(128)))
+#define __DEFAULT_FN_ATTRS256 \
+ __attribute__((__always_inline__, __nodebug__, __target__("avx10-v2-aux"), \
+ __min_vector_width__(256)))
+#define __DEFAULT_FN_ATTRS512 \
+ __attribute__((__always_inline__, __nodebug__, __target__("avx10-v2-aux"), \
+ __min_vector_width__(512)))
+
+// clang-format off
+
+//===----------------------------------------------------------------------===//
+// Group A: VCVTPS2BF8 / VCVTPS2BF8S / VCVTPS2HF8 / VCVTPS2HF8S /
+// VCVTROPS2HF8 / VCVTROPS2HF8S
+// Convert packed single-precision to FP8. Output is always __m128i.
+//===----------------------------------------------------------------------===//
+
+// VCVTPS2BF8 - 128-bit
+
+static __inline__ __m128i __DEFAULT_FN_ATTRS128
+_mm_cvtps_bf8(__m128 __A) {
+ return (__m128i)__builtin_ia32_vcvtps2bf8_128_mask(
----------------
ganeshgit wrote:
Agreed. Changed with selects. Tests are also updated.
https://github.com/llvm/llvm-project/pull/206888
More information about the cfe-commits
mailing list