avoid a register copy when fetching the stack pointer in _start
parent
9e11f67f0d
commit
74abc5ad2f
|
@ -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 => {
|
||||
|
|
Loading…
Reference in New Issue