about summary refs log tree commit diff
path: root/src/libcore/hint.rs
AgeCommit message (Collapse)AuthorLines
2019-04-03Updated the reference in core::hint::spin_loop to the correct relative path.Christian-1/+1
2019-04-03Updated the documentation of core::hints::spin_loop and ↵Christian-7/+20
core::sync::spin_loop_hint
2019-03-26Life's too short not to use cfg_ifgnzlbg-23/+20
2019-03-26Document why the volatile read is usedgnzlbg-0/+1
2019-03-26Use fallback on emscripten targetsgnzlbg-2/+18
2019-03-25black_box should use inline assembly on wasm32gnzlbg-3/+3
2019-03-25black_box should inhibit optimizations on platforms without inline assemblygnzlbg-3/+6
2019-03-25Remove dupplicated configgnzlbg-2/+2
2019-03-25Moves test::black_box to core::hintgnzlbg-0/+19
This changes removes a cyclic dependency between the "test" and "libtest" crates, where "libtest" depends on "test" for "black_box", but "test" depends on "libtest" for everything else. I've chosen the "hint" module because there seems to be enough consensus in the discussion of RFC2360 that this module is where such an intrinsic would belong, but this PR does not implement that RFC! (note: if that RFC ever gets merged, the API, docs, etc. of this API will need to change). For backwards compatibility reasons I've chosen to also keep the "test" feature gate for these instead of adding a new feature gate. If we change the feature gate, we'll potentially all benchmarks, and while that's something that we could do, it seems unnecessary to do that now - if RFC2360 gets merged, we'll need to do that anyways.
2019-03-21Fix undefined behavior in hint::spin_loop for x86 targets without SSE2gnzlbg-6/+25
The pause instruction requires SSE2 but was being unconditionally used on targets without it, resulting in undefined behavior. This PR fixes that by only using the pause intrinsic if SSE2 is available. It also removes the inline assembly which was not required since these instructions are available in core::arch, and extends support of the spin_loop hint to arm targets with the v6 feature which also support the yield instruction. Closes #59237 .
2019-02-10libs: doc commentsAlexander Regueiro-1/+1
2019-01-15Move spin_loop_hint to core::hint moduleClar Fon-0/+23
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-1/+1
2018-04-16Stabilize core::hint::unreachable_unchecked.kennytm-0/+61
Closes #43751.