package ocaml_intrinsics

  1. Overview
  2. Docs

Bring the line of data from memory that contains the specified address.

The instruction is a hint that is ignored on some targets. Some values or temporal_locality and operation hints are not supported on some targets.

type temporal_locality =
  1. | None
  2. | Low
  3. | Moderate
  4. | High

temporal locality is a hint to a location in the cache hierarchy where the prefetch data should be placed.

Higher temporal locality hint means prefetching data closer to the CPU. For example, on Intel targets, High means prefetch to all levels of cache, and Moderate means prefetch to L2 cache and higher, but not L1 cache.

type operation =
  1. | Read
  2. | Write

Anticipated operation that the data will used for. In preparation for write, the data can be brought into cache in exclusive state, whereas for read, shared state is sufficient.

val native_pointer : Native_pointer.t -> operation:operation -> temporal_locality:temporal_locality -> unit
val ext_pointer : Ext_pointer.t -> operation:operation -> temporal_locality:temporal_locality -> unit
val bigstring : (char, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.t -> pos:int -> operation:operation -> temporal_locality:temporal_locality -> unit
val pause : unit -> unit

Processor hint that improves performance of spin-wait loops.

OCaml

Innovation. Community. Security.