In AMaCC, we always assume r0 is where the return argument stored,
however, the functions __aeabi_idivmod and __aeabi_uidivmod are
2-value-returning functions.
According to 'Run-time ABI for the ARM Architecture' with version 2.09
and section 4.3.1:
The division functions take the numerator and denominator
in that order, and produce the quotient in r0 or the quotient and
the remainder in {r0, r1} respectively.
Hack the first instruction where the function returns with mov r1 to r0.
Fixed #61
In AMaCC, we always assume r0 is where the return argument stored, however, the functions __aeabi_idivmod and __aeabi_uidivmod are 2-value-returning functions.
According to 'Run-time ABI for the ARM Architecture' with version 2.09 and section 4.3.1: The division functions take the numerator and denominator in that order, and produce the quotient in r0 or the quotient and the remainder in {r0, r1} respectively.
Hack the first instruction where the function returns with mov r1 to r0.