]> git.lizzy.rs Git - rust.git/commit
Auto merge of #1342 - divergentdave:pause-instruction, r=RalfJung
authorbors <bors@rust-lang.org>
Sun, 19 Apr 2020 14:53:02 +0000 (14:53 +0000)
committerbors <bors@rust-lang.org>
Sun, 19 Apr 2020 14:53:02 +0000 (14:53 +0000)
commit763782aa0809ba4e92d5a6e442b843ab86c2d1f0
treed4aa82a01e15822f1b8e92080a6c4d4ea26bcc80
parent4155fb610fca4fe38348ae9c57931450d7bc95d7
parent547a4cc9209e04c2bbbe84edcd625272e51e45b2
Auto merge of #1342 - divergentdave:pause-instruction, r=RalfJung

Handle std::sync::atomic::spin_loop_hint()

This PR adds support for `std::sync::atomic::spin_loop_hint()` by implementing the `llvm.x86.sse2.pause` intrinsic when the target is x86-based. It appears this is the first LLVM intrinsic in foreign_items, so I added a couple match blocks to handle it or fall through to the different OS-specific methods. I added a basic smoke test to `tests/run-pass/sync.rs`. I came across this by way of `crossbeam::utils::Backoff::spin()`, FWIW.