avoid a register copy when fetching the stack pointer in _start

master
Joachim Henke 2019-07-26 09:59:18 +02:00 committed by Andrew Kelley
parent 9e11f67f0d
commit 74abc5ad2f
1 changed files with 4 additions and 4 deletions

View File

@ -35,13 +35,13 @@ nakedcc fn _start() noreturn {
switch (builtin.arch) {
.x86_64 => {
argc_ptr = asm ("lea (%%rsp), %[argc]"
: [argc] "=r" (-> [*]usize)
argc_ptr = asm (""
: [argc] "={rsp}" (-> [*]usize)
);
},
.i386 => {
argc_ptr = asm ("lea (%%esp), %[argc]"
: [argc] "=r" (-> [*]usize)
argc_ptr = asm (""
: [argc] "={esp}" (-> [*]usize)
);
},
.aarch64, .aarch64_be => {