| 470 | // necessary, or correct the tail bits by subsequent calls. |
| 471 | template <typename Op> |
| 472 | void BitmapOp(const uint8_t* left, int64_t left_offset, const uint8_t* right, |
| 473 | int64_t right_offset, int64_t length, int64_t out_offset, uint8_t* dest) { |
| 474 | if (out_offset % 8 == left_offset % 8 && out_offset % 8 == right_offset % 8) { |
| 475 | // Fast case: can use byte-wise BitOp after handling leading unaligned bits. |
| 476 | int64_t leading_unaligned_bits = (8 - left_offset % 8) % 8; |
| 477 | if (leading_unaligned_bits > 0) { |
| 478 | UnalignedBitmapOp<Op>(left, left_offset, right, right_offset, dest, out_offset, |
| 479 | leading_unaligned_bits); |
| 480 | } |
| 481 | if (length > leading_unaligned_bits) { |
| 482 | AlignedBitmapOp<Op>(left, left_offset + leading_unaligned_bits, right, |
| 483 | right_offset + leading_unaligned_bits, dest, |
| 484 | out_offset + leading_unaligned_bits, |
| 485 | length - leading_unaligned_bits); |
| 486 | } |
| 487 | } else { |
| 488 | // Unaligned |
| 489 | UnalignedBitmapOp<Op>(left, left_offset, right, right_offset, dest, out_offset, |
| 490 | length); |
| 491 | } |
| 492 | } |
| 493 | |
| 494 | template <typename Op> |
| 495 | Result<std::shared_ptr<Buffer>> BitmapOp(MemoryPool* pool, const uint8_t* left, |
nothing calls this directly
no test coverage detected