summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/ms-intrinsics.c
diff options
context:
space:
mode:
authorMandeep Singh Grang <mgrang@codeaurora.org>2018-10-05 19:49:36 +0000
committerMandeep Singh Grang <mgrang@codeaurora.org>2018-10-05 19:49:36 +0000
commit15e0f7fa2816d87c4fcce6d32f6c8f800cdc54c6 (patch)
treef47b6a0a7ff40e37a3b24aceb1d7daa839025bcb /clang/test/CodeGen/ms-intrinsics.c
parent0cb905142a7d9dceb6b2a9b572626c909a5cd026 (diff)
downloadbcm5719-llvm-15e0f7fa2816d87c4fcce6d32f6c8f800cdc54c6.tar.gz
bcm5719-llvm-15e0f7fa2816d87c4fcce6d32f6c8f800cdc54c6.zip
[COFF, ARM64] Add _InterlockedCompareExchangePointer_nf intrinsic
Reviewers: rnk, mstorsjo, compnerd, TomTan, haripul, efriedma Reviewed By: efriedma Subscribers: efriedma, kristof.beyls, chrib, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D52807 llvm-svn: 343881
Diffstat (limited to 'clang/test/CodeGen/ms-intrinsics.c')
-rw-r--r--clang/test/CodeGen/ms-intrinsics.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/test/CodeGen/ms-intrinsics.c b/clang/test/CodeGen/ms-intrinsics.c
index bc0b46fc405..bfc182f26bd 100644
--- a/clang/test/CodeGen/ms-intrinsics.c
+++ b/clang/test/CodeGen/ms-intrinsics.c
@@ -235,6 +235,21 @@ void *test_InterlockedCompareExchangePointer(void * volatile *Destination,
// CHECK: ret i8* %[[RESULT:[0-9]+]]
// CHECK: }
+void *test_InterlockedCompareExchangePointer_nf(void * volatile *Destination,
+ void *Exchange, void *Comparand) {
+ return _InterlockedCompareExchangePointer_nf(Destination, Exchange, Comparand);
+}
+
+// CHECK: define{{.*}}i8* @test_InterlockedCompareExchangePointer_nf(i8** {{[a-z_ ]*}}%Destination, i8* {{[a-z_ ]*}}%Exchange, i8* {{[a-z_ ]*}}%Comparand){{.*}}{
+// CHECK: %[[DEST:[0-9]+]] = bitcast i8** %Destination to [[iPTR]]*
+// CHECK: %[[EXCHANGE:[0-9]+]] = ptrtoint i8* %Exchange to [[iPTR]]
+// CHECK: %[[COMPARAND:[0-9]+]] = ptrtoint i8* %Comparand to [[iPTR]]
+// CHECK: %[[XCHG:[0-9]+]] = cmpxchg volatile [[iPTR]]* %[[DEST:[0-9]+]], [[iPTR]] %[[COMPARAND:[0-9]+]], [[iPTR]] %[[EXCHANGE:[0-9]+]] monotonic monotonic
+// CHECK: %[[EXTRACT:[0-9]+]] = extractvalue { [[iPTR]], i1 } %[[XCHG]], 0
+// CHECK: %[[RESULT:[0-9]+]] = inttoptr [[iPTR]] %[[EXTRACT]] to i8*
+// CHECK: ret i8* %[[RESULT:[0-9]+]]
+// CHECK: }
+
char test_InterlockedExchange8(char volatile *value, char mask) {
return _InterlockedExchange8(value, mask);
}
OpenPOWER on IntegriCloud