… | |
… | |
455 | For example: |
455 | For example: |
456 | |
456 | |
457 | ecb_popcount32 (7) = 3 |
457 | ecb_popcount32 (7) = 3 |
458 | ecb_popcount32 (255) = 8 |
458 | ecb_popcount32 (255) = 8 |
459 | |
459 | |
|
|
460 | =item uint8_t ecb_bitrev8 (uint8_t x) |
|
|
461 | |
|
|
462 | =item uint16_t ecb_bitrev16 (uint16_t x) |
|
|
463 | |
|
|
464 | =item uint32_t ecb_bitrev32 (uint32_t x) |
|
|
465 | |
|
|
466 | Reverses the bits in x, i.e. the MSB becomes the LSB, MSB-1 becomes LSB+1 |
|
|
467 | and so on. |
|
|
468 | |
|
|
469 | Example: |
|
|
470 | |
|
|
471 | ecb_bitrev8 (0xa7) = 0xea |
|
|
472 | ecb_bitrev32 (0xffcc4411) = 0x882233ff |
|
|
473 | |
460 | =item uint32_t ecb_bswap16 (uint32_t x) |
474 | =item uint32_t ecb_bswap16 (uint32_t x) |
461 | |
475 | |
462 | =item uint32_t ecb_bswap32 (uint32_t x) |
476 | =item uint32_t ecb_bswap32 (uint32_t x) |
463 | |
477 | |
464 | =item uint64_t ecb_bswap64 (uint64_t x) |
478 | =item uint64_t ecb_bswap64 (uint64_t x) |
… | |
… | |
527 | |
541 | |
528 | =item x = ecb_div_ru (val, div) |
542 | =item x = ecb_div_ru (val, div) |
529 | |
543 | |
530 | Returns C<val> divided by C<div> rounded down or up, respectively. |
544 | Returns C<val> divided by C<div> rounded down or up, respectively. |
531 | C<val> and C<div> must have integer types and C<div> must be strictly |
545 | C<val> and C<div> must have integer types and C<div> must be strictly |
532 | positive. |
546 | positive. Note that these functions are implemented with macros in C |
|
|
547 | and with function templates in C++. |
533 | |
548 | |
534 | =back |
549 | =back |
535 | |
550 | |
536 | =head2 UTILITY |
551 | =head2 UTILITY |
537 | |
552 | |