mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-28 06:53:42 +08:00
Release builds compile for the x86-64 baseline, so LLVM vectorizes with SSE2 only. `--target-cpu=<baseline|x86-64-v2|x86-64-v3|x86-64-v4|native>` compiles the program's code for a higher level: every emitted function carries the level as its `target-cpu`, so LLVM can use AVX2, BMI2, FMA or AVX-512. The executable then runs only on CPUs of that level. - `native` resolves to the highest level the build machine supports, read from /proc/cpuinfo on Linux and `sysctl machdep.cpu` on macOS. - The level is part of the executable cache key; `baseline` and builds without the option produce the same output and keys as before. - The runtime pack keeps its baseline code. - Targets other than x86-64 refuse a level (SC3002). The CLI's cached bootstrap route leaves builds with the option to the full compiler. - `bench:runtime` takes `--baseline-target-cpu` and `--candidate-target-cpu`.