MCPcopy Create free account
hub / github.com/numpy/numpy / npy_bswap8

Function npy_bswap8

numpy/core/src/common/lowlevel_strided_loops.h:517–532  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

515}
516
517static inline npy_uint64
518npy_bswap8(npy_uint64 x)
519{
520#ifdef HAVE___BUILTIN_BSWAP64
521 return __builtin_bswap64(x);
522#else
523 return ((x & 0xffULL) << 56) |
524 ((x & 0xff00ULL) << 40) |
525 ((x & 0xff0000ULL) << 24) |
526 ((x & 0xff000000ULL) << 8) |
527 ((x & 0xff00000000ULL) >> 8) |
528 ((x & 0xff0000000000ULL) >> 24) |
529 ((x & 0xff000000000000ULL) >> 40) |
530 ( x >> 56);
531#endif
532}
533
534static inline void
535npy_bswap8_unaligned(char * x)

Callers 2

_strided_byte_swapFunction · 0.85
unpack_bitsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected