about summary refs log tree commit diff
path: root/src/libcore/hint.rs
AgeCommit message (Collapse)AuthorLines
2020-07-27mv std libs to library/mark-127/+0
2020-07-17Make unreachable_unchecked a const fnNazım Can Altınova-1/+2
2020-06-30Deny unsafe ops in unsafe fns, part 6LeSeulArtichaut-2/+0
And final part!!!
2020-06-30Deny unsafe ops in unsafe fns, part 1LeSeulArtichaut-1/+5
2020-04-24Document unsafety in `core::{panicking, alloc::layout, hint, ↵LeSeulArtichaut-2/+7
iter::adapters::zip}`
2020-04-03Make documentation examples use new integer assoc constsLinus Färnstrand-1/+1
2020-03-26Rename asm! to llvm_asm!Amanieu d'Antras-1/+1
asm! is left as a wrapper around llvm_asm! to maintain compatibility.
2020-03-20remove redundant returns (clippy::needless_return)Matthias Krüger-1/+1
2019-12-06Format libcore with rustfmt (including tests and benches)David Tolnay-16/+12
2019-11-26Fix spelling typosBrian Wignall-1/+1
2019-11-06Have tidy ensure that we document all `unsafe` blocks in libcoreOliver Scherer-0/+2
2019-10-16Upgrade Emscripten targets to use upstream LLVM backendThomas Lively-16/+0
- Compatible with Emscripten 1.38.46-upstream or later upstream. - Refactors the Emscripten target spec to share code with other wasm targets. - Replaces the old incorrect wasm32 C call ABI with the correct one, preserving the old one as wasm32_bindgen_compat for wasm-bindgen compatibility. - Updates the varargs ABI used by Emscripten and deletes the old one. - Removes the obsolete wasm32-experimental-emscripten target. - Uses EMCC_CFLAGS on CI to avoid the timeout problems with #63649.
2019-10-05Revert "Auto merge of #63649 - tlively:emscripten-upstream-upgrade, ↵Tyler Mandry-0/+16
r=alexcrichton" This reverts commit 7870050796e5904a0fc85ecbe6fa6dde1cfe0c91, reversing changes made to 2e7244807a7878f6eca3eb7d97ae9b413aa49014.
2019-10-04Upgrade Emscripten targets to use upstream LLVM backendThomas Lively-16/+0
- Refactors the Emscripten target spec to share code with other wasm targets. - Replaces the incorrect wasm32 C call ABI with the old asmjs version, which is correct for both wasm32 and JS. - Updates the varargs ABI used by Emscripten and deletes the old one. - Removes the obsolete wasm32-experimental-emscripten target. - Temporarily makes Emscripten targets use panic=abort by default because supporting unwinding will require an LLVM patch.
2019-09-18broken hyperlinks in documentationArno Haase-1/+1
2019-09-17newly phrased documentation for spin loop hintsArno Haase-17/+5
2019-09-10fixed linter errorArno Haase-7/+7
2019-09-10typo fixArno Haase-1/+1
2019-09-10documentation enhancement for 'spin loop hint': replace 'CPU' with 'CPU or core'Arno Haase-3/+3
2019-08-26Auto merge of #62891 - vext01:improve-black-box-docs, r=RalfJung,Centril,gnzlbgbors-4/+12
Improve the documentation for std::hint::black_box. The other day a colleague was reviewing some of my code which was using `black_box` to block constant propogation. There was a little confusion because the documentation kind of implies that `black_box` is only useful for dead code elimination, and only in benchmarking scenarios. The docs currently say: > A function that is opaque to the optimizer, to allow benchmarks to pretend to use outputs to assist in avoiding dead-code elimination. Here is our discussion, in which I show (using godbolt) that a black box can also block constant propagation: https://github.com/softdevteam/yk/pull/21#discussion_r302985038 This change makes the docstring for `black_box` a little more general, and while we are here, I've added an example (the same one from our discussion). ![image](https://user-images.githubusercontent.com/604955/61701322-ddf1e400-ad35-11e9-878c-b5b44a20770c.png) OK to go in?
2019-08-24Improve the documentation for std::hint::black_box.Edd Barrett-4/+12
2019-07-31Remove derives `Encodable`/`Decodable` and unstabilize attribute `#[bench]`Vadim Petrochenkov-1/+1
2019-06-10std: Remove internal definitions of `cfg_if!` macroAlex Crichton-25/+25
This is duplicated in a few locations throughout the sysroot to work around issues with not exporting a macro in libstd but still wanting it available to sysroot crates to define blocks. Nowadays though we can simply depend on the `cfg-if` crate on crates.io, allowing us to use it from there!
2019-04-18libcore => 2018Taiki Endo-1/+1
2019-04-05Remove parensUnreachable-2/+2
2019-04-05improve docs for std::hint::unreachable_unchecked()Unreachable-3/+2
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.