SIMD(7)
π¦ simd β SIMD enhancements β¨
okay so this is simd(7), and it's genuinely one of those pages where you find out your libc has been secretly lifting weights this whole time πͺβ¨
πΈ NAME πΈ
simd β SIMD enhancements, bestie. that's the whole vibe.
π DESCRIPTION π
on some architectures, the FreeBSD libc hands you enhanced implementations of functions you use every single day, replacing the architecture-independent versions you'd get otherwise. no cap. π«Ά
depending on the architecture and the function, one of two things happens:
- the enhanced implementation is always used, periodt, or
- the libc detects at runtime which SIMD instruction set extensions the machine actually supports, and picks the most suitable implementation automatically β main character energy, it just knows π
on amd64, the environment variable ARCHLEVEL is your cheat code to override this whole mechanism (more on her in a sec π).
enhanced functions exist for these architectures: aarch64, arm, amd64, i386, ppc64, riscv π
π the function roster π
(the original is a big grid β here it is as a list, every cell preserved, i promise π)
bcmpβ aarch64:A; amd64:S1; i386:Sbcopyβ aarch64:A; arm:S; amd64:S; i386:S; ppc64:SV; riscv:Sbzeroβ aarch64:A; arm:S; amd64:S; i386:S; riscv:Sdivβ amd64:S; i386:Sindexβ aarch64:A; amd64:S1; ppc64:Sldivβ amd64:S; i386:Slldivβ amd64:Smemchrβ aarch64:A; amd64:S1; riscv:Smemcmpβ aarch64:A; arm:S; amd64:S1; i386:Smemccpyβ aarch64:A; amd64:S1memcpyβ aarch64:A; arm:S; amd64:S; i386:S; ppc64:SV; riscv:Smemmoveβ aarch64:A; arm:S; amd64:S; i386:S; ppc64:SVmemrchrβ aarch64:A; amd64:S1memsetβ aarch64:A; arm:S; amd64:S; i386:S; riscv:Srindexβ aarch64:A; amd64:S1; i386:S; riscv:Sstpcpyβ aarch64:A; amd64:S1stpncpyβ amd64:S1strcatβ aarch64:A; amd64:S1; i386:Sstrchrβ aarch64:A; amd64:S1; i386:S; riscv:Sstrchrnulβ aarch64:A; amd64:S1; riscv:Sstrcmpβ aarch64:A; arm:S; amd64:S1; i386:Sstrcpyβ aarch64:A; amd64:S1; i386:S; ppc64:S2strcspnβ arm:S; amd64:S2strlcatβ aarch64:A; amd64:S1strlcpyβ aarch64:A; amd64:S1strlenβ aarch64:A; arm:S; amd64:S1; riscv:Sstrncatβ aarch64:A; amd64:S1strncmpβ aarch64:A; arm:S; amd64:S1; i386:Sstrncpyβ amd64:S1; ppc64:S2strnlenβ aarch64:A; amd64:S1; riscv:Sstrrchrβ aarch64:A; amd64:S1; i386:S; riscv:Sstrpbrkβ arm:S; amd64:S2strsepβ arm:S; amd64:S2strspnβ arm:S; amd64:S2swabβ i386:Stimingsafe_bcmpβ aarch64:A; amd64:S1timingsafe_memcmpβ arm:S; amd64:Swcschrβ amd64:Swcscmpβ amd64:Swcslenβ amd64:Swmemchrβ amd64:S
π the legend, iykyk π
S: scalar (non-SIMD)1: amd64 baseline2: x86-64-v2 or PowerPC 2.053: x86-64-v34: x86-64-v4V: PowerPC VSXA: Arm ASIMD (NEON)
β ENVIRONMENT β
ARCHLEVELβ on amd64, this is the girl who controls the level of SIMD enhancements used π . if it's set to an architecture level from the list below and the processor actually supports that level, then SIMD enhancements up toARCHLEVELget used. ifARCHLEVELis unset, not recognised, or not supported by the processor, then the highest level of SIMD enhancements supported by the processor is used. she always has a fallback, queen π
a suffix beginning with : or + in ARCHLEVEL is ignored and may be used for future extensions. the architecture level can also be prefixed with a ! character to force use of the requested architecture level, even if the processor does not advertise that it's supported. β οΈ this usually causes applications to crash and should only be used for testing purposes or if architecture level detection yields incorrect results. like, for real, careful babe π
the architecture levels follow the AMD64 SysV ABI supplement:
scalarβ scalar enhancements only (no SIMD)baselineβcmov,cx8,x87 FPU,fxsr,MMX,osfxsr,SSE,SSE2x86-64-v2βcx16,lahf/sahf,popcnt,SSE3,SSE3,SSE4.1,SSE4.2x86-64-v3βAVX,AVX2,BMI1,BMI2,F16C,FMA,lzcnt,movbe,osxsavex86-64-v4βAVX-512F/BW/CD/DQ/VL
π©Ί DIAGNOSTICS π©Ί
Illegal Instruction β printed by sh(1) if a command is terminated through delivery of a SIGILL signal, see signal(3).
use of an unsupported architecture level was forced by setting ARCHLEVEL to a string beginning with a ! character, causing a process to crash due to use of an unsupported instruction. the fix? unset ARCHLEVEL, remove the ! prefix, or select a supported architecture level π«Ά
this message may also appear for unrelated reasons. she's not always about you π
π SEE ALSO π
H. J. Lu, Michael Matz, Milind Girkar, Jan HubiΔka, Andreas Jaeger, and Mark Mitchell, βAMD64 Architecture Processor Supplementβ, System V Application Binary Interface, May 23, 2023, Version 1.0.
π°οΈ HISTORY π°οΈ
architecture-specific enhanced libc functions were added starting with FreeBSD 2.0 for i386, FreeBSD 6.0 for arm, FreeBSD 6.1 for amd64, FreeBSD 11.0 for aarch64, FreeBSD 12.0 for powerpc64, and FreeBSD 16.0 for riscv64. π±
SIMD-enhanced functions were first added with FreeBSD 13.0 for powerpc64 and with FreeBSD 14.1 for amd64. glow-up timeline fr fr β¨
a simd manual page appeared in FreeBSD 14.1. iconic entrance, no notes π
π AUTHOR π
Robert Clausecker <fuz@FreeBSD.org> β ty for your service bestie π«‘
π CAVEATS π
other parts of FreeBSD β like cryptographic routines in the kernel or in OpenSSL β may also use SIMD enhancements. those enhancements are not subject to the ARCHLEVEL variable and may have their own configuration mechanism. so don't come for ARCHLEVEL about things she doesn't control π
π BUGS π
use of SIMD enhancements cannot be configured on powerpc64. that's it, that's the bug π
and that's the tea, bestie π this page is from the Debian build, dated October 21, 2025 β SIMD(7) β go forth and let your libc cook π₯π
π¦ where this page comes from
- freebsd 15.1: base 15.1
- Copyright (c) 2023 The FreeBSD Foundation
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms