# Module bitflags::__core::intrinsics [−] [src]

Unstable (`core_intrinsics`)

: intrinsics are unlikely to ever be stabilized, instead they should be used through stabilized interfaces in the rest of the standard library

rustc compiler intrinsics.

The corresponding definitions are in librustc_trans/trans/intrinsic.rs.

# Volatiles

The volatile intrinsics provide operations intended to act on I/O memory, which are guaranteed to not be reordered by the compiler across other volatile intrinsics. See the LLVM documentation on [volatile].

# Atomics

The atomic intrinsics provide common atomic operations on machine words, with multiple possible memory orderings. They obey the same semantics as C++11. See the LLVM documentation on [atomics].

A quick refresher on memory ordering:

- Acquire - a barrier for acquiring a lock. Subsequent reads and writes take place after the barrier.
- Release - a barrier for releasing a lock. Preceding reads and writes take place before the barrier.
- Sequentially consistent - sequentially consistent operations are guaranteed to happen in order. This is the standard mode for working with atomic types and is equivalent to Java's `volatile`.

## Functions

copy | Copies `count * size_of<T>` bytes from `src` to `dst`. The source and destination may overlap.
copy_nonoverlapping | Copies `count * size_of<T>` bytes from `src` to `dst`. The source and destination may not overlap.
drop_in_place | Executes the destructor (if any) of the pointed-to value.
transmute | Unsafely transforms a value of one type into a value of another type.
write_bytes | Invokes memset on the specified pointer, setting `count * size_of::<T>()` bytes of memory starting at `dst` to `val`.
abort | [Unstable] Aborts the execution of the process.
add_with_overflow | [Unstable] Performs checked integer addition.
arith_offset | [Unstable] Calculates the offset from a pointer, potentially wrapping.
assume | [Unstable] Informs the optimizer that a condition is always true. If the condition is false, the behavior is undefined.
atomic_and | [Unstable]
atomic_and_acq | [Unstable]
atomic_and_acqrel | [Unstable]
atomic_and_rel | [Unstable]
atomic_and_relaxed | [Unstable]
atomic_cxchg | [Unstable]
atomic_cxchg_acq | [Unstable]
atomic_cxchg_acq_failrelaxed | [Unstable]
atomic_cxchg_acqrel | [Unstable]
atomic_cxchg_acqrel_failrelaxed | [Unstable]
atomic_cxchg_failacq | [Unstable]
atomic_cxchg_failrelaxed | [Unstable]
atomic_cxchg_rel | [Unstable]
atomic_cxchg_relaxed | [Unstable]
atomic_cxchgweak | [Unstable]
atomic_cxchgweak_acq | [Unstable]
atomic_cxchgweak_acq_failrelaxed | [Unstable]
atomic_cxchgweak_acqrel | [Unstable]
atomic_cxchgweak_acqrel_failrelaxed | [Unstable]
atomic_cxchgweak_failacq | [Unstable]
atomic_cxchgweak_failrelaxed | [Unstable]
atomic_cxchgweak_rel | [Unstable]
atomic_cxchgweak_relaxed | [Unstable]
atomic_fence | [Unstable]
atomic_fence_acq | [Unstable]
atomic_fence_acqrel | [Unstable]
atomic_fence_rel | [Unstable]
atomic_load | [Unstable]
atomic_load_acq | [Unstable]
atomic_load_relaxed | [Unstable]
atomic_load_unordered | [Unstable]
atomic_max | [Unstable]
atomic_max_acq | [Unstable]
atomic_max_acqrel | [Unstable]
atomic_max_rel | [Unstable]
atomic_max_relaxed | [Unstable]
atomic_min | [Unstable]
atomic_min_acq | [Unstable]
atomic_min_acqrel | [Unstable]
atomic_min_rel | [Unstable]
atomic_min_relaxed | [Unstable]
atomic_nand | [Unstable]
atomic_nand_acq | [Unstable]
atomic_nand_acqrel | [Unstable]
atomic_nand_rel | [Unstable]
atomic_nand_relaxed | [Unstable]
atomic_or | [Unstable]
atomic_or_acq | [Unstable]
atomic_or_acqrel | [Unstable]
atomic_or_rel | [Unstable]
atomic_or_relaxed | [Unstable]
atomic_singlethreadfence | [Unstable] A compiler-only memory barrier.
atomic_singlethreadfence_acq | [Unstable]
atomic_singlethreadfence_acqrel | [Unstable]
atomic_singlethreadfence_rel | [Unstable]
atomic_store | [Unstable]
atomic_store_rel | [Unstable]
atomic_store_relaxed | [Unstable]
atomic_store_unordered | [Unstable]
atomic_umax | [Unstable]
atomic_umax_acq | [Unstable]
atomic_umax_acqrel | [Unstable]
atomic_umax_rel | [Unstable]
atomic_umax_relaxed | [Unstable]
atomic_umin | [Unstable]
atomic_umin_acq | [Unstable]
atomic_umin_acqrel | [Unstable]
atomic_umin_rel | [Unstable]
atomic_umin_relaxed | [Unstable]
atomic_xadd | [Unstable]
atomic_xadd_acq | [Unstable]
atomic_xadd_acqrel | [Unstable]
atomic_xadd_rel | [Unstable]
atomic_xadd_relaxed | [Unstable]
atomic_xchg | [Unstable]
atomic_xchg_acq | [Unstable]
atomic_xchg_acqrel | [Unstable]
atomic_xchg_rel | [Unstable]
atomic_xchg_relaxed | [Unstable]
atomic_xor | [Unstable]
atomic_xor_acq | [Unstable]
atomic_xor_acqrel | [Unstable]
atomic_xor_rel | [Unstable]
atomic_xor_relaxed | [Unstable]
atomic_xsub | [Unstable]
atomic_xsub_acq | [Unstable]
atomic_xsub_acqrel | [Unstable]
atomic_xsub_rel | [Unstable]
atomic_xsub_relaxed | [Unstable]
breakpoint | [Unstable] Executes a breakpoint trap, for inspection by a debugger.
bswap | [Unstable] Reverses the bytes in an integer type `T`.
ceilf32 | [Unstable] Returns the smallest integer greater than or equal to an `f32`.
ceilf64 | [Unstable] Returns the smallest integer greater than or equal to an `f64`.
copysignf32 | [Unstable] Copies the sign from `y` to `x` for `f32` values.
copysignf64 | [Unstable] Copies the sign from `y` to `x` for `f64` values.
cosf32 | [Unstable] Returns the cosine of an `f32`.
cosf64 | [Unstable] Returns the cosine of an `f64`.
ctlz | [Unstable] Returns the number of leading bits unset in an integer type `T`
ctpop | [Unstable] Returns the number of bits set in an integer type `T`
cttz | [Unstable] Returns the number of trailing bits unset in an integer type `T`
discriminant_value | [Unstable] Returns the value of the discriminant for the variant in 'v', cast to a `u64`; if `T` has no discriminant, returns 0.
exp2f32 | [Unstable] Returns 2 raised to the power of an `f32`.
exp2f64 | [Unstable] Returns 2 raised to the power of an `f64`.
expf32 | [Unstable] Returns the exponential of an `f32`.
expf64 | [Unstable] Returns the exponential of an `f64`.
fabsf32 | [Unstable] Returns the absolute value of an `f32`.
fabsf64 | [Unstable] Returns the absolute value of an `f64`.
fadd_fast | [Unstable] Float addition that allows optimizations based on algebraic rules. May assume inputs are finite.
fdiv_fast | [Unstable] Float division that allows optimizations based on algebraic rules. May assume inputs are finite.
floorf32 | [Unstable] Returns the largest integer less than or equal to an `f32`.
floorf64 | [Unstable] Returns the largest integer less than or equal to an `f64`.
fmaf32 | [Unstable] Returns `a * b + c` for `f32` values.
fmaf64 | [Unstable] Returns `a * b + c` for `f64` values.
fmul_fast | [Unstable] Float multiplication that allows optimizations based on algebraic rules. May assume inputs are finite.
forget | [Unstable] Moves a value out of scope without running drop glue.
frem_fast | [Unstable] Float remainder that allows optimizations based on algebraic rules. May assume inputs are finite.
fsub_fast | [Unstable] Float subtraction that allows optimizations based on algebraic rules. May assume inputs are finite.
init | [Unstable] Creates a value initialized to zero.
init_dropped | [Unstable] Creates a value initialized to so that its drop flag, if any, says that it has been dropped.
log10f32 | [Unstable] Returns the base 10 logarithm of an `f32`.
log10f64 | [Unstable] Returns the base 10 logarithm of an `f64`.
log2f32 | [Unstable] Returns the base 2 logarithm of an `f32`.
log2f64 | [Unstable] Returns the base 2 logarithm of an `f64`.
logf32 | [Unstable] Returns the natural logarithm of an `f32`.
logf64 | [Unstable] Returns the natural logarithm of an `f64`.
min_align_of | [Unstable]
min_align_of_val | [Unstable]
move_val_init | [Unstable] Moves a value to an uninitialized memory location.
mul_with_overflow | [Unstable] Performs checked integer multiplication
nearbyintf32 | [Unstable] Returns the nearest integer to an `f32`.
nearbyintf64 | [Unstable] Returns the nearest integer to an `f64`.
needs_drop | [Unstable] Returns `true` if the actual type given as `T` requires drop glue; returns `false` if the actual type provided for `T` implements `Copy`.
offset | [Unstable] Calculates the offset from a pointer.
overflowing_add | [Unstable] Returns (a + b) mod 2N, where N is the width of T in bits.
overflowing_mul | [Unstable] Returns (a * b) mod 2N, where N is the width of T in bits.
overflowing_sub | [Unstable] Returns (a - b) mod 2N, where N is the width of T in bits.
powf32 | [Unstable] Raises an `f32` to an `f32` power.
powf64 | [Unstable] Raises an `f64` to an `f64` power.
powif32 | [Unstable] Raises an `f32` to an integer power.
powif64 | [Unstable] Raises an `f64` to an integer power.
pref_align_of | [Unstable]
return_address | [Unstable] Gives the address for the return value of the enclosing function.
rintf32 | [Unstable] Returns the nearest integer to an `f32`. May raise an inexact floating-point exception if the argument is not an integer.
rintf64 | [Unstable] Returns the nearest integer to an `f64`. May raise an inexact floating-point exception if the argument is not an integer.
roundf32 | [Unstable] Returns the nearest integer to an `f32`. Rounds half-way cases away from zero.
roundf64 | [Unstable] Returns the nearest integer to an `f64`. Rounds half-way cases away from zero.
sinf32 | [Unstable] Returns the sine of an `f32`.
sinf64 | [Unstable] Returns the sine of an `f64`.
size_of | [Unstable] The size of a type in bytes.
size_of_val | [Unstable]
sqrtf32 | [Unstable] Returns the square root of an `f32`
sqrtf64 | [Unstable] Returns the square root of an `f64`
sub_with_overflow | [Unstable] Performs checked integer subtraction
truncf32 | [Unstable] Returns the integer part of an `f32`.
truncf64 | [Unstable] Returns the integer part of an `f64`.
try | [Unstable] Rust's "try catch" construct which invokes the function pointer `f` with the data pointer `data`.
type_id | [Unstable] Gets an identifier which is globally unique to the specified type. This function will return the same value for a type regardless of whichever crate it is invoked in.
type_name | [Unstable] Gets a static string slice containing the name of a type.
unchecked_div | [Unstable] Performs an unchecked division, resulting in undefined behavior where y = 0 or x = `T::min_value()` and y = -1
unchecked_rem | [Unstable] Returns the remainder of an unchecked division, resulting in undefined behavior where y = 0 or x = `T::min_value()` and y = -1
uninit | [Unstable] Creates an uninitialized value.
unreachable | [Unstable] Tells LLVM that this point in the code is not reachable, enabling further optimizations.
volatile_copy_memory | [Unstable] Equivalent to the appropriate `llvm.memmove.p0i8.0i8.*` intrinsic, with a size of `count` * `size_of::<T>()` and an alignment of `min_align_of::<T>()`
volatile_copy_nonoverlapping_memory | [Unstable] Equivalent to the appropriate `llvm.memcpy.p0i8.0i8.*` intrinsic, with a size of `count` * `size_of::<T>()` and an alignment of `min_align_of::<T>()`
volatile_load | [Unstable] Perform a volatile load from the `src` pointer.
volatile_set_memory | [Unstable] Equivalent to the appropriate `llvm.memset.p0i8.*` intrinsic, with a size of `count` * `size_of::<T>()` and an alignment of `min_align_of::<T>()`.
volatile_store | [Unstable] Perform a volatile store to the `dst` pointer.

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
⇤
  Move up in search results
⇥
  Move down in search results
⏎
  Go to active search result

## 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`)