/freebsd/contrib/llvm-project/compiler-rt/lib/builtins/ |
H A D | udivmodti4.c | 28 du_int vn1, vn0; // Norm. divisor digits in udiv128by64to64default() 36 // Normalize the divisor. in udiv128by64to64default() 46 // Break divisor up into two 32-bit digits. in udiv128by64to64default() 104 utwords divisor; in __udivmodti4() local 105 divisor.all = b; in __udivmodti4() 108 if (divisor.all > dividend.all) { in __udivmodti4() 113 // When the divisor fits in 64 bits, we can use an optimized path. in __udivmodti4() 114 if (divisor.s.high == 0) { in __udivmodti4() 116 if (dividend.s.high < divisor.s.low) { in __udivmodti4() 119 divisor.s.low, &remainder.s.low); in __udivmodti4() [all …]
|
/freebsd/sys/compat/linuxkpi/common/include/linux/ |
H A D | math64.h | 43 div64_u64_rem(uint64_t dividend, uint64_t divisor, uint64_t *remainder) in div64_u64_rem() argument 46 *remainder = dividend % divisor; in div64_u64_rem() 47 return (dividend / divisor); in div64_u64_rem() 51 div64_s64(int64_t dividend, int64_t divisor) in div64_s64() argument 54 return (dividend / divisor); in div64_s64() 58 div64_u64(uint64_t dividend, uint64_t divisor) in div64_u64() argument 61 return (dividend / divisor); in div64_u64() 67 div_u64_rem(uint64_t dividend, uint32_t divisor, uint32_t *remainder) in div_u64_rem() argument 70 *remainder = dividend % divisor; in div_u64_rem() 71 return (dividend / divisor); in div_u64_rem() [all …]
|
H A D | math.h | 51 #define DIV_ROUND_CLOSEST(x, divisor) (((x) + ((divisor) / 2)) / (divisor)) argument 52 #define DIV_ROUND_CLOSEST_ULL(x, divisor) ({ \ argument 53 __typeof(divisor) __d = (divisor); \ 68 mult_frac(uintmax_t x, uintmax_t multiplier, uintmax_t divisor) in mult_frac() argument 70 uintmax_t q = (x / divisor); in mult_frac() 71 uintmax_t r = (x % divisor); in mult_frac() 73 return ((q * multiplier) + ((r * multiplier) / divisor)); in mult_frac()
|
/freebsd/contrib/llvm-project/compiler-rt/lib/builtins/sparc64/ |
H A D | divmod.m4 | 10 * divisor -- how many ways to divide it 25 * V -- the current comparand -- initially divisor*2ˆ(ITER*N-1) 36 define(divisor,`%o1') macro 92 orcc divisor,dividend,%g0 ! are either dividend or divisor negative 94 xor divisor,dividend,SIGN ! record sign of result in sign of SIGN 95 tst divisor 98 ! divisor < 0 100 neg divisor 114 orcc divisor,dividend,%g0 ! are either dividend or divisor negative 117 tst divisor [all …]
|
/freebsd/sys/contrib/device-tree/Bindings/clock/ti/ |
H A D | divider.txt | 6 the register is one less than the actual divisor value. E.g: 8 register value actual divisor value 15 ti,index-starts-at-one - valid divisor values start at 1, not the default 17 register value actual divisor value 22 ti,index-power-of-two - valid divisor values are powers of two. E.g: 23 register value actual divisor value 32 Which will map the resulting values to a divisor table by their index: 33 register value actual divisor value 36 2 <invalid divisor, skipped> 63 - ti,min-div : min divisor for dividing the input clock rate, only [all …]
|
/freebsd/lib/libutil/ |
H A D | humanize_number.c | 54 int64_t divisor, max; in humanize_number() local 82 * HN_IEC_PREFIXES implies a divisor of 1024 here in humanize_number() 86 divisor = 1024; in humanize_number() 95 divisor = 1000; in humanize_number() 102 divisor = 1024; in humanize_number() 146 divisor / 2))) && i < maxscale; i++) { in humanize_number() 147 remainder = quotient % divisor; in humanize_number() 148 quotient /= divisor; in humanize_number() 155 remainder = quotient % divisor; in humanize_number() 156 quotient /= divisor; in humanize_number() [all …]
|
/freebsd/sys/sys/ |
H A D | time.h | 164 __stime64_scale32_ceil(int64_t x, int32_t factor, int32_t divisor) in __stime64_scale32_ceil() argument 166 const int64_t rem = x % divisor; in __stime64_scale32_ceil() 168 return (x / divisor * factor + (rem * factor + divisor - 1) / divisor); in __stime64_scale32_ceil() 172 __stime64_scale32_floor(int64_t x, int32_t factor, int32_t divisor) in __stime64_scale32_floor() argument 174 const int64_t rem = x % divisor; in __stime64_scale32_floor() 176 return (x / divisor * factor + (rem * factor) / divisor); in __stime64_scale32_floor() 180 __utime64_scale32_ceil(uint64_t x, uint32_t factor, uint32_t divisor) in __utime64_scale32_ceil() argument 182 const uint64_t rem = x % divisor; in __utime64_scale32_ceil() 184 return (x / divisor * factor + (rem * factor + divisor - 1) / divisor); in __utime64_scale32_ceil() 188 __utime64_scale32_floor(uint64_t x, uint32_t factor, uint32_t divisor) in __utime64_scale32_floor() argument [all …]
|
H A D | pidctrl.h | 72 int pc_Kpd; /* Proportional gain divisor. */ 73 int pc_Kid; /* Integral gain divisor. */ 74 int pc_Kdd; /* Derivative gain divisor. */ 80 * Actual gains are 1/divisor. Gains interact in complex ways with the 84 #define PIDCTRL_KPD 3 /* Default proportional divisor. */ 85 #define PIDCTRL_KID 4 /* Default integral divisor. */ 86 #define PIDCTRL_KDD 8 /* Default derivative divisor. */
|
/freebsd/contrib/llvm-project/compiler-rt/lib/builtins/hexagon/ |
H A D | udivdi3.S | 26 r7 = cl0(r3:2) // count leading 0's of divisor (denominator) 27 r5:4 = r3:2 // divisor moved into working registers 31 r10 = sub(r7,r6) // left shift count for bit & divisor 37 r13:12 = lsl(r5:4,r10) // shift divisor msb into same bit position as dividend msb 38 r15:14 = lsl(r15:14,r10) // shift the bit left by same amount as divisor 41 p0 = cmp.gtu(r5:4,r3:2) // check if divisor > dividend 45 if (p0) jumpr r31 // if divisor > dividend, we're done, so return 50 p0 = cmp.gtu(r13:12,r3:2) // set predicate reg if shifted divisor > current remainder 53 r7:6 = sub(r3:2, r13:12) // subtract shifted divisor from current remainder 62 r13:12 = lsr(r13:12, #1) // shift "shifted divisor" right by 1 for next iteration
|
H A D | udivmoddi4.S | 26 r7 = cl0(r3:2) // count leading 0's of divisor (denominator) 27 r5:4 = r3:2 // divisor moved into working registers 31 r10 = sub(r7,r6) // left shift count for bit & divisor 37 r13:12 = lsl(r5:4,r10) // shift divisor msb into same bit position as dividend msb 38 r15:14 = lsl(r15:14,r10) // shift the bit left by same amount as divisor 41 p0 = cmp.gtu(r5:4,r3:2) // check if divisor > dividend 45 if (p0) jumpr r31 // if divisor > dividend, we're done, so return 50 p0 = cmp.gtu(r13:12,r3:2) // set predicate reg if shifted divisor > current remainder 53 r7:6 = sub(r3:2, r13:12) // subtract shifted divisor from current remainder 62 r13:12 = lsr(r13:12, #1) // shift "shifted divisor" right by 1 for next iteration
|
H A D | umoddi3.S | 26 r7 = cl0(r3:2) // count leading 0's of divisor (denominator) 27 r5:4 = r3:2 // divisor moved into working registers 31 r10 = sub(r7,r6) // left shift count for bit & divisor 37 r13:12 = lsl(r5:4,r10) // shift divisor msb into same bit position as dividend msb 38 r15:14 = lsl(r15:14,r10) // shift the bit left by same amount as divisor 41 p0 = cmp.gtu(r5:4,r3:2) // check if divisor > dividend 45 if (p0) jump .hexagon_umoddi3_return // if divisor > dividend, we're done, so return 50 p0 = cmp.gtu(r13:12,r3:2) // set predicate reg if shifted divisor > current remainder 53 r7:6 = sub(r3:2, r13:12) // subtract shifted divisor from current remainder 62 r13:12 = lsr(r13:12, #1) // shift "shifted divisor" right by 1 for next iteration
|
H A D | divdi3.S | 33 r7 = cl0(r3:2) // count leading 0's of divisor (denominator) 34 r5:4 = r3:2 // divisor moved into working registers 39 r10 = sub(r7,r6) // left shift count for bit & divisor 45 r13:12 = lsl(r5:4,r10) // shift divisor msb into same bit position as dividend msb 46 r15:14 = lsl(r15:14,r10) // shift the bit left by same amount as divisor 49 p0 = cmp.gtu(r5:4,r3:2) // check if divisor > dividend 53 if (p0) jump .hexagon_divdi3_return // if divisor > dividend, we're done, so return 58 p0 = cmp.gtu(r13:12,r3:2) // set predicate reg if shifted divisor > current remainder 61 r7:6 = sub(r3:2, r13:12) // subtract shifted divisor from current remainder 70 r13:12 = lsr(r13:12, #1) // shift "shifted divisor" right by 1 for next iteration
|
H A D | moddi3.S | 32 r7 = cl0(r3:2) // count leading 0's of divisor (denominator) 33 r5:4 = r3:2 // divisor moved into working registers 37 r10 = sub(r7,r6) // left shift count for bit & divisor 43 r13:12 = lsl(r5:4,r10) // shift divisor msb into same bit position as dividend msb 44 r15:14 = lsl(r15:14,r10) // shift the bit left by same amount as divisor 47 p0 = cmp.gtu(r5:4,r3:2) // check if divisor > dividend 51 if (p0) jump .hexagon_moddi3_return // if divisor > dividend, we're done, so return 56 p0 = cmp.gtu(r13:12,r3:2) // set predicate reg if shifted divisor > current remainder 59 r7:6 = sub(r3:2, r13:12) // subtract shifted divisor from current remainder 68 r13:12 = lsr(r13:12, #1) // shift "shifted divisor" right by 1 for next iteration
|
/freebsd/contrib/llvm-project/llvm/lib/Support/ |
H A D | ScaledNumber.cpp | 58 uint32_t Divisor) { in divide32() argument 60 assert(Divisor && "expected non-zero divisor"); in divide32() 69 uint64_t Quotient = Dividend64 / Divisor; in divide32() 70 uint64_t Remainder = Dividend64 % Divisor; in divide32() 77 return getRounded<uint32_t>(Quotient, Shift, Remainder >= getHalf(Divisor)); in divide32() 81 uint64_t Divisor) { in divide64() argument 83 assert(Divisor && "expected non-zero divisor"); in divide64() 85 // Minimize size of divisor. in divide64() 87 if (int Zeros = llvm::countr_zero(Divisor)) { in divide64() 89 Divisor >>= Zeros; in divide64() [all …]
|
/freebsd/crypto/openssl/crypto/bn/ |
H A D | bn_div.c | 111 * other words divisor has to be "bit-aligned to the left." bn_div_fixed_top 202 * BN_div computes dv := num / divisor, rounding towards 203 * zero, and sets up rm such that dv*divisor + rm = num holds. 205 * dv->neg == num->neg ^ divisor->neg (unless the result is zero) 209 int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, in BN_div() argument 214 if (BN_is_zero(divisor)) { in BN_div() 224 if (divisor->d[divisor->top - 1] == 0) { in BN_div() 229 ret = bn_div_fixed_top(dv, rm, num, divisor, ctx); in BN_div() 242 * It's argued that *length* of *significant* part of divisor is public. 246 * of limb length. Thanks to this assumption we can require that |divisor| [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/Transforms/Utils/ |
H A D | IntegerDivision.cpp | 32 static Value *generateSignedRemainderCode(Value *Dividend, Value *Divisor, in generateSignedRemainderCode() argument 41 // ; %divisor_sgn = ashr i32 %divisor, 31 in generateSignedRemainderCode() 43 // ; %dvs_xor = xor i32 %divisor, %divisor_sgn in generateSignedRemainderCode() 46 // ; %urem = urem i32 %dividend, %divisor in generateSignedRemainderCode() 50 Divisor = Builder.CreateFreeze(Divisor); in generateSignedRemainderCode() 52 Value *DivisorSign = Builder.CreateAShr(Divisor, Shift); in generateSignedRemainderCode() 54 Value *DvsXor = Builder.CreateXor(Divisor, DivisorSign); in generateSignedRemainderCode() 73 static Value *generatedUnsignedRemainderCode(Value *Dividend, Value *Divisor, in generatedUnsignedRemainderCode() argument 75 // Remainder = Dividend - Quotient*Divisor in generatedUnsignedRemainderCode() 79 // ; %quotient = udiv i32 %dividend, %divisor in generatedUnsignedRemainderCode() [all …]
|
H A D | BypassSlowDivision.cpp | 156 Value *Divisor = SlowDivOrRem->getOperand(1); in getReplacement() local 157 DivRemMapKey Key(isSignedOp(), Dividend, Divisor); in getReplacement() 267 Value *Divisor = SlowDivOrRem->getOperand(1); in createSlowBB() local 270 DivRemPair.Quotient = Builder.CreateSDiv(Dividend, Divisor); in createSlowBB() 271 DivRemPair.Remainder = Builder.CreateSRem(Dividend, Divisor); in createSlowBB() 273 DivRemPair.Quotient = Builder.CreateUDiv(Dividend, Divisor); in createSlowBB() 274 DivRemPair.Remainder = Builder.CreateURem(Dividend, Divisor); in createSlowBB() 291 Value *Divisor = SlowDivOrRem->getOperand(1); in createFastBB() local 293 Builder.CreateCast(Instruction::Trunc, Divisor, BypassType); in createFastBB() 324 /// Creates a runtime check to test whether both the divisor and dividend fit [all …]
|
/freebsd/sys/contrib/dev/rtw89/ |
H A D | util.h | 37 /* The result of negative dividend and positive divisor is undefined, but it in s32_div_u32_round_down() 40 * Note: the maximum value of divisor is 0x7FFF_FFFF, because we cast it to in s32_div_u32_round_down() 43 static inline s32 s32_div_u32_round_down(s32 dividend, u32 divisor, s32 *remainder) in s32_div_u32_round_closest() 45 s32 i_divisor = (s32)divisor; in s32_div_u32_round_closest() 62 static inline s32 s32_div_u32_round_closest(s32 dividend, u32 divisor) 64 return s32_div_u32_round_down(dividend + divisor / 2, divisor, NULL); 23 s32_div_u32_round_down(s32 dividend,u32 divisor,s32 * remainder) s32_div_u32_round_down() argument 42 s32_div_u32_round_closest(s32 dividend,u32 divisor) s32_div_u32_round_closest() argument
|
/freebsd/sys/contrib/dev/acpica/components/utilities/ |
H A D | utmath.c | 432 * Divisor - 32-bit divisor 447 UINT32 Divisor, in AcpiUtShortDivide() argument 459 /* Always check for a zero divisor */ in AcpiUtShortDivide() 461 if (Divisor == 0) in AcpiUtShortDivide() 473 ACPI_DIV_64_BY_32 (0, DividendOvl.Part.Hi, Divisor, in AcpiUtShortDivide() 476 ACPI_DIV_64_BY_32 (Remainder32, DividendOvl.Part.Lo, Divisor, in AcpiUtShortDivide() 499 * InDivisor - Divisor 517 UINT64_OVERLAY Divisor; in AcpiUtDivide() local 530 /* Always check for a zero divisor */ in AcpiUtDivide() 538 Divisor.Full = InDivisor; in AcpiUtDivide() [all …]
|
/freebsd/sys/contrib/device-tree/Bindings/clock/ |
H A D | vt8500.txt | 41 Divisor device clocks: 44 - divisor-reg : shall be the register offset from PMC base for the divisor 47 - divisor-mask : shall be the mask for the divisor register. Defaults to 0x1f 70 divisor-reg = <0x328>; 71 divisor-mask = <0x3f>;
|
/freebsd/sys/dev/qcom_clk/ |
H A D | qcom_clk_fdiv.c | 44 * This is a fixed divisor node. It represents some divisor 53 uint32_t divisor; member 68 *freq = *freq / sc->divisor; in qcom_clk_fdiv_recalc() 76 * There's only a single parent here for an fixed divisor, in qcom_clk_fdiv_init() 107 sc->divisor = clkdef->divisor; in qcom_clk_fdiv_register()
|
/freebsd/cddl/contrib/opensolaris/lib/libcmdutils/common/ |
H A D | nicenum.c | 44 uint64_t divisor = 1; in nicenum_scale() local 71 uint64_t newdiv = divisor * divamt; in nicenum_scale() 75 VERIFY3U(newdiv, >=, divisor); in nicenum_scale() 80 divisor = newdiv; in nicenum_scale() 88 } else if (n % divisor == 0) { in nicenum_scale() 93 rc = snprintf(buf, buflen, "%llu%c", n / divisor, u); in nicenum_scale() 108 (double)n / divisor, u)) <= 5) in nicenum_scale()
|
/freebsd/usr.sbin/ppp/ |
H A D | throughput.c | 102 int secs_up, divisor; in throughput_disp() local 112 divisor = secs_up ? secs_up : 1; in throughput_disp() 119 (t->OctetsIn + t->OctetsOut) / divisor); in throughput_disp() 129 (t->OctetsIn + t->OctetsOut) / divisor); in throughput_disp() 164 int uptime, divisor; in throughput_sampler() local 170 divisor = uptime < t->SamplePeriod ? uptime + 1 : t->SamplePeriod; in throughput_sampler() 174 t->in.OctetsPerSecond = (t->in.SampleOctets[t->nSample] - old) / divisor; in throughput_sampler() 178 t->out.OctetsPerSecond = (t->out.SampleOctets[t->nSample] - old) / divisor; in throughput_sampler() 265 int divisor; in throughput_clear() local 267 if ((divisor = throughput_uptime(t)) == 0) in throughput_clear() [all …]
|
/freebsd/contrib/jemalloc/src/ |
H A D | nstime.c | 88 nstime_idivide(nstime_t *time, uint64_t divisor) { in nstime_idivide() argument 89 assert(divisor != 0); in nstime_idivide() 91 time->ns /= divisor; in nstime_idivide() 95 nstime_divide(const nstime_t *time, const nstime_t *divisor) { in nstime_divide() argument 96 assert(divisor->ns != 0); in nstime_divide() 98 return time->ns / divisor->ns; in nstime_divide()
|
/freebsd/sys/contrib/device-tree/src/arm/vt8500/ |
H A D | wm8750.dtsi | 130 divisor-reg = <0x300>; 137 divisor-reg = <0x304>; 144 divisor-reg = <0x320>; 151 divisor-reg = <0x310>; 206 divisor-reg = <0x350>; 215 divisor-reg = <0x330>; 216 divisor-mask = <0x3f>; 225 divisor-reg = <0x3A0>; 234 divisor-reg = <0x3A4>;
|