Skip to content

Commit c81153f

Browse files
committed
intrinsics: reduce references to LLVM and update notes on where the implementations live
1 parent 6034214 commit c81153f

File tree

1 file changed

+9
-20
lines changed

1 file changed

+9
-20
lines changed

core/src/intrinsics/mod.rs

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
//! Compiler intrinsics.
22
//!
3-
//! The corresponding definitions are in <https://github.com/rust-lang/rust/blob/master/compiler/rustc_codegen_llvm/src/intrinsic.rs>.
4-
//! The corresponding const implementations are in <https://github.com/rust-lang/rust/blob/master/compiler/rustc_const_eval/src/interpret/intrinsics.rs>.
3+
//! These are the imports making intrinsics available to Rust code. The actual implementations live in the compiler.
4+
//! Some of these intrinsics are lowered to MIR in <https://github.com/rust-lang/rust/blob/master/compiler/rustc_mir_transform/src/lower_intrinsics.rs>.
5+
//! The remaining intrinsics are implemented for the LLVM backend in <https://github.com/rust-lang/rust/blob/master/compiler/rustc_codegen_ssa/src/mir/intrinsic.rs>
6+
//! and <https://github.com/rust-lang/rust/blob/master/compiler/rustc_codegen_llvm/src/intrinsic.rs>,
7+
//! and for const evaluation in <https://github.com/rust-lang/rust/blob/master/compiler/rustc_const_eval/src/interpret/intrinsics.rs>.
58
//!
69
//! # Const intrinsics
710
//!
@@ -20,28 +23,14 @@
2023
//!
2124
//! The volatile intrinsics provide operations intended to act on I/O
2225
//! memory, which are guaranteed to not be reordered by the compiler
23-
//! across other volatile intrinsics. See the LLVM documentation on
24-
//! [[volatile]].
25-
//!
26-
//! [volatile]: https://llvm.org/docs/LangRef.html#volatile-memory-accesses
26+
//! across other volatile intrinsics. See [`read_volatile`][ptr::read_volatile]
27+
//! and [`write_volatile`][ptr::write_volatile].
2728
//!
2829
//! # Atomics
2930
//!
3031
//! The atomic intrinsics provide common atomic operations on machine
31-
//! words, with multiple possible memory orderings. They obey the same
32-
//! semantics as C++11. See the LLVM documentation on [[atomics]].
33-
//!
34-
//! [atomics]: https://llvm.org/docs/Atomics.html
35-
//!
36-
//! A quick refresher on memory ordering:
37-
//!
38-
//! * Acquire - a barrier for acquiring a lock. Subsequent reads and writes
39-
//! take place after the barrier.
40-
//! * Release - a barrier for releasing a lock. Preceding reads and writes
41-
//! take place before the barrier.
42-
//! * Sequentially consistent - sequentially consistent operations are
43-
//! guaranteed to happen in order. This is the standard mode for working
44-
//! with atomic types and is equivalent to Java's `volatile`.
32+
//! words, with multiple possible memory orderings. See the
33+
//! [atomic types][crate::sync::atomic] docs for details.
4534
//!
4635
//! # Unwinding
4736
//!

0 commit comments

Comments
 (0)