mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-23 00:47:56 +01:00
Add std/png decoder.filter_4_distance_?_arm_neon
On a Raspberry Pi 4 (32-bit armv7l) with -march=native and -mfpu=neon
("native" means "armv8-a+crc+simd"):
wuffs_png_decode_filt_4_dist_3/clang9 180MB/s ± 0% 217MB/s ± 0% +20.57% (p=0.008 n=5+5)
wuffs_png_decode_filt_4_dist_4/clang9 161MB/s ± 0% 287MB/s ± 0% +78.75% (p=0.008 n=5+5)
wuffs_png_decode_image_40k_24bpp/clang9 99.1MB/s ± 0% 99.4MB/s ± 0% +0.27% (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_ignore_checksum/clang9 123MB/s ± 0% 165MB/s ± 0% +33.61% (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_verify_checksum/clang9 112MB/s ± 0% 146MB/s ± 0% +29.64% (p=0.008 n=5+5)
wuffs_png_decode_image_4002k_24bpp/clang9 93.1MB/s ± 0% 93.2MB/s ± 0% +0.15% (p=0.040 n=5+5)
wuffs_png_decode_filt_4_dist_3/gcc8 80.5MB/s ± 0% 211.7MB/s ± 0% +163.12% (p=0.008 n=5+5)
wuffs_png_decode_filt_4_dist_4/gcc8 77.3MB/s ± 0% 280.4MB/s ± 0% +262.98% (p=0.008 n=5+5)
wuffs_png_decode_image_40k_24bpp/gcc8 98.1MB/s ± 0% 100.8MB/s ± 0% +2.78% (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_ignore_checksum/gcc8 114MB/s ± 0% 162MB/s ± 0% +41.95% (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_verify_checksum/gcc8 103MB/s ± 0% 140MB/s ± 0% +36.07% (p=0.008 n=5+5)
wuffs_png_decode_image_4002k_24bpp/gcc8 93.2MB/s ± 0% 94.1MB/s ± 0% +0.96% (p=0.008 n=5+5)
This commit is contained in:
1 parent
41825fcaae
commit
d13039d96e
5 files changed
+428
-3
No files matched your search
@@ -529,19 +529,37 @@ func (g *gen) writeBuiltinCPUArch(b *buffer, recv *a.Expr, method t.ID, args []*
|
||||
methodStr := method.Str(g.tm)
|
||||
vreinterpretU8Uxx, vreinterpretUxxU8, vreinterpretClose := "", "", ""
|
||||
if armNeon {
|
||||
vreinterpretClose = ")"
|
||||
switch {
|
||||
case methodStr == "vmovn_u16":
|
||||
vreinterpretU8Uxx = "("
|
||||
vreinterpretUxxU8 = "vreinterpretq_u16_u8("
|
||||
case methodStr == "vmovn_u32":
|
||||
vreinterpretU8Uxx = "vreinterpret_u8_u16("
|
||||
vreinterpretUxxU8 = "vreinterpretq_u32_u8("
|
||||
case methodStr == "vmovn_u64":
|
||||
vreinterpretU8Uxx = "vreinterpret_u8_u32("
|
||||
vreinterpretUxxU8 = "vreinterpretq_u64_u8("
|
||||
case strings.HasSuffix(methodStr, "q_u16"):
|
||||
vreinterpretU8Uxx = "vreinterpretq_u8_u16("
|
||||
vreinterpretUxxU8 = "vreinterpretq_u16_u8("
|
||||
case strings.HasSuffix(methodStr, "q_u32"):
|
||||
vreinterpretU8Uxx = "vreinterpretq_u8_u32("
|
||||
vreinterpretUxxU8 = "vreinterpretq_u32_u8("
|
||||
case strings.HasSuffix(methodStr, "q_u64"):
|
||||
vreinterpretU8Uxx = "vreinterpretq_u8_u64("
|
||||
vreinterpretUxxU8 = "vreinterpretq_u64_u8("
|
||||
case strings.HasSuffix(methodStr, "_u16"):
|
||||
vreinterpretU8Uxx = "vreinterpret_u8_u16("
|
||||
vreinterpretUxxU8 = "vreinterpret_u16_u8("
|
||||
vreinterpretClose = ")"
|
||||
case strings.HasSuffix(methodStr, "_u32"):
|
||||
vreinterpretU8Uxx = "vreinterpret_u8_u32("
|
||||
vreinterpretUxxU8 = "vreinterpret_u32_u8("
|
||||
vreinterpretClose = ")"
|
||||
case strings.HasSuffix(methodStr, "_u64"):
|
||||
vreinterpretU8Uxx = "vreinterpret_u8_u64("
|
||||
vreinterpretUxxU8 = "vreinterpret_u64_u8("
|
||||
vreinterpretClose = ")"
|
||||
default:
|
||||
vreinterpretClose = ""
|
||||
}
|
||||
}
|
||||
|
||||
@@ -587,8 +605,24 @@ func (g *gen) writeBuiltinCPUArch(b *buffer, recv *a.Expr, method t.ID, args []*
|
||||
b.writes(vreinterpretClose)
|
||||
|
||||
} else {
|
||||
postArgsAfter := ""
|
||||
if armCRC32U32 {
|
||||
b.writeb('_')
|
||||
} else if armNeon {
|
||||
// TODO: generate this table automatically?
|
||||
postArgsAfter = ")"
|
||||
switch methodStr {
|
||||
case "vabdl_u16", "vaddl_u16",
|
||||
"vabdq_u32", "vcleq_u32":
|
||||
b.writes("vreinterpretq_u8_u32(")
|
||||
case "vabdl_u32", "vaddl_u32":
|
||||
b.writes("vreinterpretq_u8_u64(")
|
||||
case "vabdl_u8", "vaddl_u8",
|
||||
"vabdq_u16", "vcleq_u16":
|
||||
b.writes("vreinterpretq_u8_u16(")
|
||||
default:
|
||||
postArgsAfter = ""
|
||||
}
|
||||
}
|
||||
b.printf("%s(", methodStr)
|
||||
|
||||
@@ -622,6 +656,7 @@ func (g *gen) writeBuiltinCPUArch(b *buffer, recv *a.Expr, method t.ID, args []*
|
||||
}
|
||||
b.writes(after)
|
||||
}
|
||||
b.writes(postArgsAfter)
|
||||
}
|
||||
|
||||
b.writes(")")
|
||||
|
||||
Reference in new issue
Block a user