On 12/05/21 15:44, Alexandru Elisei wrote:
+ bl __udivmoddi4
+ ldr r2, [sp, #8] // remainder returned in r2-r3
+ ldr r3, [sp, #12]
+ add sp, sp, #16
+ pop {r11, pc}
I'm not sure what is going on here. Is the function returning 2 64bit arguments as
an 128bit vector? Or is the function being called from assembly and this is a
convention between it and the caller?
It's an eABI convention that spans the runtime and the compiler.
https://developer.arm.com/documentation/ihi0043/e/?lang=en#standardized-compiler-helper-functions
says it returns a "pair of (unsigned) long longs is returned in {{r0,
r1}, {r2, r3}}, the quotient in {r0, r1}, and the remainder in {r2, r3}."
Paolo