Experimental[src]

Module std::intrinsics

rustc compiler intrinsics.

The corresponding definitions are in librustc/middle/trans/foreign.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:

TyDesc
TypeId

TypeId represents a globally unique identifier for a type

Opaque
abort

Abort the execution of the process.

atomic_and
atomic_and_acq
atomic_and_acqrel
atomic_and_rel
atomic_and_relaxed
atomic_cxchg
atomic_cxchg_acq
atomic_cxchg_acqrel
atomic_cxchg_rel
atomic_cxchg_relaxed
atomic_fence
atomic_fence_acq
atomic_fence_acqrel
atomic_fence_rel
atomic_load
atomic_load_acq
atomic_load_relaxed
atomic_max
atomic_max_acq
atomic_max_acqrel
atomic_max_rel
atomic_max_relaxed
atomic_min
atomic_min_acq
atomic_min_acqrel
atomic_min_rel
atomic_min_relaxed
atomic_nand
atomic_nand_acq
atomic_nand_acqrel
atomic_nand_rel
atomic_nand_relaxed
atomic_or
atomic_or_acq
atomic_or_acqrel
atomic_or_rel
atomic_or_relaxed
atomic_store
atomic_store_rel
atomic_store_relaxed
atomic_umax
atomic_umax_acq
atomic_umax_acqrel
atomic_umax_rel
atomic_umax_relaxed
atomic_umin
atomic_umin_acq
atomic_umin_acqrel
atomic_umin_rel
atomic_umin_relaxed
atomic_xadd
atomic_xadd_acq
atomic_xadd_acqrel
atomic_xadd_rel
atomic_xadd_relaxed
atomic_xchg
atomic_xchg_acq
atomic_xchg_acqrel
atomic_xchg_rel
atomic_xchg_relaxed
atomic_xor
atomic_xor_acq
atomic_xor_acqrel
atomic_xor_rel
atomic_xor_relaxed
atomic_xsub
atomic_xsub_acq
atomic_xsub_acqrel
atomic_xsub_rel
atomic_xsub_relaxed
breakpoint

Execute a breakpoint trap, for inspection by a debugger.

bswap16
bswap32
bswap64
ceilf32
ceilf64
copy_memory

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>()

copy_nonoverlapping_memory

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>()

copysignf32
copysignf64
cosf32
cosf64
ctlz16
ctlz32
ctlz64
ctlz8
ctpop16
ctpop32
ctpop64
ctpop8
cttz16
cttz32
cttz64
cttz8
exp2f32
exp2f64
expf32
expf64
fabsf32
fabsf64
floorf32
floorf64
fmaf32
fmaf64
forget

Move a value out of scope without running drop glue.

get_tydesc

Get a static pointer to a type descriptor.

i16_add_with_overflow
i16_mul_with_overflow
i16_sub_with_overflow
i32_add_with_overflow
i32_mul_with_overflow
i32_sub_with_overflow
i64_add_with_overflow
i64_mul_with_overflow
i64_sub_with_overflow
i8_add_with_overflow
i8_mul_with_overflow
i8_sub_with_overflow
init

Create a value initialized to zero.

log10f32
log10f64
log2f32
log2f64
logf32
logf64
min_align_of
move_val_init

Move a value to an uninitialized memory location.

nearbyintf32
nearbyintf64
needs_drop

Returns true if a type requires drop glue.

offset

Calculates the offset from a pointer. The offset must be in-bounds of the object, or one-byte-past-the-end. An arithmetic overflow is also undefined behaviour.

owns_managed

Returns true if a type is managed (will be allocated on the local heap)

powf32
powf64
powif32
powif64
pref_align_of
rintf32
rintf64
roundf32
roundf64
set_memory

Equivalent to the appropriate llvm.memset.p0i8.* intrinsic, with a size of count * size_of::<T>() and an alignment of min_align_of::<T>()

sinf32
sinf64
size_of

The size of a type in bytes.

sqrtf32
sqrtf64
transmute
truncf32
truncf64
type_id

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.

u16_add_with_overflow
u16_mul_with_overflow
u16_sub_with_overflow
u32_add_with_overflow
u32_mul_with_overflow
u32_sub_with_overflow
u64_add_with_overflow
u64_mul_with_overflow
u64_sub_with_overflow
u8_add_with_overflow
u8_mul_with_overflow
u8_sub_with_overflow
uninit

Create an uninitialized value.

visit_tydesc
volatile_load
volatile_store
TyVisitor
Disr
GlueFn