47 #define _COMPONENT ACPI_UTILITIES
58 #ifndef ACPI_USE_NATIVE_DIVIDE
106 dividend_ovl.
full = dividend;
113 quotient.
part.hi, remainder32);
115 quotient.
part.lo, remainder32);
120 *out_quotient = quotient.
full;
123 *out_remainder = remainder32;
146 u64 in_divisor,
u64 *out_quotient,
u64 *out_remainder)
162 if (in_divisor == 0) {
167 divisor.
full = in_divisor;
168 dividend.
full = in_dividend;
169 if (divisor.
part.hi == 0) {
174 remainder.
part.hi = 0;
181 quotient.
part.hi, partial1);
183 quotient.
part.lo, remainder.
part.lo);
191 quotient.
part.hi = 0;
192 normalized_dividend = dividend;
199 normalized_divisor.
part.lo);
201 normalized_dividend.
part.lo);
203 }
while (normalized_divisor.
part.hi != 0);
208 normalized_dividend.
part.lo,
209 normalized_divisor.
part.lo,
210 quotient.
part.lo, partial1);
216 partial1 = quotient.
part.lo * divisor.
part.hi;
220 remainder.
part.hi = partial3.
part.lo;
221 remainder.
part.lo = partial2.
part.lo;
223 if (partial3.
part.hi == 0) {
224 if (partial3.
part.lo >= dividend.
part.hi) {
225 if (partial3.
part.lo == dividend.
part.hi) {
226 if (partial2.
part.lo > dividend.
part.lo) {
240 if (remainder.
part.lo) {
249 *out_quotient = quotient.
full;
252 *out_remainder = remainder.
full;
290 *out_quotient = in_dividend /
divisor;
293 *out_remainder = (
u32) (in_dividend % divisor);
301 u64 in_divisor,
u64 *out_quotient,
u64 *out_remainder)
307 if (in_divisor == 0) {
315 *out_quotient = in_dividend / in_divisor;
318 *out_remainder = in_dividend % in_divisor;