Add slice base.u8 peek/poke methods

wuffs_png_decode_filter_1_sub/clang9  4.59GB/s ± 0%   4.59GB/s ± 0%      ~     (p=0.151 n=5+5)
wuffs_png_decode_filter_1_sub/gcc10   1.85GB/s ± 0%   4.11GB/s ± 0%  +122.24%  (p=0.016 n=5+4)
This commit is contained in:
Nigel Tao committed 2021-01-17 23:47:37 +11:00
1 parent 602b711ba6
commit 26a7280900
13 files changed
+204 -48

No files matched your search

+2 -8
View File
@@ -25,19 +25,13 @@ pri func decoder.filter_1_distance_4_sse128!(curr: slice base.u8),
var a128 : base.sse128_i
iterate (c = args.curr)(length: 4, advance: 4, unroll: 1) {
x32 = ((c[0] as base.u32) << 0x00) |
((c[1] as base.u32) << 0x08) |
((c[2] as base.u32) << 0x10) |
((c[3] as base.u32) << 0x18)
x32 = c.peek_u32le()
x128.load_u32!(a: x32)
x128 = x128._mm_add_epi8!(b: a128)
a128 = x128
x32 = x128.truncate_u32()
c[0] = (0xFF & (x32 >> 0x00)) as base.u8
c[1] = (0xFF & (x32 >> 0x08)) as base.u8
c[2] = (0xFF & (x32 >> 0x10)) as base.u8
c[3] = (0xFF & (x32 >> 0x18)) as base.u8
c.poke_u32le!(a: x32)
}
}