Initial Commit

This commit is contained in:
2021-12-29 15:09:00 -06:00
commit 5b3b81e4dc
12 changed files with 564 additions and 0 deletions

7
src/util.zig Normal file
View File

@@ -0,0 +1,7 @@
const std = @import("std");
pub fn u32_sign_extend(value: u32, bitSize: anytype) u32 {
const amount: u5 = 32 - bitSize;
return @bitCast(u32, @bitCast(i32, value << amount) >> amount);
}