Lines Matching +full:low +full:-
27 #include "qemu/host-utils.h"
38 uint32_t high, low; in mul64() member
40 uint32_t low, high; in mul64()
50 rl.ll = (uint64_t)a0.l.low * b0.l.low; in mul64()
51 rm.ll = (uint64_t)a0.l.low * b0.l.high; in mul64()
52 rn.ll = (uint64_t)a0.l.high * b0.l.low; in mul64()
55 c = (uint64_t)rl.l.high + rm.l.low + rn.l.low; in mul64()
58 c = c + rm.l.high + rn.l.high + rh.l.low; in mul64()
59 rh.l.low = c; in mul64()
66 /* Unsigned 64x64 -> 128 multiplication */
72 /* Signed 64x64 -> 128 multiplication */
81 rh -= a; in muls64()
84 rh -= b; in muls64()
90 * Unsigned 128-by-64 division.
113 dhi = (dhi << sh) | (dlo >> (64 - sh)); in divu128()
123 dhighest = dhi >> (64 - sh); in divu128()
124 dhi = (dhi << sh) | (dlo >> (64 - sh)); in divu128()
132 * (dhi - divisor) < divisor in divu128()
135 * calculate the low part with a single call to udiv_qrnnd in divu128()
138 dhi -= divisor; in divu128()
154 * Signed 128-by-64 division.
169 unsig_hi = -unsig_hi; in divs128()
172 unsig_lo = -unsig_lo; in divs128()
179 divisor = -divisor; in divs128()
186 *phigh = -unsig_hi; in divs128()
190 *plow = -unsig_lo; in divs128()
198 return -rem; in divs128()
206 * urshift - 128-bit Unsigned Right Shift.
207 * @plow: in/out - lower 64-bit integer.
208 * @phigh: in/out - higher 64-bit integer.
209 * @shift: in - bytes to shift, between 0 and 127.
211 * Result is zero-extended and stored in plow/phigh, which are
228 *plow = (*plow >> (shift & 63)) | (*phigh << (64 - (shift & 63))); in urshift()
234 * ulshift - 128-bit Unsigned Left Shift.
235 * @plow: in/out - lower 64-bit integer.
236 * @phigh: in/out - higher 64-bit integer.
237 * @shift: in - bytes to shift, between 0 and 127.
238 * @overflow: out - true if any 1-bit is shifted out.
240 * Result is zero-extended and stored in plow/phigh, which are
247 uint64_t low = *plow; in ulshift() local
256 urshift(&low, &high, 128 - shift); in ulshift()
257 if (low | high) { in ulshift()
265 *phigh = (*plow >> (64 - (shift & 63))) | (*phigh << (shift & 63)); in ulshift()
271 * Unsigned 256-by-128 division.
276 * Adapted from include/qemu/host-utils.h udiv_qrnnd,
277 * from the GNU Multi Precision Library - longlong.h __udiv_qrnnd
333 * Unsigned 256-by-128 division.
357 int128_urshift(dlo, (128 - sh))); in divu256()
367 dhighest = int128_rshift(dhi, (128 - sh)); in divu256()
369 int128_urshift(dlo, (128 - sh))); in divu256()
377 * (dhi - divisor) < divisor in divu256()
380 * calculate the low part with a single call to udiv_qrnnd in divu256()
400 * Signed 256-by-128 division.