Changeset View
Changeset View
Standalone View
Standalone View
sys/powerpc/fpu/fpu_div.c
| Show First 20 Lines • Show All 129 Lines • ▼ Show 20 Lines | |||||
| * if (D >= 0) { | * if (D >= 0) { | ||||
| * q |= bit; | * q |= bit; | ||||
| * R = D; | * R = D; | ||||
| * } | * } | ||||
| * R <<= 1; | * R <<= 1; | ||||
| * } while ((bit >>= 1) != 0); | * } while ((bit >>= 1) != 0); | ||||
| * Q[0] = q; | * Q[0] = q; | ||||
| * for (i = 1; i < 4; i++) { | * for (i = 1; i < 4; i++) { | ||||
| * q = 0, bit = 1 << 31; | * q = 0, bit = 1U << 31; | ||||
| * do { | * do { | ||||
| * D = R - Y; | * D = R - Y; | ||||
| * if (D >= 0) { | * if (D >= 0) { | ||||
| * q |= bit; | * q |= bit; | ||||
| * R = D; | * R = D; | ||||
| * } | * } | ||||
| * R <<= 1; | * R <<= 1; | ||||
| * } while ((bit >>= 1) != 0); | * } while ((bit >>= 1) != 0); | ||||
| ▲ Show 20 Lines • Show All 105 Lines • ▼ Show 20 Lines | do { \ | ||||
| if (NONNEGATIVE) { \ | if (NONNEGATIVE) { \ | ||||
| q |= bit; \ | q |= bit; \ | ||||
| r0 = d0, r1 = d1, r2 = d2, r3 = d3; \ | r0 = d0, r1 = d1, r2 = d2, r3 = d3; \ | ||||
| } \ | } \ | ||||
| } while ((bit >>= 1) != 0) | } while ((bit >>= 1) != 0) | ||||
| #define WORD(r, i) /* calculate r->fp_mant[i] */ \ | #define WORD(r, i) /* calculate r->fp_mant[i] */ \ | ||||
| q = 0; \ | q = 0; \ | ||||
| bit = 1 << 31; \ | bit = 1U << 31; \ | ||||
| LOOP; \ | LOOP; \ | ||||
| (x)->fp_mant[i] = q | (x)->fp_mant[i] = q | ||||
| /* Setup. Note that we put our result in x. */ | /* Setup. Note that we put our result in x. */ | ||||
| r0 = x->fp_mant[0]; | r0 = x->fp_mant[0]; | ||||
| r1 = x->fp_mant[1]; | r1 = x->fp_mant[1]; | ||||
| r2 = x->fp_mant[2]; | r2 = x->fp_mant[2]; | ||||
| r3 = x->fp_mant[3]; | r3 = x->fp_mant[3]; | ||||
| Show All 26 Lines | |||||