authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-07-24 18:35:20+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-07-25 00:55:00+02:00
log5478b0eb3821df4fcdbcb221441e732576be7d68
treee0ca783ca360d73070c852f6a9fc744a55cfcc04
parent47c0464e860486150942b73a78529805d4f320b5
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

start: Simplify mips and mips64 startup code.

Switches from using r1 as a temporary to r2. That way, we don't have to set the `noat` assembler option. (r1 is the scratch register used by the assembler's pseudoinstructions; the assembler warns when code uses that register explicitly without `noat` set.)

1 files changed, 2 insertions(+), 10 deletions(-)

lib/std/start.zig+2-10
......@@ -332,22 +332,14 @@ fn _start() callconv(.Naked) noreturn {
332332 \\ move $fp, $0
333333 \\ move $ra, $0
334334 \\ move $a0, $sp
335 \\ .set push
336 \\ .set noat
337 \\ addiu $1, $zero, -16
338 \\ and $sp, $sp, $1
339 \\ .set pop
335 \\ and $sp, -16
340336 \\ j %[posixCallMainAndExit]
341337 ,
342338 .mips64, .mips64el =>
343339 \\ move $fp, $0
344340 \\ move $ra, $0
345341 \\ move $a0, $sp
346 \\ .set push
347 \\ .set noat
348 \\ daddiu $1, $zero, -16
349 \\ and $sp, $sp, $1
350 \\ .set pop
342 \\ and $sp, -16
351343 \\ j %[posixCallMainAndExit]
352344 ,
353345 .powerpc, .powerpcle =>