URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Subversion Repositories openrisc_me
[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [config/] [udivmodsi4.c] - Rev 438
Go to most recent revision | Compare with Previous | Blame | View Log
unsigned long udivmodsi4(unsigned long num, unsigned long den, int modwanted) { unsigned long bit = 1; unsigned long res = 0; while (den < num && bit && !(den & (1L<<31))) { den <<=1; bit <<=1; } while (bit) { if (num >= den) { num -= den; res |= bit; } bit >>=1; den >>=1; } if (modwanted) return num; return res; }
Go to most recent revision | Compare with Previous | Blame | View Log