瀏覽代碼

Add 64-bit rotates

tags/v0.9.3
Michael Brown 17 年之前
父節點
當前提交
bf9ec8102f
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8
    0
      src/include/gpxe/bitops.h

+ 8
- 0
src/include/gpxe/bitops.h 查看文件

@@ -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…
取消
儲存