Increase optimization, fix clobbers in vesad

This commit is contained in:
Jeremy Soller 2016-09-21 16:46:16 -06:00
parent 0540726890
commit afe7a99700
2 changed files with 8 additions and 12 deletions

View file

@ -1,5 +1,4 @@
#[cfg(target_arch = "x86_64")]
#[allow(unused_assignments)]
#[inline(always)]
#[cold]
pub unsafe fn fast_copy(dst: *mut u8, src: *const u8, len: usize) {
@ -7,12 +6,11 @@ pub unsafe fn fast_copy(dst: *mut u8, src: *const u8, len: usize) {
rep movsb"
:
: "{rdi}"(dst as usize), "{rsi}"(src as usize), "{rcx}"(len)
: "cc", "memory"
: "cc", "memory", "rdi", "rsi", "rcx"
: "intel", "volatile");
}
#[cfg(target_arch = "x86_64")]
#[allow(unused_assignments)]
#[inline(always)]
#[cold]
pub unsafe fn fast_copy64(dst: *mut u64, src: *const u64, len: usize) {
@ -20,12 +18,11 @@ pub unsafe fn fast_copy64(dst: *mut u64, src: *const u64, len: usize) {
rep movsq"
:
: "{rdi}"(dst as usize), "{rsi}"(src as usize), "{rcx}"(len)
: "cc", "memory"
: "cc", "memory", "rdi", "rsi", "rcx"
: "intel", "volatile");
}
#[cfg(target_arch = "x86_64")]
#[allow(unused_assignments)]
#[inline(always)]
#[cold]
pub unsafe fn fast_set32(dst: *mut u32, src: u32, len: usize) {
@ -33,12 +30,11 @@ pub unsafe fn fast_set32(dst: *mut u32, src: u32, len: usize) {
rep stosd"
:
: "{rdi}"(dst as usize), "{eax}"(src), "{rcx}"(len)
: "cc", "memory"
: "cc", "memory", "rdi", "rcx"
: "intel", "volatile");
}
#[cfg(target_arch = "x86_64")]
#[allow(unused_assignments)]
#[inline(always)]
#[cold]
pub unsafe fn fast_set64(dst: *mut u64, src: u64, len: usize) {
@ -46,6 +42,6 @@ pub unsafe fn fast_set64(dst: *mut u64, src: u64, len: usize) {
rep stosq"
:
: "{rdi}"(dst as usize), "{rax}"(src), "{rcx}"(len)
: "cc", "memory"
: "cc", "memory", "rdi", "rcx"
: "intel", "volatile");
}