From 7ba84b7691bef98fe2d0a9f2e5d292fd2d591143 Mon Sep 17 00:00:00 2001 From: Corwin Kuiper Date: Sun, 31 Oct 2021 20:14:41 +0000 Subject: [PATCH] add registers to sqrt clobber list will need to go through the other syscalls and find out whether we need to add registers to the clobber list. We probably need to add all per the call convention (r0, r1, r2, r3 are callee saved). --- agb/src/syscall.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/agb/src/syscall.rs b/agb/src/syscall.rs index f3869a1e..83b44b1c 100644 --- a/agb/src/syscall.rs +++ b/agb/src/syscall.rs @@ -77,6 +77,9 @@ pub fn sqrt(n: i32) -> i32 { "swi 0x08", in("r0") n, lateout("r0") result, + lateout("r1") _, + lateout("r2") _, + lateout("r3") _ ); } result @@ -102,6 +105,7 @@ pub fn arc_tan2(x: i16, y: i32) -> i16 { in("r0") x, in("r1") y, lateout("r0") result, + ); } result