[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:48:49 PDT 2024


================
@@ -0,0 +1,183 @@
+// RUN: %clang_cc1 -flax-vector-conversions=none -ffreestanding %s -triple=i386-unknown-unknown -target-feature +avx10.2-512 -emit-llvm -o - | FileCheck %s
+
+#include <immintrin.h>
+#include <stddef.h>
+
+int test_mm_cvttssd_i32(__m128d __A) {
+  // CHECK-LABEL: @test_mm_cvttssd_i32
+  // CHECK: @llvm.x86.avx512.vcvttsd2sis
+  return _mm_cvtts_roundsd_i32(__A, _MM_FROUND_NO_EXC);
+}
+
+int test_mm_cvttssd_si32(__m128d __A) {
+  // CHECK-LABEL: @test_mm_cvttssd_si32(
+  // CHECK: @llvm.x86.avx512.vcvttsd2sis(<2 x double>
+  return _mm_cvtts_roundsd_si32(__A, _MM_FROUND_NO_EXC);
+}
+
+unsigned test_mm_cvttssd_u32(__m128d __A) {
+  // CHECK-LABEL: @test_mm_cvttssd_u32(
+  // CHECK: @llvm.x86.avx512.vcvttsd2usis(<2 x double>
+  return _mm_cvtts_roundsd_u32(__A, _MM_FROUND_NO_EXC);
+}
+
+int test_mm_cvttsss_i32(__m128 __A) {
+  // CHECK-LABEL: @test_mm_cvttsss_i32(
+  // CHECK: @llvm.x86.avx512.vcvttss2sis(<4 x float>
+  return _mm_cvtts_roundss_i32(__A, _MM_FROUND_NO_EXC);
+}
+
+int test_mm_cvttsss_si32(__m128 __A) {
+  // CHECK-LABEL: @test_mm_cvttsss_si32(
+  // CHECK: @llvm.x86.avx512.vcvttss2sis(<4 x float>
+  return _mm_cvtts_roundss_si32(__A, _MM_FROUND_NO_EXC);
+}
+
+unsigned test_mm_cvttsss_u32(__m128 __A) {
+  // CHECK-LABEL: @test_mm_cvttsss_u32(
+  // CHECK: @llvm.x86.avx512.vcvttss2usis(<4 x float>
+  return _mm_cvtts_roundss_u32(__A, _MM_FROUND_NO_EXC);
+}
----------------
phoebewang wrote:

Move these to avx10_2satcvtds-builtins-x64.c

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


More information about the cfe-commits mailing list