Home
last modified time | relevance | path

Searched refs:k (Results 1 – 25 of 67) sorted by relevance

123

/bionic/libc/upstream-openbsd/lib/libc/string/
Dmemmem.c30 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 …]
Dstrstr.c69 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/libm/upstream-freebsd/lib/msun/src/
Ds_scalbnf.c31 int32_t k,ix; in scalbnf() local
33 k = (ix&0x7f800000)>>23; /* extract exponent */ in scalbnf()
34 if (k==0) { /* 0 or subnormal x */ in scalbnf()
38 k = ((ix&0x7f800000)>>23) - 25; in scalbnf()
41 if (k==0xff) return x+x; /* NaN or Inf */ in scalbnf()
42 k = k+n; in scalbnf()
43 if (k > 0xfe) return huge*copysignf(huge,x); /* overflow */ in scalbnf()
44 if (k > 0) /* normal result */ in scalbnf()
45 {SET_FLOAT_WORD(x,(ix&0x807fffff)|(k<<23)); return x;} in scalbnf()
46 if (k <= -25) { in scalbnf()
[all …]
Ds_scalbn.c37 int32_t k,hx,lx; in scalbn() local
39 k = (hx&0x7ff00000)>>20; /* extract exponent */ in scalbn()
40 if (k==0) { /* 0 or subnormal x */ in scalbn()
44 k = ((hx&0x7ff00000)>>20) - 54; in scalbn()
47 if (k==0x7ff) return x+x; /* NaN or Inf */ in scalbn()
48 k = k+n; in scalbn()
49 if (k > 0x7fe) return huge*copysign(huge,x); /* overflow */ in scalbn()
50 if (k > 0) /* normal result */ in scalbn()
51 {SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20)); return x;} in scalbn()
52 if (k <= -54) { in scalbn()
[all …]
Ds_scalbnl.c46 int k; in scalbnl() local
48 k = u.bits.exp; /* extract exponent */ in scalbnl()
49 if (k==0) { /* 0 or subnormal x */ in scalbnl()
52 k = u.bits.exp - 128; in scalbnl()
55 if (k==0x7fff) return x+x; /* NaN or Inf */ in scalbnl()
56 k = k+n; in scalbnl()
57 if (k >= 0x7fff) return huge*copysignl(huge,x); /* overflow */ in scalbnl()
58 if (k > 0) /* normal result */ in scalbnl()
59 {u.bits.exp = k; return u.e;} in scalbnl()
60 if (k <= -128) { in scalbnl()
[all …]
Ds_log1pf.c43 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 …]
Ds_log1p.c105 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 …]
Ds_expm1f.c45 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 …]
Ds_expm1.c136 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 …]
De_expf.c49 int32_t k=0,xsb; in __ieee754_expf() local
69 hi = x-ln2HI[xsb]; lo=ln2LO[xsb]; k = 1-xsb-xsb; in __ieee754_expf()
71 k = invln2*x+halF[xsb]; in __ieee754_expf()
72 t = k; in __ieee754_expf()
81 else k = 0; in __ieee754_expf()
85 if(k >= -125) in __ieee754_expf()
86 SET_FLOAT_WORD(twopk,((u_int32_t)(0x7f+k))<<23); in __ieee754_expf()
88 SET_FLOAT_WORD(twopk,((u_int32_t)(0x7f+(k+100)))<<23); in __ieee754_expf()
90 if(k==0) return one-((x*c)/(c-(float)2.0)-x); in __ieee754_expf()
92 if(k >= -125) { in __ieee754_expf()
[all …]
De_logf.c39 int32_t k,ix,i,j; in __ieee754_logf() local
43 k=0; in __ieee754_logf()
48 k -= 25; x *= two25; /* subnormal number, scale up x */ in __ieee754_logf()
52 k += (ix>>23)-127; in __ieee754_logf()
56 k += (i>>23); in __ieee754_logf()
60 if(k==0) { in __ieee754_logf()
63 dk=(float)k; in __ieee754_logf()
68 if(k==0) return f-R; else {dk=(float)k; in __ieee754_logf()
72 dk = (float)k; in __ieee754_logf()
83 if(k==0) return f-(hfsq-s*(hfsq+R)); else in __ieee754_logf()
[all …]
De_log.c92 int32_t k,hx,i,j; in __ieee754_log() local
97 k=0; in __ieee754_log()
102 k -= 54; x *= two54; /* subnormal number, scale up x */ in __ieee754_log()
106 k += (hx>>20)-1023; in __ieee754_log()
110 k += (i>>20); in __ieee754_log()
114 if(k==0) { in __ieee754_log()
117 dk=(double)k; in __ieee754_log()
122 if(k==0) return f-R; else {dk=(double)k; in __ieee754_log()
126 dk = (double)k; in __ieee754_log()
137 if(k==0) return f-(hfsq-s*(hfsq+R)); else in __ieee754_log()
[all …]
De_exp.c108 int32_t k=0,xsb; in __ieee754_exp() local
131 hi = x-ln2HI[xsb]; lo=ln2LO[xsb]; k = 1-xsb-xsb; in __ieee754_exp()
133 k = (int)(invln2*x+halF[xsb]); in __ieee754_exp()
134 t = k; in __ieee754_exp()
143 else k = 0; in __ieee754_exp()
147 if(k >= -1021) in __ieee754_exp()
148 INSERT_WORDS(twopk,((u_int32_t)(0x3ff+k))<<20, 0); in __ieee754_exp()
150 INSERT_WORDS(twopk,((u_int32_t)(0x3ff+(k+1000)))<<20, 0); in __ieee754_exp()
152 if(k==0) return one-((x*c)/(c-2.0)-x); in __ieee754_exp()
154 if(k >= -1021) { in __ieee754_exp()
[all …]
Ds_cbrtl.c43 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 …]
De_pow.c105 int32_t i,j,k,yisint,n; in __ieee754_pow() local
133 k = (iy>>20)-0x3ff; /* exponent */ in __ieee754_pow()
134 if(k>20) { in __ieee754_pow()
135 j = ly>>(52-k); in __ieee754_pow()
136 if(((u_int32_t)j<<(52-k))==ly) yisint = 2-(j&1); in __ieee754_pow()
138 j = iy>>(20-k); in __ieee754_pow()
139 if((j<<(20-k))==iy) yisint = 2-(j&1); in __ieee754_pow()
220 if(j<=0x3988E) k=0; /* |x|<sqrt(3/2) */ in __ieee754_pow()
221 else if(j<0xBB67A) k=1; /* |x|<sqrt(3) */ in __ieee754_pow()
222 else {k=0;n+=1;ix -= 0x00100000;} in __ieee754_pow()
[all …]
Ds_exp2.c348 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()
/bionic/libc/upstream-openbsd/lib/libc/gdtoa/
Dsmisc.c43 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 …]
Dmisc.c50 (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 …]
Dstrtord.c36 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;
Dgmisc.c36 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;
DstrtorQ.c54 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;
/bionic/libc/upstream-freebsd/lib/libc/gen/
Dldexp.c100 int32_t k,hx,lx; in ldexp() local
102 k = (hx&0x7ff00000)>>20; /* extract exponent */ in ldexp()
103 if (k==0) { /* 0 or subnormal x */ in ldexp()
107 k = ((hx&0x7ff00000)>>20) - 54; in ldexp()
110 if (k==0x7ff) return x+x; /* NaN or Inf */ in ldexp()
111 k = k+n; in ldexp()
112 if (k > 0x7fe) return huge*_copysign(huge,x); /* overflow */ in ldexp()
113 if (k > 0) /* normal result */ in ldexp()
114 {SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20)); return x;} in ldexp()
115 if (k <= -54) { in ldexp()
[all …]
/bionic/libm/upstream-freebsd/lib/msun/bsdsrc/
Db_exp.c91 int k;
101 k=invln2*x+copysign(0.5,x); /* k=NINT(x/ln2) */
105 hi=x-k*ln2hi;
106 x=hi-(lo=k*ln2lo);
111 return scalb(1.0+(hi-(lo-(x*c)/(2.0-c))),k);
137 int k; local
146 k = z + copysign(.5, x);
150 hi=(x-k*ln2hi); /* Exact. */
151 x= hi - (lo = k*ln2lo-c);
157 return scalb(1.+(hi-(lo - c)), k);
/bionic/libc/kernel/uapi/linux/
Dbcache.h22 #define BITMASK(name,type,field,offset,size) static inline __u64 name(const type * k) \
23 { return(k->field >> offset) & ~(~0ULL << size); } static inline void SET_ ##name(type * k, __u64 v…
24 { k->field &= ~(~(~0ULL << size) << offset); k->field |= (v & ~(~0ULL << size)) << offset; \
32 #define PTR_FIELD(name,offset,size) static inline __u64 name(const struct bkey * k, unsigned int i)…
33 { return(k->ptr[i] >> offset) & ~(~0ULL << size); } static inline void SET_ ##name(struct bkey * k,…
34 { k->ptr[i] &= ~(~(~0ULL << size) << offset); k->ptr[i] |= (v & ~(~0ULL << size)) << offset; \
45 #define KEY_START(k) (KEY_OFFSET(k) - KEY_SIZE(k)) argument
46 #define START_KEY(k) KEY(KEY_INODE(k), KEY_START(k), 0) argument
/bionic/benchmarks/
Dstdlib_benchmark.cpp177 size_t i, j, k, l; in BM_stdlib_mbstowcs() local
184 for (k=0x80; k<0xc0; k++) in BM_stdlib_mbstowcs()
185 buf[l++] = i, buf[l++] = j, buf[l++] = k; in BM_stdlib_mbstowcs()
188 for (k=0x80; k<0xc0; k++) in BM_stdlib_mbstowcs()
189 buf[l++] = i, buf[l++] = j, buf[l++] = 0x80, buf[l++] = k; in BM_stdlib_mbstowcs()
216 size_t i, j, k, l; in BM_stdlib_mbrtowc() local
223 for (k=0x80; k<0xc0; k++) in BM_stdlib_mbrtowc()
224 buf[l++] = i, buf[l++] = j, buf[l++] = k; in BM_stdlib_mbrtowc()
227 for (k=0x80; k<0xc0; k++) in BM_stdlib_mbrtowc()
228 buf[l++] = i, buf[l++] = j, buf[l++] = 0x80, buf[l++] = k; in BM_stdlib_mbrtowc()

123