Skip to content

Commit 82c6303

Browse files
committed
Added new intrinsic declaration
1 parent 22a8a5a commit 82c6303

File tree

1 file changed

+84
-0
lines changed
  • library/core/src/intrinsics

1 file changed

+84
-0
lines changed

library/core/src/intrinsics/mod.rs

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1297,7 +1297,91 @@ pub unsafe fn atomic_singlethreadfence_acquire() {
12971297
pub unsafe fn atomic_singlethreadfence_release() {
12981298
unreachable!()
12991299
}
1300+
/// A compiler-only memory barrier.
1301+
///
1302+
/// Memory accesses will never be reordered across this barrier by the
1303+
/// compiler, but no instructions will be emitted for it. This is
1304+
/// appropriate for operations on the same thread that may be preempted,
1305+
/// such as when interacting with signal handlers.
1306+
///
1307+
/// The stabilized version of this intrinsic is available in
1308+
/// [`atomic::compiler_fence`] by passing [`Ordering::AcqRel`]
1309+
/// as the `order`.
1310+
#[rustc_intrinsic]
1311+
#[rustc_intrinsic_must_be_overridden]
1312+
#[rustc_nounwind]
1313+
pub unsafe fn atomic_singlethreadfence_acqrel() {
1314+
unreachable!()
1315+
}
1316+
1317+
/// The `prefetch` intrinsic is a hint to the code generator to insert a prefetch instruction
1318+
/// if supported; otherwise, it is a no-op.
1319+
/// Prefetches have no effect on the behavior of the program but can change its performance
1320+
/// characteristics.
1321+
///
1322+
/// The `locality` argument must be a constant integer and is a temporal locality specifier
1323+
/// ranging from (0) - no locality, to (3) - extremely local keep in cache.
1324+
///
1325+
/// This intrinsic does not have a stable counterpart.
1326+
#[rustc_nounwind]
1327+
pub unsafe fn prefetch_read_data<T>(_data: *const T, _locality: i32) {
1328+
unreachable!()
1329+
}
1330+
/// The `prefetch` intrinsic is a hint to the code generator to insert a prefetch instruction
1331+
/// if supported; otherwise, it is a no-op.
1332+
/// Prefetches have no effect on the behavior of the program but can change its performance
1333+
/// characteristics.
1334+
///
1335+
/// The `locality` argument must be a constant integer and is a temporal locality specifier
1336+
/// ranging from (0) - no locality, to (3) - extremely local keep in cache.
1337+
///
1338+
/// This intrinsic does not have a stable counterpart.
1339+
#[rustc_intrinsic]
1340+
#[rustc_intrinsic_must_be_overridden]
1341+
#[rustc_nounwind]
1342+
pub unsafe fn prefetch_write_data<T>(_data: *const T, _locality: i32) {
1343+
unreachable!()
1344+
}
1345+
/// The `prefetch` intrinsic is a hint to the code generator to insert a prefetch instruction
1346+
/// if supported; otherwise, it is a no-op.
1347+
/// Prefetches have no effect on the behavior of the program but can change its performance
1348+
/// characteristics.
1349+
///
1350+
/// The `locality` argument must be a constant integer and is a temporal locality specifier
1351+
/// ranging from (0) - no locality, to (3) - extremely local keep in cache.
1352+
///
1353+
/// This intrinsic does not have a stable counterpart.
1354+
#[rustc_intrinsic]
1355+
#[rustc_intrinsic_must_be_overridden]
1356+
#[rustc_nounwind]
1357+
pub unsafe fn prefetch_read_instruction<T>(_data: *const T, _locality: i32) {
1358+
unreachable!()
1359+
}
1360+
/// The `prefetch` intrinsic is a hint to the code generator to insert a prefetch instruction
1361+
/// if supported; otherwise, it is a no-op.
1362+
/// Prefetches have no effect on the behavior of the program but can change its performance
1363+
/// characteristics.
1364+
///
1365+
/// The `locality` argument must be a constant integer and is a temporal locality specifier
1366+
/// ranging from (0) - no locality, to (3) - extremely local keep in cache.
1367+
///
1368+
/// This intrinsic does not have a stable counterpart.
1369+
#[rustc_intrinsic]
1370+
#[rustc_intrinsic_must_be_overridden]
1371+
#[rustc_nounwind]
1372+
pub unsafe fn prefetch_write_instruction<T>(_data: *const T, _locality: i32) {
1373+
unreachable!()
1374+
}
13001375

1376+
/// Executes a breakpoint trap, for inspection by a debugger.
1377+
///
1378+
/// This intrinsic does not have a stable counterpart.
1379+
#[rustc_intrinsic]
1380+
#[rustc_intrinsic_must_be_overridden]
1381+
#[rustc_nounwind]
1382+
pub unsafe fn breakpoint() {
1383+
unreachable!()
1384+
}
13011385

13021386
/// Aborts the execution of the process.
13031387
///

0 commit comments

Comments
 (0)