core::arch::x86::_mm_prefetch - Rust
Description: API documentation for the Rust `_mm_prefetch` fn in crate `core`.
Keywords: rust, rustlang, rust-lang, _mm_prefetch

# 1.27.0[−][src]Function core::arch::x86::_mm_prefetch

    pub unsafe fn _mm_prefetch(p: *const i8, strategy: i32)

This is supported on x86 and target feature `sse` only.

Fetch the cache line that contains address `p` using the given `strategy`.

The `strategy` must be one of:

- `_MM_HINT_T0`: Fetch into all levels of the cache hierachy.

- `_MM_HINT_T1`: Fetch into L2 and higher.

- `_MM_HINT_T2`: Fetch into L3 and higher or an implementation-specific choice (e.g., L2 if there is no L3).

- `_MM_HINT_NTA`: Fetch data using the non-temporal access (NTA) hint. It may be a place closer than main memory but outside of the cache hierarchy. This is used to reduce access latency without polluting the cache.

The actual implementation depends on the particular CPU. This instruction is considered a hint, so the CPU is also free to simply ignore the request.

The amount of prefetched data depends on the cache line size of the specific CPU, but it will be at least 32 bytes.

Common caveats:

- Most modern CPUs already automatically prefetch data based on predicted access patterns.

- Data is usually not fetched if this would cause a TLB miss or a page fault.

- Too much prefetching can cause unnecessary cache evictions.

- Prefetching may also fail if there are not enough memory-subsystem resources (e.g., request buffers).

Intel's documentation

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g. `str,u8` or `String,struct:Vec,test`)