URL
https://opencores.org/ocsvn/scarts/scarts/trunk
Subversion Repositories scarts
[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [gcc/] [config/] [scarts16/] [divdi.c] - Rev 20
Go to most recent revision | Compare with Previous | Blame | View Log
unsigned long long __divdi3(unsigned long long a, unsigned long long b) { long long result; long long t; int sign; if (b == 0) return a; if (a == 0) return a; sign = (a ^ b) >> 48; if (a < 0) a = -a; if (b < 0) b = -b; t = b; while ((long long)b > 0) b <<= 1; result = 0; while (b >= t) { result <<= 1; if (b <= a) { a -= b; result += 1; } b >>= 1; } if (sign < 0) result = -result; return result; }
Go to most recent revision | Compare with Previous | Blame | View Log