mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-20 16:47:28 +01:00
Add slice uintptr_low_12_bits method
This commit is contained in:
1 parent
0834b40d22
commit
81ba41e251
6 files changed
+42
-20
No files matched your search
@@ -77,6 +77,12 @@ pri func ieee_hasher.up_arm_crc32!(x: slice base.u8),
|
||||
|
||||
s = 0xFFFF_FFFF ^ this.state
|
||||
|
||||
// Align to a 16-byte boundary.
|
||||
while (args.x.length() > 0) and ((15 & args.x.uintptr_low_12_bits()) <> 0) {
|
||||
s = IEEE_TABLE[0][((s & 0xFF) as base.u8) ^ args.x[0]] ^ (s >> 8)
|
||||
args.x = args.x[1 ..]
|
||||
} endwhile
|
||||
|
||||
// See "Multi-Byte Lookup Tables" in std/crc32/README.md for more detail on
|
||||
// the slicing-by-M algorithm. We use an M of 16.
|
||||
iterate (p = args.x)(length: 16, advance: 16, unroll: 2) {
|
||||
|
||||
Reference in new issue
Block a user