Zig utilities for low-level bit manipulation
- Zig 100%
| .github/workflows | zig 0.16 | |
| .gitattributes | extracted from vera repo | |
| .gitignore | housekeeping | |
| bits.zig | Don't allow changing signedness without expanding in sx/zx/1x | |
| build.zig | zig 0.15.1 | |
| build.zig.zon | Don't allow changing signedness without expanding in sx/zx/1x | |
| license | housekeeping | |
| readme.md | extracted from vera repo | |
Zig-BitHelper
Provides some helper functions for dealing with integers as bit fields:
- bits.as: Similar to @bitCast, but works with enums as well
- bits.zx: Casts as unsigned and zero-extends to the requested size
- bits._1x: Casts as unsigned and one-extends to the requested size
- bits.sx: Casts as signed and then extends to the requested size
- bits.concat: Concatenates unsigned integers (little endian)
- bits.swapHalves: Swaps the high and low halves of an integer with event bit count