Commit Graph
76 Commits
Author SHA1 Message Date
Nigel Tao 82ea1985b4 base: add optional_u63 type 2023-11-19 12:02:24 +11:00
Nigel Tao e0636e3255 base: add bitvec256 type 2023-10-12 21:26:53 +11:00
Patrick Georgi f563f32f82 Add SPDX identifier to license headers
SPDX is an ISO standard for describing licenses in a computer readable
format, which is useful when applying license compliance tools and the
like to source code.

In addition to ensuring that the Wuffs C distribution is properly
annotated to the benefit of projects using Wuffs and SPDX-supporting
tools, add it everywhere else where there's a license in this repo for
consistency, too.
2023-10-06 20:52:36 +02:00
Nigel Tao 74a6ea2fcd all: relicense from Apache2 to dual Apache2/MIT
The LICENSE has changed from a single license (Apache2) to a dual
license (Apache2 or MIT, at your option).

If you've previously used Wuffs under the Apache2 license, you are able
to keep doing so. No further action required by you.

The two files listed below (previous releases) are exceptions, as they
are older snapshots, frozen in time. Their license has not changed:
release/c/wuffs-v0.2.c
release/c/wuffs-v0.3.c

Every name in the AUTHORS file, other than Google Inc., has signed
Google's CLA (Contributor License Agreement).
2023-10-06 10:00:59 +11:00
Nigel Tao 35fd84bea0 lang: allow copy_from_slice arg to be read-only 2023-04-12 13:18:43 +10:00
Nigel Tao 29c4122360 lang: have hasher_u32.update_u32 take a roslice 2023-04-10 21:16:53 +10:00
Nigel Tao f3caf09d77 lang: add read-only type decorators 2023-04-10 15:29:12 +10:00
Nigel Tao baec831fc8 Add std/adler32 hasher.up_x86_avx2
While the std/adler32 benchmarks got better, the std/zlib and std/png
benchmarks got worse.

This commit will soon be followed by a rollback, but it is committed
anyway so that we can refer to these numbers in the git log.

Binary size, before:
4056 gen/lib/c/clang-9-dynamic/wuffs-std-adler32.lo
4104 gen/lib/c/clang-9-static/wuffs-std-adler32.o
4624 gen/lib/c/gcc-dynamic/wuffs-std-adler32.lo
4680 gen/lib/c/gcc-static/wuffs-std-adler32.o

After:
4952 gen/lib/c/clang-9-dynamic/wuffs-std-adler32.lo
5016 gen/lib/c/clang-9-static/wuffs-std-adler32.o
5512 gen/lib/c/gcc-dynamic/wuffs-std-adler32.lo
5576 gen/lib/c/gcc-static/wuffs-std-adler32.o

name                                                      old speed      new speed      delta

wuffs_adler32_10k/clang9                                  11.5GB/s ± 1%  15.0GB/s ± 5%  +30.73%  (p=0.000 n=9+10)
wuffs_adler32_100k/clang9                                 13.5GB/s ± 1%  15.6GB/s ±14%  +16.06%  (p=0.001 n=9+10)

wuffs_adler32_10k/gcc10                                   11.3GB/s ± 2%  15.6GB/s ± 1%  +38.27%  (p=0.000 n=9+9)
wuffs_adler32_100k/gcc10                                  11.3GB/s ± 1%  19.4GB/s ± 1%  +71.20%  (p=0.000 n=7+9)

wuffs_zlib_decode_10k/clang9                               223MB/s ± 1%   216MB/s ± 2%   -3.45%  (p=0.000 n=10+10)
wuffs_zlib_decode_100k/clang9                              285MB/s ± 1%   284MB/s ± 1%     ~     (p=0.243 n=9+10)

wuffs_zlib_decode_10k/gcc10                                232MB/s ± 1%   216MB/s ± 1%   -6.70%  (p=0.000 n=10+9)
wuffs_zlib_decode_100k/gcc10                               291MB/s ± 1%   280MB/s ± 1%   -3.70%  (p=0.000 n=9+8)

wuffs_png_decode_image_19k_8bpp/clang9                     152MB/s ± 1%   143MB/s ± 3%   -5.89%  (p=0.000 n=8+9)
wuffs_png_decode_image_40k_24bpp/clang9                    171MB/s ± 1%   173MB/s ± 1%     ~     (p=0.094 n=9+9)
wuffs_png_decode_image_77k_8bpp/clang9                     541MB/s ± 1%   509MB/s ± 1%   -5.77%  (p=0.000 n=8+9)
wuffs_png_decode_image_552k_32bpp_ignore_checksum/clang9   479MB/s ± 1%   464MB/s ± 3%   -3.20%  (p=0.000 n=8+10)
wuffs_png_decode_image_552k_32bpp_verify_checksum/clang9   461MB/s ± 1%   452MB/s ± 1%   -2.02%  (p=0.000 n=8+10)
wuffs_png_decode_image_4002k_24bpp/clang9                  177MB/s ± 1%   175MB/s ± 2%   -1.14%  (p=0.004 n=10+10)

wuffs_png_decode_image_19k_8bpp/gcc10                      159MB/s ± 1%   153MB/s ± 1%   -3.54%  (p=0.000 n=8+10)
wuffs_png_decode_image_40k_24bpp/gcc10                     188MB/s ± 1%   187MB/s ± 1%   -0.47%  (p=0.021 n=10+9)
wuffs_png_decode_image_77k_8bpp/gcc10                      557MB/s ± 0%   546MB/s ± 4%   -1.94%  (p=0.000 n=8+10)
wuffs_png_decode_image_552k_32bpp_ignore_checksum/gcc10    510MB/s ± 0%   493MB/s ± 0%   -3.33%  (p=0.000 n=10+9)
wuffs_png_decode_image_552k_32bpp_verify_checksum/gcc10    486MB/s ± 1%   478MB/s ± 0%   -1.77%  (p=0.000 n=8+9)
wuffs_png_decode_image_4002k_24bpp/gcc10                   189MB/s ± 1%   187MB/s ± 1%   -1.26%  (p=0.000 n=10+10)
2021-04-28 00:18:20 +10:00
Nigel Tao fb4d0da844 Delete deprecated arm_neon_64, arm_neon_128 2021-02-24 22:34:04 +11:00
Nigel Tao 62ee403d06 Add arm_neon u8x8, u16x4, etc types 2021-02-24 14:28:45 +11:00
Nigel Tao 492068f3dc Prepare to add cpu_arch_utility types 2021-02-18 16:16:48 +11:00
Nigel Tao fd071dfc90 Ban cpu_arch types from fields and func args/rets 2021-02-18 14:13:53 +11:00
Nigel Tao 435330494e Add std/png decoder.filter_1_distance_4_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_1_dist_4/clang9                     1.09GB/s ± 1%  1.42GB/s ± 0%  +30.50%  (p=0.008 n=5+5)
wuffs_png_decode_filt_1_dist_4/gcc8                        859MB/s ± 0%   891MB/s ± 0%   +3.66%  (p=0.008 n=5+5)
2021-02-14 21:43:56 +11:00
Nigel Tao 84f3592dbe 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)
2021-02-13 22:54:47 +11:00
Nigel Tao 5941e7e5cc Rename sse128/sse128i to x86_sse42/x86_m128i 2021-01-24 21:58:00 +11:00
Nigel Tao 26a7280900 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)
2021-01-17 23:47:37 +11:00
Nigel Tao afc6bb9ec3 Add base.sse128_i 2021-01-15 15:47:56 +11:00
Nigel Tao beaf3ef11f Add choose
wuffs_png_decode_filter_1_sub/clang9       905MB/s ± 0%  1339MB/s ± 0%  +48.05%  (p=0.008 n=5+5)
wuffs_png_decode_filter_1_sub/gcc10       1.12GB/s ± 0%  1.85GB/s ± 0%  +64.80%  (p=0.016 n=5+4)
2021-01-06 23:16:16 +11:00
Nigel Tao ed48514f30 Remove ast.NewExpr statusPkg arg 2020-06-10 12:05:48 +10:00
Nigel Tao 7e32336de0 Add base.PIXEL_FORMAT__ETC constants 2020-06-09 12:34:34 +10:00
Nigel Tao ad1cff3921 Add tell_me_more? mechanism 2020-05-12 11:12:39 +10:00
Nigel Tao 737e31ff3a Add tokens 2020-02-11 12:02:58 +11:00
Nigel Tao 1a791217de Add wuffs_base__pixel_blend type 2020-01-14 09:27:04 +11:00
Nigel Tao a6ee0ee391 Remove builtin.ParseFuncs "generic" argument 2020-01-11 10:37:37 +11:00
Nigel Tao ea54c2ea11 Add syntax support for implementing interfaces 2020-01-09 15:45:29 +11:00
Nigel Tao 9e033579c8 Add interface method signatures 2020-01-06 21:59:30 +11:00
Nigel Tao 4f53f3101f Make wuffs_base__pixel_format a struct 2020-01-05 14:18:48 +11:00
Nigel Tao 4537246cf8 Remove redundant "go generate" line 2019-08-08 10:28:37 +10:00
Nigel Tao 8794a586ac Add wuffs_foo__bar__initialize methods 2019-02-09 12:54:02 +11:00
Nigel Tao 489fec4437 Remove parse's Options.AllowBuiltIns 2018-12-28 15:50:18 +11:00
Nigel Tao 20e82ba97b Use interval.IntRange instead of ast.Bounds 2018-12-26 14:02:34 +11:00
Nigel Tao 6c9dca47ee Add a base.pixel_swizzler type 2018-12-08 13:25:53 +11:00
Nigel Tao 555a72d7a9 Add a decode_frame_options type 2018-09-02 15:08:00 +10:00
Nigel Tao c1af1e2c82 Rename $(etc) to [etc] 2018-08-18 10:11:43 +10:00
Nigel Tao ca06083f8a Rename the implicit in variable to args 2018-07-29 10:26:22 +10:00
Nigel Tao 58ded30954 Remove the implicit out variable 2018-07-29 10:10:58 +10:00
Nigel Tao 9919d78245 Change func out-type from struct to bare type 2018-07-29 10:02:06 +10:00
Nigel Tao 1c75f7b748 Redo {frame,image,pixel}_config and pixel_buffer 2018-07-21 09:15:33 +10:00
Nigel Tao 29eb64a0a4 Add a nptr T type 2018-07-15 17:10:03 +10:00
Nigel Tao 15f2f42b77 Add a nullptr literal 2018-07-15 16:41:23 +10:00
Nigel Tao 731ca8841b Add a TypeExpr type expression 2018-07-07 21:57:15 +10:00
Nigel Tao 6ede44e474 Set placeholder MBounds, not just MType 2018-07-07 19:28:51 +10:00
Nigel Tao ccb78f5db7 Rename ast.Node methods from Foo to AsFoo 2018-07-01 20:41:21 +10:00
Nigel Tao 52feb10ad3 Add a utility.make_rect_ie_u32 method 2018-06-11 08:28:29 +10:00
Nigel Tao 92a8bc4641 Add a base.utility type 2018-06-11 08:05:12 +10:00
Nigel Tao 40c5328d94 Remove redundant builtInFuncs field 2018-06-03 11:03:07 +10:00
Nigel Tao 4a1b349cb8 Add a base.rect_ie_u32 type 2018-05-18 20:22:56 +10:00
Nigel Tao 6e06d1f9f1 Rename IDDiamond to IDDagger1 and IDDagger2 2018-05-18 13:15:39 +10:00
Nigel Tao e4320c3c6d Add built-in table T methods 2018-05-18 12:50:53 +10:00
Nigel Tao eda326726a Allow table base.u8 as a type 2018-05-18 10:31:24 +10:00