[clang] [llvm] [X86][AVX10.2] Support AVX10.2-SATCVT-DS new instructions. (PR #102592)

Phoebe Wang via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 4 07:46:01 PDT 2024


================
@@ -0,0 +1,447 @@
+/*===----------- avx10_2satcvtdsintrin.h - AVX512SATCVTDS intrinsics --------===
+ *
+ * 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_2satcvtdsintrin.h> directly; include <immintrin.h> instead."
+#endif // __IMMINTRIN_H
+
+#ifndef __AVX10_2SATCVTDSINTRIN_H
+#define __AVX10_2SATCVTDSINTRIN_H
+
+/* Define the default attributes for the functions in this file. */
+#define __DEFAULT_FN_ATTRS                                                     \
+  __attribute__((__always_inline__, __nodebug__, __target__("avx10.2-256"),    \
+                 __min_vector_width__(256)))
+
+#define __DEFAULT_FN_ATTRS128                                                  \
+  __attribute__((__always_inline__, __nodebug__, __target__("avx10.2-256"),    \
+                 __min_vector_width__(128)))
+
+#define _mm_cvtts_roundsd_i32(A, R)                                            \
+  ((int)__builtin_ia32_vcvttsd2sis32((__v2df)(__m128)(A), (const int)(R)))
+
+#define _mm_cvtts_roundsd_si32(A, R)                                           \
+  ((int)__builtin_ia32_vcvttsd2sis32((__v2df)(__m128d)(A), (const int)(R)))
+
+#define _mm_cvtts_roundsd_u32(A, R)                                            \
+  ((unsigned int)__builtin_ia32_vcvttsd2usis32((__v2df)(__m128d)(A),           \
+                                               (const int)(R)))
+
+#define _mm_cvtts_roundss_i32(A, R)                                            \
+  ((int)__builtin_ia32_vcvttss2sis32((__v4sf)(__m128)(A), (const int)(R)))
+
+#define _mm_cvtts_roundss_si32(A, R)                                           \
+  ((int)__builtin_ia32_vcvttss2sis32((__v4sf)(__m128)(A), (const int)(R)))
+
+#define _mm_cvtts_roundss_u32(A, R)                                            \
+  ((unsigned int)__builtin_ia32_vcvttss2usis32((__v4sf)(__m128)(A),            \
+                                               (const int)(R)))
+
+#ifdef __x86_64__
+#define _mm_cvtts_roundss_u64(A, R)                                            \
+  ((unsigned long long)__builtin_ia32_vcvttss2usis64((__v4sf)(__m128)(A),      \
+                                                     (const int)(R)))
+
+#define _mm_cvtts_roundsd_u64(A, R)                                            \
+  ((unsigned long long)__builtin_ia32_vcvttsd2usis64((__v2df)(__m128d)(A),     \
+                                                     (const int)(R)))
+
+#define _mm_cvtts_roundss_i64(A, R)                                            \
+  ((long long)__builtin_ia32_vcvttss2sis64((__v4sf)(__m128)(A), (const int)(R)))
+
+#define _mm_cvtts_roundss_si64(A, R)                                           \
+  ((long long)__builtin_ia32_vcvttss2sis64((__v4sf)(__m128)(A), (const int)(R)))
+
+#define _mm_cvtts_roundsd_si64(A, R)                                           \
+  ((long long)__builtin_ia32_vcvttsd2sis64((__v2df)(__m128d)(A),               \
+                                           (const int)(R)))
+
+#define _mm_cvtts_roundsd_i64(A, R)                                            \
+  ((long long)__builtin_ia32_vcvttsd2sis64((__v2df)(__m128d)(A),               \
+                                           (const int)(R)))
+#endif /* __x86_64__ */
+
+//  128 Bit : Double -> int
----------------
phoebewang wrote:

Remove one space. The same below.

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


More information about the cfe-commits mailing list