mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-22 08:47:28 +01:00
Unroll some std/png sse128 loops
wuffs_png_decode_filt_1_dist_3/clang9 1.57GB/s ± 0% 1.57GB/s ± 0% ~ (p=0.151 n=5+5) wuffs_png_decode_filt_1_dist_4/clang9 4.62GB/s ± 0% 5.87GB/s ± 1% +26.93% (p=0.008 n=5+5) wuffs_png_decode_filt_2_dist_3/clang9 13.3GB/s ± 0% 13.1GB/s ± 1% -1.52% (p=0.008 n=5+5) wuffs_png_decode_filt_2_dist_4/clang9 13.3GB/s ± 0% 13.1GB/s ± 1% -1.50% (p=0.008 n=5+5) wuffs_png_decode_filt_3_dist_3/clang9 910MB/s ± 0% 909MB/s ± 0% ~ (p=0.095 n=5+5) wuffs_png_decode_filt_3_dist_4/clang9 1.78GB/s ± 0% 1.84GB/s ± 0% +3.65% (p=0.008 n=5+5) wuffs_png_decode_filt_4_dist_3/clang9 542MB/s ± 0% 571MB/s ± 0% +5.31% (p=0.016 n=4+5) wuffs_png_decode_filt_4_dist_4/clang9 844MB/s ± 0% 819MB/s ± 0% -3.00% (p=0.008 n=5+5) wuffs_png_decode_image_40k_24bpp/clang9 127MB/s ± 0% 127MB/s ± 0% ~ (p=0.310 n=5+5) wuffs_png_decode_image_552k_32bpp_ignore_checksum/clang9 326MB/s ± 0% 322MB/s ± 0% -1.19% (p=0.008 n=5+5) wuffs_png_decode_image_552k_32bpp_verify_checksum/clang9 259MB/s ± 0% 256MB/s ± 0% -1.31% (p=0.008 n=5+5) wuffs_png_decode_image_4002k_24bpp/clang9 128MB/s ± 0% 128MB/s ± 0% ~ (p=0.278 n=5+5) wuffs_png_decode_filt_1_dist_3/gcc10 1.84GB/s ± 0% 1.84GB/s ± 0% ~ (p=0.190 n=4+5) wuffs_png_decode_filt_1_dist_4/gcc10 3.38GB/s ± 1% 5.41GB/s ± 1% +59.98% (p=0.008 n=5+5) wuffs_png_decode_filt_2_dist_3/gcc10 8.29GB/s ± 0% 8.30GB/s ± 0% ~ (p=0.222 n=5+5) wuffs_png_decode_filt_2_dist_4/gcc10 8.28GB/s ± 0% 8.30GB/s ± 0% +0.24% (p=0.008 n=5+5) wuffs_png_decode_filt_3_dist_3/gcc10 1.07GB/s ± 0% 1.08GB/s ± 0% ~ (p=0.421 n=5+5) wuffs_png_decode_filt_3_dist_4/gcc10 2.13GB/s ± 0% 2.36GB/s ± 0% +10.74% (p=0.008 n=5+5) wuffs_png_decode_filt_4_dist_3/gcc10 587MB/s ± 0% 616MB/s ± 0% +4.95% (p=0.016 n=4+5) wuffs_png_decode_filt_4_dist_4/gcc10 796MB/s ± 0% 871MB/s ± 0% +9.44% (p=0.008 n=5+5) wuffs_png_decode_image_40k_24bpp/gcc10 130MB/s ± 0% 131MB/s ± 0% +0.78% (p=0.008 n=5+5) wuffs_png_decode_image_552k_32bpp_ignore_checksum/gcc10 320MB/s ± 0% 325MB/s ± 0% +1.69% (p=0.008 n=5+5) wuffs_png_decode_image_552k_32bpp_verify_checksum/gcc10 270MB/s ± 0% 273MB/s ± 0% +1.30% (p=0.008 n=5+5) wuffs_png_decode_image_4002k_24bpp/gcc10 131MB/s ± 0% 131MB/s ± 0% +0.40% (p=0.008 n=5+5)
This commit is contained in:
1 parent
5d88f3cb37
commit
d09788938b
2 files changed
+152
-13
No files matched your search
@@ -26,7 +26,7 @@
|
||||
// var x128 : base.sse128_i
|
||||
// var a128 : base.sse128_i
|
||||
//
|
||||
// iterate (c = args.curr)(length: 4, advance: 3, unroll: 1) {
|
||||
// iterate (c = args.curr)(length: 4, advance: 3, unroll: 2) {
|
||||
// x128.load_u32!(a: c.peek_u32le())
|
||||
// x128 = x128._mm_add_epi8!(b: a128)
|
||||
// a128 = x128
|
||||
@@ -45,7 +45,7 @@ pri func decoder.filter_1_distance_4_sse128!(curr: slice base.u8),
|
||||
var x128 : base.sse128_i
|
||||
var a128 : base.sse128_i
|
||||
|
||||
iterate (c = args.curr)(length: 4, advance: 4, unroll: 1) {
|
||||
iterate (c = args.curr)(length: 4, advance: 4, unroll: 2) {
|
||||
x128.load_u32!(a: c.peek_u32le())
|
||||
x128 = x128._mm_add_epi8(b: a128)
|
||||
a128 = x128
|
||||
@@ -79,7 +79,7 @@ pri func decoder.filter_3_distance_4_sse128!(curr: slice base.u8, prev: slice ba
|
||||
|
||||
if args.prev.length() == 0 {
|
||||
k128 = k128.create_mm_set1_epi8(a: 0xFE)
|
||||
iterate (c = args.curr)(length: 4, advance: 4, unroll: 1) {
|
||||
iterate (c = args.curr)(length: 4, advance: 4, unroll: 2) {
|
||||
// The predictor, p128, is just half (rounded down) of the previous
|
||||
// pixel, a128. In this branch, b128 stays zero so the average of
|
||||
// a128 and b128 is just half of a128. _mm_avg_epu8 rounds up, but
|
||||
@@ -96,7 +96,7 @@ pri func decoder.filter_3_distance_4_sse128!(curr: slice base.u8, prev: slice ba
|
||||
|
||||
} else {
|
||||
k128 = k128.create_mm_set1_epi8(a: 0x01)
|
||||
iterate (c = args.curr, p = args.prev)(length: 4, advance: 4, unroll: 1) {
|
||||
iterate (c = args.curr, p = args.prev)(length: 4, advance: 4, unroll: 2) {
|
||||
// Load the pixel from the row above.
|
||||
b128.load_u32!(a: p.peek_u32le())
|
||||
|
||||
@@ -147,7 +147,7 @@ pri func decoder.filter_4_distance_3_sse128!(curr: slice base.u8, prev: slice ba
|
||||
var z128 : base.sse128_i
|
||||
|
||||
// § The advance is 3, not 4.
|
||||
iterate (c = args.curr, p = args.prev)(length: 4, advance: 3, unroll: 1) {
|
||||
iterate (c = args.curr, p = args.prev)(length: 4, advance: 3, unroll: 2) {
|
||||
b128.load_u32!(a: p.peek_u32le())
|
||||
b128 = b128._mm_unpacklo_epi8(b: z128)
|
||||
pa128 = b128._mm_sub_epi16(b: c128)
|
||||
@@ -217,7 +217,7 @@ pri func decoder.filter_4_distance_4_sse128!(curr: slice base.u8, prev: slice ba
|
||||
var smallest128 : base.sse128_i
|
||||
var z128 : base.sse128_i
|
||||
|
||||
iterate (c = args.curr, p = args.prev)(length: 4, advance: 4, unroll: 1) {
|
||||
iterate (c = args.curr, p = args.prev)(length: 4, advance: 4, unroll: 2) {
|
||||
// Load the pixel from the row above.
|
||||
b128.load_u32!(a: p.peek_u32le())
|
||||
|
||||
|
||||
Reference in new issue
Block a user