🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: muc.lists.freebsd.ports
1 messages
1 total messages Started by Hiroo Ono (小野寛生) Wed, 25 Nov 2026 22:12
Different level of SIMD instructions mainly on amd64
#214
Author: Hiroo Ono (小野寛生)
Date: Wed, 25 Nov 2026 22:12
93 lines
8860 bytes
Hello,

Is there any written consent on how to define options for different
level of SIMD instructions on amd64?

There is SIMD in Mk/bsd.options.desc.mk, but it says only in general
expression.

SIMD_DESC?=             Use CPU-specific optimizations

Some softwares uses newer SIMD instructions and confront with
CPUTYPE, {C,CXX}FLAGS+=-march... and RUSFLAGS in make.conf for
older CPUs. Usually, they have an option to disable their use but
of different granularity.

dns/knot3 uses AVX2 instructions and at least prfchw but does
not seem to have options to disable them.

--- knot/modules/rrl/libknotd_la-kru-avx2.lo ---
In file included from knot/modules/rrl/kru-avx2.c:32:
knot/modules/rrl/./kru.inc.c:266:7: error: always_inline function
'_mm_load_si128'
requires target feature 'prfchw', but would be inlined into function
'kru_limited_p
refetch' that is compiled without support for 'prfchw'
  266 |                 h = _mm_load_si128((__m128i *)key);
      |                     ^

multimedia/svt-av1 uses basic SIMD, AVX, AVX2 and AVX512
instructions and has cmake options COMPILE_C_ONLY (for disabling
all SIMD instructions) and ENABLE_AVX512.

textproc/libfyaml uses AVX2 and AVX512 instructions and has
configure option --enable-portable-target to disable them.

 CC    blake3/blake3_avx2.o
 CC    blake3/blake3_avx512.o

www/chromium and www/ungoogled-chromium uses AVX512 instructions
and have allow_avx512=true/false for GN_ARGS.

There are ports that define options for enabling/disabling them,

databases/mongodb* have NOAVX option to disable AVX (and AVX2?)
instructions. (There is also option ARMV80A for aarch64).

lang/go* have options SOFTFLOAT and GOAMD64= V1 V2 V3 V4.
V1 for -march=x86-64, V2 for -march=x86-64-v2 and so on.

devel/electron* recently introduced AVX512 option.

There may be more.

If the naming of these options are common among ports, I can set
options in common in make.conf, not for each ports. For example:

OPTIONS_SET+=   AVX
OPTIONS_UNSET+= AVX512

or

OPTIONS_SET+=   AMD64_V2
OPTIONS_UNSET+= AMD64_V3

and not

databases_mongodb70_UNSET=      NOAVX
databases_mongodb80_UNSET=      NOAVX
databases_mongodb90_UNSET=      NOAVX
devel_electron43_UNSET=         AVX512
devel_electron44_UNSET=         AVX512

and so on in /usr/local/etc/poudriere.d/s15amd64-make.conf.

Some other softwares detect SIMD instructions at run time, or
compile time. Detecting them on run time is not a problem, but for
detecting them on compile time, it may be a problem. We cannot
cope with options for softwares of this type though.
If I am not wrong, QT6 checks SIMD instructions at compile time.
If I build packages on a new machines that supports AVX512
instructions and want to run it on a machine that does not support
that, it might stop with SIGILL. I have not heared of such error
about the official packages, so I may be wrong.

Such measure may be also needed for arm, aarch64 and riscv64 (option
NEON is an example?), but needed expecially for amd64 I think.

Best regards.


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads