Browse Source

Add 64-bit rotates

tags/v0.9.3
Michael Brown 17 years ago
parent
commit
bf9ec8102f
1 changed files with 8 additions and 0 deletions
  1. 8
    0
      src/include/gpxe/bitops.h

+ 8
- 0
src/include/gpxe/bitops.h View File

@@ -16,4 +16,12 @@ static inline uint32_t ror32 ( uint32_t data, unsigned int rotation ) {
16 16
         return ( ( data >> rotation ) | ( data << ( 32 - rotation ) ) );
17 17
 }
18 18
 
19
+static inline uint64_t rol64 ( uint64_t data, unsigned int rotation ) {
20
+        return ( ( data << rotation ) | ( data >> ( 64 - rotation ) ) );
21
+}
22
+
23
+static inline uint64_t ror64 ( uint64_t data, unsigned int rotation ) {
24
+        return ( ( data >> rotation ) | ( data << ( 64 - rotation ) ) );
25
+}
26
+
19 27
 #endif /* _GPXE_BITOPS_H */

Loading…
Cancel
Save