Lines Matching full:cnt
20 * nn_lshift_fixedlen: left logical shift in N, i.e. compute out = (in << cnt).
22 * Aliasing is possible for 'in' and 'out', i.e. x <<= cnt can be computed
23 * using nn_lshift_fixedlen(x, x, cnt).
28 * 'out' parameters and the value of 'cnt'. It does not depend on the
39 int nn_lshift_fixedlen(nn_t out, nn_src_t in, bitcnt_t cnt) in nn_lshift_fixedlen() argument
50 dec = cnt / WORD_BITS; in nn_lshift_fixedlen()
51 hshift = cnt % WORD_BITS; in nn_lshift_fixedlen()
75 * nn_lshift: left logical shift in N, i.e. compute out = (in << cnt).
77 * Aliasing is possible for 'in' and 'out', i.e. x <<= cnt can be computed
78 * using nn_lshift(x, x, cnt).
83 * 'out' parameters and the value of 'cnt'. It does not depend on the
88 * will be roughly in bit length plus cnt, maxed to NN_MAX_BIT_LEN.
94 int nn_lshift(nn_t out, nn_src_t in, bitcnt_t cnt) in nn_lshift() argument
110 owlen = (u8)LOCAL_MIN(BIT_LEN_WORDS(cnt + blen), in nn_lshift()
114 dec = cnt / WORD_BITS; in nn_lshift()
115 hshift = cnt % WORD_BITS; in nn_lshift()
139 * nn_rshift_fixedlen: right logical shift in N, i.e. compute out = (in >> cnt).
141 * Aliasing is possible for 'in' and 'out', i.e. x >>= cnt can be computed
142 * using nn_rshift_fixedlen(x, x, cnt).
147 * 'out' parameters and the value of 'cnt'. It does not depend on the
157 int nn_rshift_fixedlen(nn_t out, nn_src_t in, bitcnt_t cnt) in nn_rshift_fixedlen() argument
168 dec = cnt / WORD_BITS; in nn_rshift_fixedlen()
169 lshift = cnt % WORD_BITS; in nn_rshift_fixedlen()
193 * nn_rshift: right logical shift in N, i.e. compute out = (in >> cnt).
195 * Aliasing is possible for 'in' and 'out', i.e. x >>= cnt can be computed
196 * using nn_rshift_fixedlen(x, x, cnt).
201 * 'out' parameters and the value of 'cnt'. It does not depend on the
205 * equal to input bit length minus cnt.
211 int nn_rshift(nn_t out, nn_src_t in, bitcnt_t cnt) in nn_rshift() argument
225 dec = cnt / WORD_BITS; in nn_rshift()
226 lshift = cnt % WORD_BITS; in nn_rshift()
231 if (cnt > blen) { in nn_rshift()
234 owlen = (u8)BIT_LEN_WORDS(blen - cnt); in nn_rshift()
269 * This function right rotates the input NN value by the value 'cnt' on the
271 * of x by cnt is "simply": (x >> cnt) ^ (x << (bitlen - cnt))
277 int nn_rrot(nn_t out, nn_src_t in, bitcnt_t cnt, bitcnt_t bitlen) in nn_rrot() argument
285 MUST_HAVE((cnt < bitlen), ret, err); in nn_rrot()
289 ret = nn_lshift(&tmp, in, (bitcnt_t)(bitlen - cnt)); EG(ret, err); in nn_rrot()
291 ret = nn_rshift(out, in, cnt); EG(ret, err); in nn_rrot()
309 * This function left rotates the input NN value by the value 'cnt' on the
311 * of x by cnt is "simply": (x << cnt) ^ (x >> (bitlen - cnt))
317 int nn_lrot(nn_t out, nn_src_t in, bitcnt_t cnt, bitcnt_t bitlen) in nn_lrot() argument
325 MUST_HAVE(!(cnt >= bitlen), ret, err); in nn_lrot()
329 ret = nn_lshift(&tmp, in, cnt); EG(ret, err); in nn_lrot()
331 ret = nn_rshift(out, in, (bitcnt_t)(bitlen - cnt)); EG(ret, err); in nn_lrot()
487 u8 cnt = WORD_BITS, over = 0; in wclz() local
494 cnt = (u8)(cnt - over); in wclz()
497 return cnt; in wclz()
507 bitcnt_t cnt = 0; in nn_clz() local
517 cnt = (bitcnt_t)(cnt + WORD_BITS); in nn_clz()
519 cnt = (bitcnt_t)(cnt + wclz(in->val[i - 1])); in nn_clz()
523 *lz = cnt; in nn_clz()