simplify memcpy/memmove/memset intrinsics
This moves the per-architecture difference into the compiler.
This commit is contained in:
parent
dc079e1596
commit
67966fa9de
5 changed files with 89 additions and 83 deletions
|
|
@ -345,25 +345,40 @@ extern "rust-intrinsic" {
|
|||
|
||||
/// Equivalent to the `llvm.memcpy.p0i8.0i8.i32` intrinsic, with a size of
|
||||
/// `count` * `size_of::<T>()` and an alignment of `min_align_of::<T>()`
|
||||
#[cfg(stage0)]
|
||||
pub fn memcpy32<T>(dst: *mut T, src: *T, count: u32);
|
||||
/// Equivalent to the `llvm.memcpy.p0i8.0i8.i64` intrinsic, with a size of
|
||||
/// `count` * `size_of::<T>()` and an alignment of `min_align_of::<T>()`
|
||||
#[cfg(stage0)]
|
||||
pub fn memcpy64<T>(dst: *mut T, src: *T, count: u64);
|
||||
|
||||
/// Equivalent to the `llvm.memmove.p0i8.0i8.i32` intrinsic, with a size of
|
||||
/// `count` * `size_of::<T>()` and an alignment of `min_align_of::<T>()`
|
||||
#[cfg(stage0)]
|
||||
pub fn memmove32<T>(dst: *mut T, src: *T, count: u32);
|
||||
/// Equivalent to the `llvm.memmove.p0i8.0i8.i64` intrinsic, with a size of
|
||||
/// `count` * `size_of::<T>()` and an alignment of `min_align_of::<T>()`
|
||||
#[cfg(stage0)]
|
||||
pub fn memmove64<T>(dst: *mut T, src: *T, count: u64);
|
||||
|
||||
/// Equivalent to the `llvm.memset.p0i8.i32` intrinsic, with a size of
|
||||
/// `count` * `size_of::<T>()` and an alignment of `min_align_of::<T>()`
|
||||
#[cfg(stage0)]
|
||||
pub fn memset32<T>(dst: *mut T, val: u8, count: u32);
|
||||
/// Equivalent to the `llvm.memset.p0i8.i64` intrinsic, with a size of
|
||||
/// `count` * `size_of::<T>()` and an alignment of `min_align_of::<T>()`
|
||||
#[cfg(stage0)]
|
||||
pub fn memset64<T>(dst: *mut T, val: u8, count: u64);
|
||||
|
||||
#[cfg(not(stage0))]
|
||||
pub fn copy_nonoverlapping_memory<T>(dst: *mut T, src: *T, count: uint);
|
||||
|
||||
#[cfg(not(stage0))]
|
||||
pub fn copy_memory<T>(dst: *mut T, src: *T, count: uint);
|
||||
|
||||
#[cfg(not(stage0))]
|
||||
pub fn set_memory<T>(dst: *mut T, val: u8, count: uint);
|
||||
|
||||
pub fn sqrtf32(x: f32) -> f32;
|
||||
pub fn sqrtf64(x: f64) -> f64;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue