[cfe-commits] r114247 - /cfe/trunk/test/CodeGen/mmx-shift-with-immediate.c

Bill Wendling isanbard at gmail.com
Fri Sep 17 17:26:29 PDT 2010


Author: void
Date: Fri Sep 17 19:26:29 2010
New Revision: 114247

URL: http://llvm.org/viewvc/llvm-project?rev=114247&view=rev
Log:
Testcase for r114239.

Added:
    cfe/trunk/test/CodeGen/mmx-shift-with-immediate.c

Added: cfe/trunk/test/CodeGen/mmx-shift-with-immediate.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/mmx-shift-with-immediate.c?rev=114247&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/mmx-shift-with-immediate.c (added)
+++ cfe/trunk/test/CodeGen/mmx-shift-with-immediate.c Fri Sep 17 19:26:29 2010
@@ -0,0 +1,26 @@
+// RUN: %clang -mmmx -ccc-host-triple i386-unknown-unknown -emit-llvm -S %s -o - | FileCheck %s
+#include <mmintrin.h>
+
+void shift(__m64 a, __m64 b, int c) {
+  // CHECK: <4 x i16> @llvm.x86.mmx.pslli.w(<4 x i16> %{{.*}}, i32 {{.*}})
+  _mm_slli_pi16(a, c);
+  // CHECK: <2 x i32> @llvm.x86.mmx.pslli.d(<2 x i32> %{{.*}}, i32 {{.*}})
+  _mm_slli_pi32(a, c);
+  // FIXME: <1 x i64> @llvm.x86.mmx.pslli.q(<1 x i64> %{{.*}}, i32 {{.*}})
+  // This is currently lowered into non-intrinsic instructions. This may not be
+  // correct once the MMX reworking is finished.
+  _mm_slli_si64(a, c);
+
+  // CHECK: <4 x i16> @llvm.x86.mmx.psrli.w(<4 x i16> %{{.*}}, i32 {{.*}})
+  _mm_srli_pi16(a, c);
+  // CHECK: <2 x i32> @llvm.x86.mmx.psrli.d(<2 x i32> %{{.*}}, i32 {{.*}})
+  _mm_srli_pi32(a, c);
+  // FIXME: <1 x i64> @llvm.x86.mmx.psrli.q(<1 x i64> %{{.*}}, i32 {{.*}})
+  // See above.
+  _mm_srli_si64(a, c);
+
+  // CHECK: <4 x i16> @llvm.x86.mmx.psrai.w(<4 x i16> %{{.*}}, i32 {{.*}})
+  _mm_srai_pi16(a, c);
+  // CHECK: <2 x i32> @llvm.x86.mmx.psrai.d(<2 x i32> %{{.*}}, i32 {{.*}})
+  _mm_srai_pi32(a, c);
+}





More information about the cfe-commits mailing list