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.
1# Verified builds for utf8-check. Every commit assembles both validators for
2# both ABIs, checks them against table 3-7 and each other, then times them.
4[project]
5isa = "x86-64"
6assembler = "nasm"
7target = "Windows x64 and System V objects, AVX2"
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"]
21[[step]]
22name = "assemble AVX2"
23run = ["nasm", "-f", "win64", "-o", "build/utf8_avx2.obj", "src/utf8_avx2.asm"]
25[[step]]
26name = "build the tests"
27run = ["gcc", "-O2", "-Wall", "-o", "build/test.exe", "test/test.c", "build/utf8_scalar.obj", "build/utf8_avx2.obj"]
29[[step]]
30name = "table 3-7, then 1,000,000 fuzzed inputs"
31on = "windows"
32run = ["./build/test.exe", "1000000"]
33expect = "0 mismatches"
35[[step]]
36name = "build the benchmark"
37run = ["gcc", "-O2", "-Wall", "-o", "build/bench.exe", "bench/bench.c", "build/utf8_scalar.obj", "build/utf8_avx2.obj"]
39[[step]]
40name = "time both on 64 MiB"
41on = "windows"
42run = ["./build/bench.exe"]
43expect = "MiB of mixed text"
45[artifact]
46path = "build/utf8_avx2.obj"
47paths = ["build/utf8_scalar.obj", "build/utf8_avx2.o", "build/utf8_scalar.o"]