Commit Graph
56 Commits
Author SHA1 Message Date
Nigel Tao 6e9e2e00c2 std/vp8: accept VP8X (but ignore any ALPH chunk) 2026-07-20 21:24:35 +10:00
Nigel Tao f3de333642 cgen: revert simplify "x ~mod+ 0", "1 ~mod* y" etc
This reverts commit a4ec3f8e, which triggers -Werror=sign-conversion
errors on C code like this:

v_foobar += blah;

instead of the equivalent (as all variables here have u32 type):

v_foobar += ((uint32_t)(0u + blah));

This compiler warning (or compiler error, with -Werror) is arguably a
false postive but it's easier not to fight the C compiler.
2026-06-23 21:28:06 +10:00
Nigel Tao 1f3df26c7f lang/token: add IsXBinaryTildeModOp 2026-06-19 19:09:26 +10:00
Nigel Tao a4ec3f8e92 cgen: simplify "x ~mod+ 0", "1 ~mod* y" etc 2026-06-19 19:08:04 +10:00
Nigel Tao 327a714118 cgen: simplify "x + 0", "1 * y" and "z << 0" 2026-06-13 08:57:33 +10:00
Nigel Tao 0164364106 ast: add TypeExpr.IsSmallInteger method 2023-12-14 10:22:38 +11:00
Nigel Tao bf0492b59a cgen: cast to uint8_t/uint16_t more often
Updates #138
2023-12-13 14:17:58 +11:00
Nigel Tao 2c2bb9baa5 cgen: simplify 1-elem in-case-of-recursion arrays 2023-11-05 11:44:21 +11:00
Nigel Tao 9a68ec70c6 base: use wuffs_private_impl__etc names 2023-11-02 22:30:10 +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 bdba035779 cgen: ignore -Wcast-qual when making a roslice 2023-09-24 12:18:52 +10:00
Nigel Tao 4417dcea4e std/jpeg: use default Huffman tables if missing 2023-08-24 16:18:11 +10:00
Nigel Tao 724aec33df cgen: remove unnecessary parens for ptr-to-array 2023-06-13 22:39:21 +10:00
Nigel Tao 19f56ebfd2 lang: allow "slice_var as ptr array[etc] etc" 2023-06-13 22:38:25 +10:00
Nigel Tao 8ac22ceab2 cgen: allow "var x : nptr array[etc] etc" 2023-06-13 10:49:37 +10:00
Nigel Tao 4a2f570d56 cgen: simplify bulk_etc method's generated code 2023-06-05 13:28:16 +10:00
Nigel Tao 9c3ca6257d cgen: generate 123u (instead of 123) even more 2023-06-04 22:09:19 +10:00
Nigel Tao 50d765839c cgen: generate 123u (instead of 123) more often 2023-06-01 19:58:50 +10:00
Nigel Tao 02a6a13236 cgen: drop redundant "& mask" in "(x & mask) as T" 2023-05-22 16:03:24 +10:00
Nigel Tao 5ab65d0923 cgen: generate 123u instead of 123 (for std/jpeg)
Updates https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=59018
2023-05-16 22:19:43 +10:00
Nigel Tao f3caf09d77 lang: add read-only type decorators 2023-04-10 15:29:12 +10:00
Nigel Tao 84ef91dda8 Tweak cgen for an_array[i .. j] 2022-05-17 00:00:25 +10:00
Nigel Tao f1350825cc Fix cgen for an_array[i .. j] 2022-05-16 23:39:44 +10:00
Nigel Tao 07c053af6f Have reset! LEAVE_INTERNAL_BUFFERS_UNINITIALIZED 2021-11-16 13:16:43 +11: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 decb64e5ea Add ast.ExprOperatorEtc constants 2021-03-29 19:54:51 +11: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 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 b74dbc103d Have tilde-mod ops' cgen cast to integer type 2021-01-30 22:13:42 +11:00
Nigel Tao 14f194cdfc Remove built-in range reset methods 2021-01-24 22:16:57 +11:00
Nigel Tao 5941e7e5cc Rename sse128/sse128i to x86_sse42/x86_m128i 2021-01-24 21:58:00 +11:00
Nigel Tao 5d88f3cb37 Remove some wuffs_base__make_empty_struct calls 2021-01-22 23:01:27 +11:00
Nigel Tao afc6bb9ec3 Add base.sse128_i 2021-01-15 15:47:56 +11:00
Nigel Tao 0c481fe7c6 Improve cgen for constant-indexed slices of arrays 2020-12-02 22:39:34 +11:00
Nigel Tao ed48514f30 Remove ast.NewExpr statusPkg arg 2020-06-10 12:05:48 +10:00
Nigel Tao 74d291453d Un-special-case parsing base."etc" 2020-06-10 11:34:56 +10:00
Nigel Tao 4e2d0c1e5f Cgen explicit type cast for (CONSTANT >> x) 2020-06-10 10:32:13 +10:00
Nigel Tao 709e169955 Have cgen line-break some long expressions 2020-06-07 10:12:47 +10:00
Nigel Tao b2dc84105a Clean up more wuffs-c output (before clang-format) 2020-06-04 23:26:15 +10:00
Nigel Tao f73fc7721a Replace wuffs_base__make_status(x).repr with x 2020-06-02 23:25:47 +10:00
Nigel Tao dcb81a85bb Prepare to decode BMP embedding a JPEG or PNG 2020-05-27 13:37:54 +10:00
Nigel Tao 74871344f0 Capitalize Wuffs const names 2020-04-13 15:52:36 +10:00
Nigel Tao 9e50918718 Add single-quoted strings 2020-03-25 19:41:02 +11:00
Nigel Tao 737e31ff3a Add tokens 2020-02-11 12:02:58 +11:00
Nigel Tao 4fd9637e5a Emit stricter vtable function-pointer type 2020-01-10 14:34:53 +11:00
Nigel Tao e6db7f6a40 Make wuffs_base__status a struct 2020-01-05 10:48:20 +11:00