[PATCH] D31736: Implement _interlockedbittestandset as a builtin

2017-04-10 Thread Hans Wennborg via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL299782: Implement _interlockedbittestandset as a builtin (authored by hans). Changed prior to commit: https://reviews.llvm.org/D31736?vs=94433&id=94539#toc Repository: rL LLVM https://reviews.llvm.o

[PATCH] D31736: Implement _interlockedbittestandset as a builtin

2017-04-06 Thread Reid Kleckner via Phabricator via cfe-commits
rnk accepted this revision. rnk added a comment. This revision is now accepted and ready to land. lgtm Comment at: lib/CodeGen/CGBuiltin.cpp:570 +llvm::AtomicOrdering::SequentiallyConsistent); +llvm::Value *Shifted = Builder.CreateLShr(RMWI, Bit); +llvm::Value *

[PATCH] D31736: Implement _interlockedbittestandset as a builtin

2017-04-06 Thread Hans Wennborg via Phabricator via cfe-commits
hans added inline comments. Comment at: lib/CodeGen/CGBuiltin.cpp:570 +llvm::AtomicOrdering::SequentiallyConsistent); +llvm::Value *Shifted = Builder.CreateLShr(RMWI, Bit); +llvm::Value *Truncated = rnk wrote: > Can you comment that this shifts th

[PATCH] D31736: Implement _interlockedbittestandset as a builtin

2017-04-06 Thread Hans Wennborg via Phabricator via cfe-commits
hans updated this revision to Diff 94433. hans added a comment. Add comment. https://reviews.llvm.org/D31736 Files: include/clang/Basic/Builtins.def lib/CodeGen/CGBuiltin.cpp lib/Headers/intrin.h test/CodeGen/ms-intrinsics.c Index: test/CodeGen/ms-intrinsics.c =

[PATCH] D31736: Implement _interlockedbittestandset as a builtin

2017-04-05 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added inline comments. Comment at: lib/CodeGen/CGBuiltin.cpp:570 +llvm::AtomicOrdering::SequentiallyConsistent); +llvm::Value *Shifted = Builder.CreateLShr(RMWI, Bit); +llvm::Value *Truncated = Can you comment that this shifts the relevant bit

[PATCH] D31736: Implement _interlockedbittestandset as a builtin

2017-04-05 Thread Hans Wennborg via Phabricator via cfe-commits
hans created this revision. It's used by MS headers in VS 2017 without including intrin.h, so we can't implement it in the header anymore. https://reviews.llvm.org/D31736 Files: include/clang/Basic/Builtins.def lib/CodeGen/CGBuiltin.cpp lib/Headers/intrin.h test/CodeGen/ms-intrinsics.c