Skip to content

Commit 86a7f40

Browse files
committed
os: fix swap_bytes_u64
1 parent 42538e1 commit 86a7f40

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

vlib/os/file_le_be.c.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ fn swap_bytes_u32(x u32) u32 {
8484

8585
@[inline]
8686
fn swap_bytes_u64(x u64) u64 {
87-
return ((x >> 40) & 0x00000000_0000FF00) | ((x >> 24) & 0x00000000_00FF0000) | ((x >> 8) & 0x00000000_FF000000) | ((x << 8) & 0x000000FF_00000000) | ((x << 24) & 0x0000FF00_00000000) | ((x << 40) & 0x00FF0000_00000000) | ((x << 56) & 0xFF000000_00000000)
87+
return ((x >> 56) & 0x00000000_000000FF) | ((x >> 40) & 0x00000000_0000FF00) | ((x >> 24) & 0x00000000_00FF0000) | ((x >> 8) & 0x00000000_FF000000) | ((x << 8) & 0x000000FF_00000000) | ((x << 24) & 0x0000FF00_00000000) | ((x << 40) & 0x00FF0000_00000000) | ((x << 56) & 0xFF000000_00000000)
8888
}
8989

9090
fn swap_bytes[T](input T) T {

0 commit comments

Comments
 (0)