Code:
int mulff(int a, int b)
{
int c;
asm volatile
(
"smull r7,r8,%1,%2\n" // {r2,r3} = r0*r1
"mov %0, r7\n" // return the high 32 bits, hopefully
: "=r"(c) // %0 = output value from the function
: "r"(a), "r"(b) // inputs: %1, %2
: "r7", "r8" // registers we clobber
);
return c;
}
This mostly returns zero, even when it should return other stuff. If I return r8 instead of r7 then for some reason I only get values between -65536 and +65535, with the upper 16 bits all 0 or all 1.
PS: yes, this is a very much stripped down version of what I started with.