Revision c0b24a1d target-i386/helper.c
b/target-i386/helper.c | ||
---|---|---|
3261 | 3261 |
static int div64(uint64_t *plow, uint64_t *phigh, uint64_t b) |
3262 | 3262 |
{ |
3263 | 3263 |
uint64_t q, r, a1, a0; |
3264 |
int i, qb; |
|
3264 |
int i, qb, ab;
|
|
3265 | 3265 |
|
3266 | 3266 |
a0 = *plow; |
3267 | 3267 |
a1 = *phigh; |
... | ... | |
3275 | 3275 |
return 1; |
3276 | 3276 |
/* XXX: use a better algorithm */ |
3277 | 3277 |
for(i = 0; i < 64; i++) { |
3278 |
ab = a1 >> 63; |
|
3278 | 3279 |
a1 = (a1 << 1) | (a0 >> 63); |
3279 |
if (a1 >= b) { |
|
3280 |
if (ab || a1 >= b) {
|
|
3280 | 3281 |
a1 -= b; |
3281 | 3282 |
qb = 1; |
3282 | 3283 |
} else { |
Also available in: Unified diff