mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-21 16:47:28 +01:00
Add base.arm_crc32_u32 type
On a Raspberry Pi 4 (32-bit armv7l) with -march=native and -mfpu=neon
("native" means "armv8-a+crc+simd"):
wuffs_crc32_ieee_10k/clang9 825MB/s ± 0% 6802MB/s ± 0% +724.00% (p=0.008 n=5+5)
wuffs_crc32_ieee_100k/clang9 837MB/s ± 0% 6199MB/s ± 0% +640.25% (p=0.008 n=5+5)
wuffs_crc32_ieee_10k/gcc8 960MB/s ± 0% 4495MB/s ± 0% +368.35% (p=0.016 n=4+5)
wuffs_crc32_ieee_100k/gcc8 961MB/s ± 0% 4447MB/s ± 0% +363.01% (p=0.016 n=5+4)
mimic_crc32_ieee_10k 638MB/s ± 0% 631MB/s ± 0% -1.17% (p=0.008 n=5+5)
mimic_crc32_ieee_100k 639MB/s ± 0% 639MB/s ± 0% +0.02% (p=0.008 n=5+5)
wuffs_gzip_decode_10k/clang9 83.0MB/s ± 0% 90.7MB/s ± 0% +9.26% (p=0.008 n=5+5)
wuffs_gzip_decode_100k/clang9 100MB/s ± 0% 112MB/s ± 0% +11.91% (p=0.008 n=5+5)
wuffs_gzip_decode_10k/gcc8 86.1MB/s ± 0% 91.9MB/s ± 0% +6.72% (p=0.008 n=5+5)
wuffs_gzip_decode_100k/gcc8 102MB/s ± 0% 112MB/s ± 0% +9.34% (p=0.008 n=5+5)
mimic_gzip_decode_10k 98.8MB/s ± 0% 98.2MB/s ± 0% -0.60% (p=0.008 n=5+5)
mimic_gzip_decode_100k 128MB/s ± 0% 128MB/s ± 0% -0.08% (p=0.008 n=5+5)
wuffs_png_decode_image_19k_8bpp/clang9 67.6MB/s ± 0% 70.8MB/s ± 0% +4.72% (p=0.008 n=5+5)
wuffs_png_decode_image_40k_24bpp/clang9 92.8MB/s ± 0% 98.8MB/s ± 0% +6.49% (p=0.008 n=5+5)
wuffs_png_decode_image_77k_8bpp/clang9 255MB/s ± 0% 269MB/s ± 0% +5.44% (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_ignore_checksum/clang9 123MB/s ± 0% 123MB/s ± 0% +0.13% (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_verify_checksum/clang9 110MB/s ± 0% 112MB/s ± 0% +1.46% (p=0.008 n=5+5)
wuffs_png_decode_image_4002k_24bpp/clang9 88.4MB/s ± 0% 92.8MB/s ± 0% +4.90% (p=0.008 n=5+5)
wuffs_png_decode_image_19k_8bpp/gcc8 67.2MB/s ± 0% 70.8MB/s ± 0% +5.37% (p=0.008 n=5+5)
wuffs_png_decode_image_40k_24bpp/gcc8 94.0MB/s ± 0% 98.2MB/s ± 0% +4.45% (p=0.008 n=5+5)
wuffs_png_decode_image_77k_8bpp/gcc8 236MB/s ± 0% 248MB/s ± 0% +4.84% (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_ignore_checksum/gcc8 114MB/s ± 0% 115MB/s ± 0% +1.11% (p=0.008 n=5+5)
wuffs_png_decode_image_552k_32bpp_verify_checksum/gcc8 102MB/s ± 0% 104MB/s ± 0% +2.17% (p=0.008 n=5+5)
wuffs_png_decode_image_4002k_24bpp/gcc8 88.8MB/s ± 0% 94.3MB/s ± 0% +6.21% (p=0.008 n=5+5)
mimic_png_decode_image_19k_8bpp 43.7MB/s ± 1% 43.4MB/s ± 1% ~ (p=0.095 n=5+5)
mimic_png_decode_image_40k_24bpp 54.6MB/s ± 0% 53.9MB/s ± 0% -1.25% (p=0.008 n=5+5)
mimic_png_decode_image_77k_8bpp 125MB/s ± 0% 124MB/s ± 0% -0.73% (p=0.008 n=5+5)
mimic_png_decode_image_552k_32bpp_ignore_checksum skipped
mimic_png_decode_image_552k_32bpp_verify_checksum 102MB/s ± 0% 101MB/s ± 0% -0.95% (p=0.008 n=5+5)
mimic_png_decode_image_4002k_24bpp 81.3MB/s ± 0% 81.0MB/s ± 0% -0.46% (p=0.016 n=4+5)
This commit is contained in:
1 parent
81ba41e251
commit
84f3592dbe
10 files changed
+94
-106
No files matched your search
@@ -75,7 +75,8 @@ var (
|
||||
|
||||
typeExprDecodeFrameOptions = a.NewTypeExpr(0, t.IDBase, t.IDDecodeFrameOptions, nil, nil, nil)
|
||||
|
||||
typeExprX86M128I = a.NewTypeExpr(0, t.IDBase, t.IDX86M128I, nil, nil, nil)
|
||||
typeExprARMCRC32U32 = a.NewTypeExpr(0, t.IDBase, t.IDARMCRC32U32, nil, nil, nil)
|
||||
typeExprX86M128I = a.NewTypeExpr(0, t.IDBase, t.IDX86M128I, nil, nil, nil)
|
||||
|
||||
typeExprSliceU8 = a.NewTypeExpr(t.IDSlice, 0, 0, nil, nil, typeExprU8)
|
||||
typeExprTableU8 = a.NewTypeExpr(t.IDTable, 0, 0, nil, nil, typeExprU8)
|
||||
@@ -125,7 +126,8 @@ var builtInTypeMap = typeMap{
|
||||
|
||||
t.IDDecodeFrameOptions: typeExprDecodeFrameOptions,
|
||||
|
||||
t.IDX86M128I: typeExprX86M128I,
|
||||
t.IDARMCRC32U32: typeExprARMCRC32U32,
|
||||
t.IDX86M128I: typeExprX86M128I,
|
||||
}
|
||||
|
||||
func (c *Checker) parseBuiltInFuncs(m map[t.QQID]*a.Func, ss []string) error {
|
||||
|
||||
+9
-1
@@ -25,7 +25,9 @@ import (
|
||||
type cpuArchBits uint32
|
||||
|
||||
const (
|
||||
cpuArchBitsX86SSE42 = cpuArchBits(0x00000001)
|
||||
cpuArchBitsARMCRC32 = cpuArchBits(0x00000001)
|
||||
cpuArchBitsARMNeon = cpuArchBits(0x00000002)
|
||||
cpuArchBitsX86SSE42 = cpuArchBits(0x00000004)
|
||||
)
|
||||
|
||||
func calcCPUArchBits(n *a.Func) (ret cpuArchBits) {
|
||||
@@ -35,6 +37,10 @@ func calcCPUArchBits(n *a.Func) (ret cpuArchBits) {
|
||||
continue
|
||||
}
|
||||
switch o.Condition().RHS().AsExpr().Ident() {
|
||||
case t.IDARMCRC32:
|
||||
ret |= cpuArchBitsARMCRC32
|
||||
case t.IDARMNeon:
|
||||
ret |= cpuArchBitsARMNeon
|
||||
case t.IDX86SSE42:
|
||||
ret |= cpuArchBitsX86SSE42
|
||||
}
|
||||
@@ -46,6 +52,8 @@ func (q *checker) tcheckCPUArchBits(cab cpuArchBits, typ *a.TypeExpr) error {
|
||||
if qid := typ.Innermost().QID(); qid[0] == t.IDBase {
|
||||
need := cpuArchBits(0)
|
||||
switch qid[1] {
|
||||
case t.IDARMCRC32U32:
|
||||
need = cpuArchBitsARMCRC32
|
||||
case t.IDX86M128I:
|
||||
need = cpuArchBitsX86SSE42
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user