1
0
Fork 0

Remove unnecessary "memory" clobbers for naked function asm

This commit is contained in:
Amanieu d'Antras 2016-09-01 16:39:34 +01:00 committed by edef
parent 38ff4126b6
commit 86e29b2baa
3 changed files with 10 additions and 10 deletions

View File

@ -73,7 +73,7 @@ pub unsafe fn init(stack: &Stack, f: unsafe extern "C" fn(usize) -> !) -> StackP
.Lend:
.size __morestack, .Lend-__morestack
"#
: : "s" (trampoline_2 as usize) : "memory" : "volatile")
: : "s" (trampoline_2 as usize) : : "volatile")
}
#[naked]
@ -89,7 +89,7 @@ pub unsafe fn init(stack: &Stack, f: unsafe extern "C" fn(usize) -> !) -> StackP
l.jr r9
l.nop
"#
: : : "memory" : "volatile")
: : : : "volatile")
}
unsafe fn push(sp: &mut StackPointer, val: usize) {
@ -139,7 +139,7 @@ pub unsafe fn swap(arg: usize, old_sp: *mut StackPointer, new_sp: *const StackPo
l.jr r9
l.nop
"#
: : : "memory" : "volatile")
: : : : "volatile")
}
let ret: usize;

View File

@ -72,7 +72,7 @@ pub unsafe fn init(stack: &Stack, f: unsafe extern "C" fn(usize) -> !) -> StackP
.Lend:
.size __morestack, .Lend-__morestack
"#
: : "s" (trampoline_2 as usize) : "memory" : "volatile")
: : "s" (trampoline_2 as usize) : : "volatile")
}
#[naked]
@ -89,7 +89,7 @@ pub unsafe fn init(stack: &Stack, f: unsafe extern "C" fn(usize) -> !) -> StackP
# Call the provided function.
call *8(%esp)
"#
: : : "memory" : "volatile")
: : : : "volatile")
}
unsafe fn push(sp: &mut StackPointer, val: usize) {
@ -135,7 +135,7 @@ pub unsafe fn swap(arg: usize, old_sp: *mut StackPointer, new_sp: *const StackPo
popl %ebx
jmpl *%ebx
"#
: : : "memory" : "volatile")
: : : : "volatile")
}
let ret: usize;

View File

@ -77,7 +77,7 @@ pub unsafe fn init(stack: &Stack, f: unsafe extern "C" fn(usize) -> !) -> StackP
.Lend:
.size __morestack, .Lend-__morestack
"#
: : "s" (trampoline_2 as usize) : "memory" : "volatile")
: : "s" (trampoline_2 as usize) : : "volatile")
}
#[cfg(target_vendor = "apple")]
@ -92,7 +92,7 @@ pub unsafe fn init(stack: &Stack, f: unsafe extern "C" fn(usize) -> !) -> StackP
.cfi_offset %rbp, -16
call ${0:c}
"#
: : "s" (trampoline_2 as usize) : "memory" : "volatile")
: : "s" (trampoline_2 as usize) : : "volatile")
}
#[naked]
@ -115,7 +115,7 @@ pub unsafe fn init(stack: &Stack, f: unsafe extern "C" fn(usize) -> !) -> StackP
# Call the provided function.
call *8(%rsp)
"#
: : : "memory" : "volatile")
: : : : "volatile")
}
unsafe fn push(sp: &mut StackPointer, val: usize) {
@ -162,7 +162,7 @@ pub unsafe fn swap(arg: usize, old_sp: *mut StackPointer, new_sp: *const StackPo
popq %rbx
jmpq *%rbx
"#
: : : "memory" : "volatile")
: : : : "volatile")
}
let ret: usize;