/bionic/libc/upstream-openbsd/lib/libc/string/ |
D | memmem.c | 30 twobyte_memmem(const unsigned char *h, size_t k, const unsigned char *n) in twobyte_memmem() argument 33 for (h+=2, k-=2; k; k--, hw = hw<<8 | *h++) in twobyte_memmem() 39 threebyte_memmem(const unsigned char *h, size_t k, const unsigned char *n) in threebyte_memmem() argument 43 for (h+=3, k-=3; k; k--, hw = (hw|*h++)<<8) in threebyte_memmem() 49 fourbyte_memmem(const unsigned char *h, size_t k, const unsigned char *n) in fourbyte_memmem() argument 53 for (h+=4, k-=4; k; k--, hw = hw<<8 | *h++) in fourbyte_memmem() 72 size_t i, ip, jp, k, p, ms, p0, mem, mem0; in twoway_memmem() local 81 ip = -1; jp = 0; k = p = 1; in twoway_memmem() 82 while (jp+k<l) { in twoway_memmem() 83 if (n[ip+k] == n[jp+k]) { in twoway_memmem() [all …]
|
D | strstr.c | 69 size_t l, ip, jp, k, p, ms, p0, mem, mem0; in twoway_strstr() local 79 ip = -1; jp = 0; k = p = 1; in twoway_strstr() 80 while (jp+k<l) { in twoway_strstr() 81 if (n[ip+k] == n[jp+k]) { in twoway_strstr() 82 if (k == p) { in twoway_strstr() 84 k = 1; in twoway_strstr() 85 } else k++; in twoway_strstr() 86 } else if (n[ip+k] > n[jp+k]) { in twoway_strstr() 87 jp += k; in twoway_strstr() 88 k = 1; in twoway_strstr() [all …]
|
/bionic/libc/upstream-openbsd/lib/libc/gdtoa/ |
D | misc.c | 50 (k) int k; in Balloc() argument 52 (int k) 64 if (k <= Kmax && (rv = freelist[k]) !=0) { 65 freelist[k] = rv->next; 68 x = 1 << k; 76 if (k <= Kmax && pmem_next - private_mem + len <= PRIVATE_mem) { 86 rv->k = k; 103 if (v->k > Kmax) 111 v->next = freelist[v->k]; 112 freelist[v->k] = v; [all …]
|
D | smisc.c | 43 int i, k; local 47 for(k = 0, y = 1; x > y; y <<= 1, k++) ; 49 b = Balloc(k); 55 b = Balloc(k+1); 91 int k, ka, kb; local 95 k = ka - kb + ULbits*(a->wds - b->wds); 97 if (k > 0) { 98 word0(&da) += (k >> 2)*Exp_msk1; 99 if (k &= 3) 100 dval(&da) *= 1 << k; [all …]
|
D | strtord.c | 36 ULtod(L, bits, exp, k) ULong *L; ULong *bits; Long exp; int k; in ULtod() argument 38 ULtod(ULong *L, ULong *bits, Long exp, int k) 41 switch(k & STRTOG_Retmask) { 70 if (k & STRTOG_Neg) 85 int k; local 93 k = strtodg(s, sp, fpi, &exp, bits); 94 ULtod((ULong*)d, bits, exp, k); 95 return k;
|
D | gmisc.c | 36 rshift(b, k) Bigint *b; int k; in rshift() argument 38 rshift(Bigint *b, int k) 45 n = k >> kshift; 49 if (k &= kmask) { 50 n = ULbits - k; 51 y = *x++ >> k; 54 y = *x++ >> k;
|
D | strtorQ.c | 54 ULtoQ(L, bits, exp, k) ULong *L; ULong *bits; Long exp; int k; in ULtoQ() argument 56 ULtoQ(ULong *L, ULong *bits, Long exp, int k) 59 switch(k & STRTOG_Retmask) { 94 if (k & STRTOG_Neg) 109 int k; local 117 k = strtodg(s, sp, fpi, &exp, bits); 118 ULtoQ((ULong*)L, bits, exp, k); 119 return k;
|
D | gethex.c | 48 int big, esign, havedig, irv, j, k, n, n0, nbits, up, zret; local 190 for(j = n, k = 0; j >>= 1; ++k); 191 *bp = b = Balloc(k); 203 for(k = 0; n > (1 << (kshift-2)) - 1; n >>= 1) 204 k++; 205 b = Balloc(k); 242 k = n - 1; 243 if (x[k>>kshift] & 1 << (k & kmask)) { 245 if (k > 0 && any_on(b,k)) 304 k = n - 1; [all …]
|
D | gdtoa.c | 41 int i, k; local 46 k = 0; 49 k++; 52 if (!k) 53 k = 1; 55 b = Balloc(k); 159 int j, j1, k, k0, k_check, kind, leftright, m2, m5, nbits; local 248 k = (int)ds; 249 if (ds < 0. && ds != k) 250 k--; /* want k = floor(ds) */ [all …]
|
D | dtoa.c | 119 j, j1, k, k0, k_check, leftright, m2, m5, s2, s5, local 259 k = (int)ds; 260 if (ds < 0. && ds != k) 261 k--; /* want k = floor(ds) */ 263 if (k >= 0 && k <= Ten_pmax) { 264 if (dval(&d) < tens[k]) 265 k--; 277 if (k >= 0) { 279 s5 = k; 280 s2 += k; [all …]
|
/bionic/libm/upstream-freebsd/lib/msun/src/ |
D | s_log1pf.c | 43 int32_t k,hx,hu,ax; in log1pf() local 48 k = 1; in log1pf() 62 k=0;f=x;hu=1;} /* sqrt(2)/2- <= 1+x < sqrt(2)+ */ in log1pf() 65 if(k!=0) { in log1pf() 69 k = (hu>>23)-127; in log1pf() 71 c = (k>0)? (float)1.0-(u-x):x-(u-(float)1.0); in log1pf() 76 k = (hu>>23)-127; in log1pf() 90 k += 1; in log1pf() 99 if(k==0) { in log1pf() 102 c += k*ln2_lo; in log1pf() [all …]
|
D | s_log1p.c | 105 int32_t k,hx,hu,ax; in log1p() local 110 k = 1; in log1p() 124 k=0;f=x;hu=1;} /* sqrt(2)/2- <= 1+x < sqrt(2)+ */ in log1p() 127 if(k!=0) { in log1p() 131 k = (hu>>20)-1023; in log1p() 132 c = (k>0)? 1.0-(u-x):x-(u-1.0);/* correction term */ in log1p() 137 k = (hu>>20)-1023; in log1p() 151 k += 1; in log1p() 160 if(k==0) { in log1p() 163 c += k*ln2_lo; in log1p() [all …]
|
D | s_expm1f.c | 45 int32_t k,xsb; in expm1f() local 71 {hi = x - ln2_hi; lo = ln2_lo; k = 1;} in expm1f() 73 {hi = x + ln2_hi; lo = -ln2_lo; k = -1;} in expm1f() 75 k = invln2*x+((xsb==0)?(float)0.5:(float)-0.5); in expm1f() 76 t = k; in expm1f() 87 else k = 0; in expm1f() 95 if(k==0) return x - (x*e-hxs); /* c is 0 */ in expm1f() 97 SET_FLOAT_WORD(twopk,((u_int32_t)(0x7f+k))<<23); /* 2^k */ in expm1f() 100 if(k== -1) return (float)0.5*(x-e)-(float)0.5; in expm1f() 101 if(k==1) { in expm1f() [all …]
|
D | s_expm1.c | 136 int32_t k,xsb; in expm1() local 165 {hi = x - ln2_hi; lo = ln2_lo; k = 1;} in expm1() 167 {hi = x + ln2_hi; lo = -ln2_lo; k = -1;} in expm1() 169 k = invln2*x+((xsb==0)?0.5:-0.5); in expm1() 170 t = k; in expm1() 181 else k = 0; in expm1() 189 if(k==0) return x - (x*e-hxs); /* c is 0 */ in expm1() 191 INSERT_WORDS(twopk,((u_int32_t)(0x3ff+k))<<20,0); /* 2^k */ in expm1() 194 if(k== -1) return 0.5*(x-e)-0.5; in expm1() 195 if(k==1) { in expm1() [all …]
|
D | e_expf.c | 49 int32_t k=0,xsb; in expf() local 69 hi = x-ln2HI[xsb]; lo=ln2LO[xsb]; k = 1-xsb-xsb; in expf() 71 k = invln2*x+halF[xsb]; in expf() 72 t = k; in expf() 81 else k = 0; in expf() 85 if(k >= -125) in expf() 86 SET_FLOAT_WORD(twopk,((u_int32_t)(0x7f+k))<<23); in expf() 88 SET_FLOAT_WORD(twopk,((u_int32_t)(0x7f+(k+100)))<<23); in expf() 90 if(k==0) return one-((x*c)/(c-(float)2.0)-x); in expf() 92 if(k >= -125) { in expf() [all …]
|
D | e_logf.c | 39 int32_t k,ix,i,j; in logf() local 43 k=0; in logf() 48 k -= 25; x *= two25; /* subnormal number, scale up x */ in logf() 52 k += (ix>>23)-127; in logf() 56 k += (i>>23); in logf() 60 if(k==0) { in logf() 63 dk=(float)k; in logf() 68 if(k==0) return f-R; else {dk=(float)k; in logf() 72 dk = (float)k; in logf() 83 if(k==0) return f-(hfsq-s*(hfsq+R)); else in logf() [all …]
|
D | e_log.c | 92 int32_t k,hx,i,j; in log() local 97 k=0; in log() 102 k -= 54; x *= two54; /* subnormal number, scale up x */ in log() 106 k += (hx>>20)-1023; in log() 110 k += (i>>20); in log() 114 if(k==0) { in log() 117 dk=(double)k; in log() 122 if(k==0) return f-R; else {dk=(double)k; in log() 126 dk = (double)k; in log() 137 if(k==0) return f-(hfsq-s*(hfsq+R)); else in log() [all …]
|
D | e_exp.c | 108 int32_t k=0,xsb; in exp() local 131 hi = x-ln2HI[xsb]; lo=ln2LO[xsb]; k = 1-xsb-xsb; in exp() 133 k = (int)(invln2*x+halF[xsb]); in exp() 134 t = k; in exp() 143 else k = 0; in exp() 147 if(k >= -1021) in exp() 148 INSERT_WORDS(twopk,((u_int32_t)(0x3ff+k))<<20, 0); in exp() 150 INSERT_WORDS(twopk,((u_int32_t)(0x3ff+(k+1000)))<<20, 0); in exp() 152 if(k==0) return one-((x*c)/(c-2.0)-x); in exp() 154 if(k >= -1021) { in exp() [all …]
|
D | s_cbrtl.c | 43 int k; in cbrtl() local 47 k = expsign & 0x7fff; in cbrtl() 53 if (k == BIAS + LDBL_MAX_EXP) in cbrtl() 57 if (k == 0) { in cbrtl() 63 k = u.bits.exp; in cbrtl() 64 k -= BIAS + 514; in cbrtl() 66 k -= BIAS; in cbrtl() 71 switch (k % 3) { in cbrtl() 75 k--; in cbrtl() 80 k -= 2; in cbrtl() [all …]
|
D | e_pow.c | 105 int32_t i,j,k,yisint,n; in pow() local 133 k = (iy>>20)-0x3ff; /* exponent */ in pow() 134 if(k>20) { in pow() 135 j = ly>>(52-k); in pow() 136 if(((u_int32_t)j<<(52-k))==ly) yisint = 2-(j&1); in pow() 138 j = iy>>(20-k); in pow() 139 if((j<<(20-k))==iy) yisint = 2-(j&1); in pow() 220 if(j<=0x3988E) k=0; /* |x|<sqrt(3/2) */ in pow() 221 else if(j<0xBB67A) k=1; /* |x|<sqrt(3) */ in pow() 222 else {k=0;n+=1;ix -= 0x00100000;} in pow() [all …]
|
D | e_powf.c | 63 int32_t i,j,k,yisint,n; in powf() local 90 k = (iy>>23)-0x7f; /* exponent */ in powf() 91 j = iy>>(23-k); in powf() 92 if((j<<(23-k))==iy) yisint = 2-(j&1); in powf() 161 if(j<=0x1cc471) k=0; /* |x|<sqrt(3/2) */ in powf() 162 else if(j<0x5db3d7) k=1; /* |x|<sqrt(3) */ in powf() 163 else {k=0;n+=1;ix -= 0x00800000;} in powf() 167 u = ax-bp[k]; /* bp[0]=1.0, bp[1]=1.5 */ in powf() 168 v = one/(ax+bp[k]); in powf() 175 SET_FLOAT_WORD(t_h,is+0x00400000+(k<<21)); in powf() [all …]
|
D | s_exp2.c | 348 int k; in exp2() local 373 k = (i0 >> TBLBITS) << 20; in exp2() 381 if (k >= -(1021 << 20)) in exp2() 382 INSERT_WORDS(twopk, 0x3ff00000 + k, 0); in exp2() 384 INSERT_WORDS(twopkp1000, 0x3ff00000 + k + (1000 << 20), 0); in exp2() 388 if(k >= -(1021 << 20)) { in exp2() 389 if (k == 1024 << 20) in exp2()
|
D | e_log2f.c | 35 int32_t i,k,hx; in log2f() local 39 k=0; in log2f() 44 k -= 25; x *= two25; /* subnormal number, scale up x */ in log2f() 50 k += (hx>>23)-127; in log2f() 54 k += (i>>23); in log2f() 55 y = (float)k; in log2f()
|
/bionic/libm/upstream-freebsd/lib/msun/ld128/ |
D | k_expl.h | 276 int k; in k_hexpl() local 278 __k_expl(x, hip, lop, &k); in k_hexpl() 279 SET_FLOAT_WORD(twopkm1, 0x3f800000 + ((k - 1) << 23)); in k_hexpl() 288 int k; in hexpl() local 291 __k_expl(x, &hi, &lo, &k); in hexpl() 292 SET_LDBL_EXPSIGN(twopkm2, BIAS + k - 2); in hexpl() 305 int half_expt, k; in __ldexp_cexpl() local 309 __k_expl(x, &hi, &lo, &k); in __ldexp_cexpl() 312 expt += k - 16382; in __ldexp_cexpl()
|
D | s_expl.c | 65 int k; in expl() local 89 __k_expl(x, &hi, &lo, &k); in expl() 97 if (k >= LDBL_MIN_EXP) { in expl() 98 if (k == LDBL_MAX_EXP) in expl() 100 SET_LDBL_EXPSIGN(twopk, BIAS + k); in expl() 103 SET_LDBL_EXPSIGN(twopk, BIAS + k + 10000); in expl() 208 int k, n, n2; in expm1l() local 273 k = n >> LOG2_INTERVALS; in expm1l() 280 v.xbits.expsign = BIAS + k; in expm1l() 293 if (k == 0) { in expm1l() [all …]
|