Lines Matching refs:shift

457                                  unsigned long shift, unsigned long nbits)  in bitmap_copy_with_src_offset()  argument
462 src += BIT_WORD(shift); in bitmap_copy_with_src_offset()
463 shift %= BITS_PER_LONG; in bitmap_copy_with_src_offset()
465 if (!shift) { in bitmap_copy_with_src_offset()
471 right_mask = (1ul << shift) - 1; in bitmap_copy_with_src_offset()
475 *dst = (*src & left_mask) >> shift; in bitmap_copy_with_src_offset()
476 *dst |= (src[1] & right_mask) << (BITS_PER_LONG - shift); in bitmap_copy_with_src_offset()
482 if (nbits > BITS_PER_LONG - shift) { in bitmap_copy_with_src_offset()
483 *dst = (*src & left_mask) >> shift; in bitmap_copy_with_src_offset()
484 nbits -= BITS_PER_LONG - shift; in bitmap_copy_with_src_offset()
486 *dst |= (src[1] & last_mask) << (BITS_PER_LONG - shift); in bitmap_copy_with_src_offset()
489 *dst = (*src >> shift) & last_mask; in bitmap_copy_with_src_offset()
499 unsigned long shift, unsigned long nbits) in bitmap_copy_with_dst_offset() argument
504 dst += BIT_WORD(shift); in bitmap_copy_with_dst_offset()
505 shift %= BITS_PER_LONG; in bitmap_copy_with_dst_offset()
507 if (!shift) { in bitmap_copy_with_dst_offset()
513 right_mask = (1ul << (BITS_PER_LONG - shift)) - 1; in bitmap_copy_with_dst_offset()
516 *dst &= (1ul << shift) - 1; in bitmap_copy_with_dst_offset()
518 *dst |= (*src & right_mask) << shift; in bitmap_copy_with_dst_offset()
519 dst[1] = (*src & left_mask) >> (BITS_PER_LONG - shift); in bitmap_copy_with_dst_offset()
525 if (nbits > BITS_PER_LONG - shift) { in bitmap_copy_with_dst_offset()
526 *dst |= (*src & right_mask) << shift; in bitmap_copy_with_dst_offset()
527 nbits -= BITS_PER_LONG - shift; in bitmap_copy_with_dst_offset()
528 last_mask = ((1ul << nbits) - 1) << (BITS_PER_LONG - shift); in bitmap_copy_with_dst_offset()
529 dst[1] = (*src & last_mask) >> (BITS_PER_LONG - shift); in bitmap_copy_with_dst_offset()
532 *dst |= (*src & last_mask) << shift; in bitmap_copy_with_dst_offset()