summaryrefslogtreecommitdiffstats
path: root/test/CodeGen/ms-x86-intrinsics.c
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2018-08-21 15:56:49 +0000
committerHans Wennborg <hans@hanshq.net>2018-08-21 15:56:49 +0000
commit30dc94c745c6747512c3dead2584f07b7a31868f (patch)
tree86046370a812eb4c1e31d0f818d9dad25aedc5e5 /test/CodeGen/ms-x86-intrinsics.c
parentdeea4eee5de7c93740402afdb85a595635c78606 (diff)
Merging r340048:
------------------------------------------------------------------------ r340048 | nico | 2018-08-17 19:19:06 +0200 (Fri, 17 Aug 2018) | 10 lines Make __shiftleft128 / __shiftright128 real compiler built-ins. r337619 added __shiftleft128 / __shiftright128 as functions in intrin.h. Microsoft's STL plans on using these functions, and they're using intrin0.h which just has declarations of built-ins to not pull in the huge intrin.h header in the standard library headers. That requires that these functions are real built-ins. https://reviews.llvm.org/D50907 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_70@340289 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/ms-x86-intrinsics.c')
-rw-r--r--test/CodeGen/ms-x86-intrinsics.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/test/CodeGen/ms-x86-intrinsics.c b/test/CodeGen/ms-x86-intrinsics.c
index 450a134131..bd8f5fce23 100644
--- a/test/CodeGen/ms-x86-intrinsics.c
+++ b/test/CodeGen/ms-x86-intrinsics.c
@@ -130,4 +130,34 @@ unsigned __int64 test_umul128(unsigned __int64 Multiplier,
// CHECK-X64: = mul nuw i128 %
// CHECK-X64: store i64 %
// CHECK-X64: ret i64 %
-#endif
+
+unsigned __int64 test__shiftleft128(unsigned __int64 l, unsigned __int64 h,
+ unsigned char d) {
+ return __shiftleft128(l, h, d);
+}
+// CHECK-X64-LABEL: define dso_local i64 @test__shiftleft128(i64 %l, i64 %h, i8 %d)
+// CHECK-X64 = zext i64 %h to i128
+// CHECK-X64 = shl nuw i128 %0, 64
+// CHECK-X64 = zext i64 %l to i128
+// CHECK-X64 = or i128 %1, %2
+// CHECK-X64 = and i8 %d, 63
+// CHECK-X64 = shl i128 %
+// CHECK-X64 = lshr i128 %
+// CHECK-X64 = trunc i128 %
+// CHECK-X64 ret i64 %
+
+unsigned __int64 test__shiftright128(unsigned __int64 l, unsigned __int64 h,
+ unsigned char d) {
+ return __shiftright128(l, h, d);
+}
+// CHECK-X64-LABEL: define dso_local i64 @test__shiftright128(i64 %l, i64 %h, i8 %d)
+// CHECK-X64 = zext i64 %h to i128
+// CHECK-X64 = shl nuw i128 %
+// CHECK-X64 = zext i64 %l to i128
+// CHECK-X64 = or i128 %
+// CHECK-X64 = and i8 %d, 63
+// CHECK-X64 = lshr i128 %
+// CHECK-X64 = trunc i128 %
+// CHECK-X64 ret i64 %
+
+#endif // defined(__x86_64__)