UTF-8 validation in x86-64: a scalar reference and an AVX2 version that checks 32 bytes per step. Every build fuzzes one against the other.
2# both ABIs, checks them against table 3-7 and each other, then times them.
4[project]
5isa = "x86-64"
6assembler = "nasm"
9[[step]]
10name = "assemble for System V"
11run = ["nasm", "-f", "elf64", "-o", "build/utf8_scalar.o", "src/utf8_scalar.asm"]
13[[step]]
14name = "assemble AVX2 for System V"
15run = ["nasm", "-f", "elf64", "-o", "build/utf8_avx2.o", "src/utf8_avx2.asm"]
17[[step]]
18name = "assemble the scalar reference"
19run = ["nasm", "-f", "win64", "-o", "build/utf8_scalar.obj", "src/utf8_scalar.asm"]
22name = "assemble AVX2"
23run = ["nasm", "-f", "win64", "-o", "build/utf8_avx2.obj", "src/utf8_avx2.asm"]
26name = "build the tests"
AVX2: three nibble tables and a saturating subtractAug 4
27run = ["gcc", "-O2", "-Wall", "-o", "build/test.exe", "test/test.c", "build/utf8_scalar.obj", "build/utf8_avx2.obj"]
29[[step]]
Fuzz the AVX2 version against the scalar oneAug 5
30name = "table 3-7, then 1,000,000 fuzzed inputs"
33expect = "0 mismatches"
36name = "build the benchmark"
AVX2: three nibble tables and a saturating subtractAug 4
37run = ["gcc", "-O2", "-Wall", "-o", "build/bench.exe", "bench/bench.c", "build/utf8_scalar.obj", "build/utf8_avx2.obj"]
39[[step]]
42run = ["./build/bench.exe"]
43expect = "MiB of mixed text"
System V buildSep 30
47paths = ["build/utf8_scalar.obj", "build/utf8_avx2.o", "build/utf8_scalar.o"]