From bf9ec8102f78562ebf47400522c375b0c9235206 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Fri, 26 Jan 2007 02:53:30 +0000 Subject: [PATCH] Add 64-bit rotates --- src/include/gpxe/bitops.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/include/gpxe/bitops.h b/src/include/gpxe/bitops.h index 9e2fc7cb..f95af7d3 100644 --- a/src/include/gpxe/bitops.h +++ b/src/include/gpxe/bitops.h @@ -16,4 +16,12 @@ static inline uint32_t ror32 ( uint32_t data, unsigned int rotation ) { return ( ( data >> rotation ) | ( data << ( 32 - rotation ) ) ); } +static inline uint64_t rol64 ( uint64_t data, unsigned int rotation ) { + return ( ( data << rotation ) | ( data >> ( 64 - rotation ) ) ); +} + +static inline uint64_t ror64 ( uint64_t data, unsigned int rotation ) { + return ( ( data >> rotation ) | ( data << ( 64 - rotation ) ) ); +} + #endif /* _GPXE_BITOPS_H */