nontemporal_store: make sure that the intrinsic is truly just a hint · patricklam/verify-rust-std@e6aede2 (original) (raw)

`@@ -2386,12 +2386,12 @@ extern "rust-intrinsic" {

`

2386

2386

`#[rustc_nounwind]

`

2387

2387

`pub fn catch_unwind(try_fn: fn(*mut u8), data: *mut u8, catch_fn: fn(*mut u8, *mut u8)) -> i32;

`

2388

2388

``

2389

``

`` -

/// Emits a !nontemporal store according to LLVM (see their docs).

``

2390

``

`-

/// Probably will never become stable.

`

``

2389

`` +

/// Emits a nontemporal store, which gives a hint to the CPU that the data should not be held

``

``

2390

`` +

/// in cache. Except for performance, this is fully equivalent to ptr.write(val).

``

2391

2391

`///

`

2392

``

`-

/// Do NOT use this intrinsic; "nontemporal" operations do not exist in our memory model!

`

2393

``

`-

/// It exists to support current stdarch, but the plan is to change stdarch and remove this intrinsic.

`

2394

``

`-

/// See https://github.com/rust-lang/rust/issues/114582 for some more discussion.

`

``

2392

`` +

/// Not all architectures provide such an operation. For instance, x86 does not: while MOVNT

``

``

2393

`` +

/// exists, that operation is not equivalent to ptr.write(val) (MOVNT writes can be reordered

``

``

2394

`+

/// in ways that are not allowed for regular writes).

`

2395

2395

`#[rustc_nounwind]

`

2396

2396

`pub fn nontemporal_store(ptr: *mut T, val: T);

`

2397

2397

``