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 {...@@ -332,22 +332,14 @@ fn _start() callconv(.Naked) noreturn {
332 \\ move $fp, $0332 \\ move $fp, $0
333 \\ move $ra, $0333 \\ move $ra, $0
334 \\ move $a0, $sp334 \\ move $a0, $sp
335 \\ .set push335 \\ and $sp, -16
336 \\ .set noat
337 \\ addiu $1, $zero, -16
338 \\ and $sp, $sp, $1
339 \\ .set pop
340 \\ j %[posixCallMainAndExit]336 \\ j %[posixCallMainAndExit]
341 ,337 ,
342 .mips64, .mips64el =>338 .mips64, .mips64el =>
343 \\ move $fp, $0339 \\ move $fp, $0
344 \\ move $ra, $0340 \\ move $ra, $0
345 \\ move $a0, $sp341 \\ move $a0, $sp
346 \\ .set push342 \\ and $sp, -16
347 \\ .set noat
348 \\ daddiu $1, $zero, -16
349 \\ and $sp, $sp, $1
350 \\ .set pop
351 \\ j %[posixCallMainAndExit]343 \\ j %[posixCallMainAndExit]
352 ,344 ,
353 .powerpc, .powerpcle =>345 .powerpc, .powerpcle =>