[clang] [Headers][X86] Add a couple of tests for MMX/SSE intrinsics (PR #105852)

Phoebe Wang via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 23 19:03:12 PDT 2024


================
@@ -0,0 +1,105 @@
+// RUN: %clang_cc1 -triple i386-unknown-unknown -target-feature +mmx \
+// RUN:  -target-feature +sse2 -O0 -emit-llvm %s -o - | FileCheck %s
+
+// Test that mmx/sse2 shift intrinsics map to the expected builtins.
+
+// Don't include mm_malloc.h, it's system specific.
+#define __MM_MALLOC_H
+
+#include <x86intrin.h>
+
+__m64 check__mm_slli_pi16(__m64 m) {
+  // CHECK-LABEL: @check__mm_slli_pi16
+  // CHECK: @llvm.x86.sse2.pslli.w(<8 x i16> %{{.*}}, i32 {{.*}})
+  return _mm_slli_pi16(m, 8);
----------------
phoebewang wrote:

I found there are similar tests in mmx-builtins.c and sse2-builtins.c. Is there anything new testing here? Or not to add them?

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


More information about the cfe-commits mailing list