Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/common/ami_udivdi3.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@ static u32 ami_umul16(u32 a, u32 b)
u32 product = a;


__asm__ ("mulu.w %1,%0" : "+d" (product) : "dmi" (b));
/* "d", not "dmi": MULU.W reads 16 bits, and a u32 in memory gives it
the high word on this big-endian machine. */
__asm__ ("mulu.w %1,%0" : "+d" (product) : "d" (b));

return(product);

Expand Down Expand Up @@ -188,7 +190,8 @@ static u32 ami_divu32_16_step(u32 numerator, u32 divisor, u32 *remainder)
u32 step = numerator;


__asm__ ("divu.w %1,%0" : "+d" (step) : "dmi" (divisor));
/* "d", not "dmi", for the reason ami_umul16() gives. */
__asm__ ("divu.w %1,%0" : "+d" (step) : "d" (divisor));

*remainder = step >> 16;
return((u32)(u16)step);
Expand Down
Loading