• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500-V1.0.1.40_1.0.68/src/linux/linux-2.6/arch/s390/lib/

Lines Matching refs:base

19 static uint32_t __div64_31(uint64_t *n, uint32_t base)
26 /* Special case base==1, remainder = 0, quotient = n */
27 if (base == 1)
30 * Special case base==0 will cause a fixed point divide exception
32 * following calculation we can assume base > 1. The first
40 : "+d" (reg2), "+d" (reg3) : "d" (base) : "cc" );
50 * is increased by one then checked against the base. If the
51 * remainder has overflown subtract base and increase the
67 : "d" (base), "2" (1UL) : "cc" );
76 uint32_t __div64_32(uint64_t *n, uint32_t base)
81 * If the most significant bit of base is set, divide n by
82 * (base/2). That allows to use 64/31 bit division and gives a
83 * good approximation of the result: n = (base/2)*q + r. The
85 * If base is already < 2^31-1 __div64_31 can be used directly.
87 r = __div64_31(n, ((signed) base < 0) ? (base/2) : base);
88 if ((signed) base < 0) {
92 * n = (base/2)*q + r
93 * = ((base/2)*2)*(q/2) + ((q&1) ? (base/2) : 0) + r
94 * Since r < (base/2), r + (base/2) < base.
95 * With q1 = (q/2) and r1 = r + ((q&1) ? (base/2) : 0)
96 * n = ((base/2)*2)*q1 + r1 with r1 < base.
99 r += base/2;
102 * Second transformation. ((base/2)*2) could have lost the
104 * n = ((base/2)*2)*q1 + r1
105 * = base*q1 - ((base&1) ? q1 : 0) + r1
107 if (base & 1) {
110 * base is >= 2^31. The worst case for the while
111 * loop is n=2^64-1 base=2^31+1. That gives a
113 * base >= 2^31 the loop is finished after a maximum
117 rx += base;
129 uint32_t __div64_32(uint64_t *n, uint32_t base)
139 : "+d" (reg2), "+d" (reg3) : "d" (base) : "cc" );
144 : "+d" (reg2), "+d" (reg3) : "d" (base) : "cc" );