1687 int a_sgn, a_exp, b_sgn, b_exp, c_sgn, c_exp, x_sgn, x_exp, y_sgn, y_exp;
1688 uint64_t a_mnt, b_mnt, c_mnt,
x;
1689 uint64_t x0_mnt, x1_mnt, y0_mnt, y1_mnt;
1714 (a_sgn != (b_sgn ^ c_sgn)))) {
1722 if (!a_mnt && (!b_mnt || !c_mnt) && a_sgn == (b_sgn ^ c_sgn))
1731 y_sgn = b_sgn ^ c_sgn;
1733 mul62x62(&y0_mnt, &y1_mnt, b_mnt, c_mnt << 3);
1734 if (!y0_mnt && !y1_mnt) {
1739 if (x_exp >= y_exp) {
1742 x_exp - y_exp < 128 ? 128 - (x_exp - y_exp) : 0);
1743 lsr128(&y0_mnt, &y1_mnt, y0_mnt, y1_mnt, x_exp - y_exp);
1744 y0_mnt |= !!(
t0 |
t1);
1749 y_exp - x_exp < 128 ? 128 - (y_exp - x_exp) : 0);
1750 lsr128(&x0_mnt, &x1_mnt, x0_mnt, x1_mnt, y_exp - x_exp);
1751 x0_mnt |= !!(
t0 |
t1);
1754 if (x_sgn == y_sgn) {
1755 add128(&x0_mnt, &x1_mnt, x0_mnt, x1_mnt, y0_mnt, y1_mnt);
1756 }
else if (
cmp128(x0_mnt, x1_mnt, y0_mnt, y1_mnt) >= 0) {
1757 sub128(&x0_mnt, &x1_mnt, x0_mnt, x1_mnt, y0_mnt, y1_mnt);
1760 sub128(&x0_mnt, &x1_mnt, y0_mnt, y1_mnt, x0_mnt, x1_mnt);
1763 if (!x0_mnt && !x1_mnt) {
1770 x0_mnt = x1_mnt << 1 | !!x0_mnt;
1862 int a_sgn, a_exp, b_sgn, b_exp, x_sgn, x_exp,
c;
1863 uint64_t a_mnt, b_mnt,
x, x_mnt, x0_mnt, x1_mnt;
1873 (!a_mnt && !b_mnt)) {
1888 x_mnt = ~(uint64_t)0 / (b_mnt >> 31);
1889 mul64x32(&x0_mnt, &x1_mnt, b_mnt, x_mnt);
1890 sub128(&x0_mnt, &x1_mnt, 0, (uint64_t)1 << 32, x0_mnt, x1_mnt);
1891 lsr128(&x0_mnt, &x1_mnt, x0_mnt, x1_mnt, 32);
1892 mul64x32(&x0_mnt, &x1_mnt, x0_mnt, x_mnt);
1893 lsr128(&x0_mnt, &x1_mnt, x0_mnt, x1_mnt, 33);
1896 x_sgn = a_sgn ^ b_sgn;
1898 mul62x62(&x0_mnt, &x1_mnt, x0_mnt, a_mnt >> 2);
1899 lsr128(&x0_mnt, &x1_mnt, x0_mnt, x1_mnt, 4);
1903 mul62x62(&x0_mnt, &x1_mnt, b_mnt >> 2, x_mnt + 1);
1904 c =
cmp128(x0_mnt, x1_mnt, 0, a_mnt >> 11);
3511 255, 253, 251, 249, 247, 245, 243, 242, 240, 238, 236, 234, 233, 231, 229, 228,
3512 226, 224, 223, 221, 219, 218, 216, 215, 213, 212, 210, 209, 207, 206, 204, 203,
3513 201, 200, 198, 197, 196, 194, 193, 192, 190, 189, 188, 186, 185, 184, 183, 181,
3514 180, 179, 178, 176, 175, 174, 173, 172, 170, 169, 168, 167, 166, 165, 164, 163,
3515 162, 160, 159, 158, 157, 156, 155, 154, 153, 152, 151, 150, 149, 148, 147, 146,
3516 145, 144, 143, 142, 141, 140, 140, 139, 138, 137, 136, 135, 134, 133, 132, 131,
3517 131, 130, 129, 128, 127, 126, 126, 125, 124, 123, 122, 121, 121, 120, 119, 118,
3518 118, 117, 116, 115, 114, 114, 113, 112, 111, 111, 110, 109, 109, 108, 107, 106,
3519 105, 104, 103, 101, 100, 99, 97, 96, 95, 93, 92, 91, 90, 88, 87, 86,
3520 85, 84, 82, 81, 80, 79, 78, 77, 76, 75, 74, 72, 71, 70, 69, 68,
3521 67, 66, 65, 64, 63, 62, 61, 60, 60, 59, 58, 57, 56, 55, 54, 53,
3522 52, 51, 51, 50, 49, 48, 47, 46, 46, 45, 44, 43, 42, 42, 41, 40,
3523 39, 38, 38, 37, 36, 35, 35, 34, 33, 33, 32, 31, 30, 30, 29, 28,
3524 28, 27, 26, 26, 25, 24, 24, 23, 22, 22, 21, 20, 20, 19, 19, 18,
3525 17, 17, 16, 16, 15, 14, 14, 13, 13, 12, 11, 11, 10, 10, 9, 9,
3526 8, 8, 7, 6, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 0