summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/ms-intrinsics.c
diff options
context:
space:
mode:
authorAlbert Gutowski <agutowski@google.com>2016-10-04 22:29:49 +0000
committerAlbert Gutowski <agutowski@google.com>2016-10-04 22:29:49 +0000
commitf3a0bce1557f2c070518875122a8eb648f971211 (patch)
treef1820a93a695c12671d7145bd32d722631905749 /clang/test/CodeGen/ms-intrinsics.c
parente7439392f14f46b5214a5cf9c8d0244259cd6689 (diff)
downloadbcm5719-llvm-f3a0bce1557f2c070518875122a8eb648f971211.tar.gz
bcm5719-llvm-f3a0bce1557f2c070518875122a8eb648f971211.zip
Separate builtins for x84-64 and i386; implement __mulh and __umulh
Summary: We need x86-64-specific builtins if we want to implement some of the MS intrinsics - winnt.h contains definitions of some functions for i386, but not for x86-64 (for example _InterlockedOr64), which means that we cannot treat them as builtins for both i386 and x86-64, because then we have definitions of builtin functions in winnt.h on i386. Reviewers: thakis, majnemer, hans, rnk Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D24598 llvm-svn: 283264
Diffstat (limited to 'clang/test/CodeGen/ms-intrinsics.c')
-rw-r--r--clang/test/CodeGen/ms-intrinsics.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/test/CodeGen/ms-intrinsics.c b/clang/test/CodeGen/ms-intrinsics.c
index 8547c63142b..d3ca33b6ecc 100644
--- a/clang/test/CodeGen/ms-intrinsics.c
+++ b/clang/test/CodeGen/ms-intrinsics.c
@@ -54,12 +54,17 @@ long test__readfsdword(unsigned long Offset) {
#endif
#if defined(__x86_64__)
+__int64 test__mulh(__int64 a, __int64 b) {
+ return __mulh(a, b);
+}
+// CHECK-X64-LABEL: define i64 @test__mulh(i64 %a, i64 %b)
+// CHECK-X64: = mul nsw i128 %
+
unsigned __int64 test__umulh(unsigned __int64 a, unsigned __int64 b) {
return __umulh(a, b);
}
// CHECK-X64-LABEL: define i64 @test__umulh(i64 %a, i64 %b)
// CHECK-X64: = mul nuw i128 %
-
#endif
char test_InterlockedExchange8(char volatile *value, char mask) {
OpenPOWER on IntegriCloud