Last updated: 2026-03-14
gopus ships assembly only for helpers that stay bit-exact against the pure-Go path.
arm64: assembly is selected automatically byGOARCH=arm64.amd64: two helper groups exist:imdct_rotateandkf_bflyuse baseline amd64 assembly through the normal*_asm.gowrappers.- the wider CELT math helpers use runtime dispatch in
celt/amd64_dispatch.go, guarded byinternal/cpufeat/amd64.go.
- Runtime dispatch enables the AVX2+FMA helpers only when the host OS and CPU report both features. Otherwise the generic Go path is used.
- Non-
amd64/arm64targets use the pure-Go fallbacks.
This means the AVX/FMA paths are not selected purely at compile time. GOAMD64=v3 is not required for the current production dispatch.
arm64 kernels:
celt/abs_sum_arm64.scelt/exp_rotation_arm64.scelt/float32_arm64.scelt/haar1_arm64.scelt/imdct_rotate_arm64.scelt/kf_bfly5n1_arm64.scelt/kf_bfly_arm64.scelt/pitch_autocorr_arm64.scelt/pitch_xcorr_arm64.scelt/prefilter_innerprod_arm64.scelt/prefilter_xcorr_arm64.scelt/pvq_search_arm64.scelt/stereo_layout_arm64.scelt/tone_lpc_corr_arm64.scelt/transient_energy_arm64.s
amd64 baseline kernels:
celt/imdct_rotate_amd64.scelt/kf_bfly_amd64.s
amd64 runtime-dispatched AVX2/FMA kernels:
celt/abs_sum_amd64.scelt/exp_rotation_amd64.scelt/float32_amd64.scelt/pitch_autocorr_amd64.scelt/pitch_xcorr_amd64.scelt/prefilter_innerprod_amd64.scelt/prefilter_xcorr_amd64.scelt/pvq_search_amd64.scelt/tone_lpc_corr_amd64.scelt/transient_energy_amd64.s
arm64 kernels:
silk/inner_prod_arm64.ssilk/pitch_xcorr_arm64.s
There is currently no shipped SILK amd64 assembly.
Representative fallback files for the assembly-backed helpers:
celt/abs_sum_default.gocelt/exp_rotation_default.gocelt/float32_default.gocelt/haar1.go,celt/haar1_nonarm64.gocelt/imdct_rotate_default.gocelt/kf_bfly_default.gocelt/kf_bfly5n1.go,celt/kf_bfly5n1_nonarm64.gocelt/pitch_autocorr_default.gocelt/pitch_xcorr_default.gocelt/prefilter_innerprod_default.gocelt/prefilter_xcorr_default.go,celt/prefilter_xcorr_fast_default.gocelt/pvq_search_default.gocelt/stereo_layout_impl.gocelt/tone_lpc_corr_default.gocelt/transient_energy_default.gosilk/inner_prod_default.gosilk/pitch_xcorr_impl_default.go
go test ./celt ./silk -count=1
GOARCH=amd64 GOAMD64=v1 go test ./celt -run '^TestAMD64DispatchMatchesGeneric$' -count=1
GOARCH=amd64 GOAMD64=v1 go test ./celt -count=1
make verify-production
make bench-guardWhen assembly behavior is uncertain, confirm parity against the pinned libopus tree in tmp_check/opus-1.6.1/ before tuning.