Article View: muc.lists.freebsd.ports
Article #214Different level of SIMD instructions mainly on amd64
From: Hiroo Ono (小野寛生)
Date: Wed, 25 Nov 2026 22:12
Date: Wed, 25 Nov 2026 22:12
93 lines
8860 bytes
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
Technical Details
Message-ID:
<CANtk6SiTJM8uhVhrSt5whuE6vEAUZoqL14v+=1vHKYGZdXGamw@mail.gmail.com>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.muc.de!.POSTED.news.muc.de!not-for-mailShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.muc.de!.POSTED.news.muc.de!not-for-mail
From: Hiroo Ono (小野寛生) <hiroo.ono+freebsd@gmail.com>
Newsgroups: muc.lists.freebsd.ports
Subject: Different level of SIMD instructions mainly on amd64
Date: Thu, 26 Nov 2026 07:12:52 +0900
Organization: Newsgate at muc.de e.V.
Approved: news-admin@muc.de
Distribution: world
Message-ID: <CANtk6SiTJM8uhVhrSt5whuE6vEAUZoqL14v+=1vHKYGZdXGamw@mail.gmail.com>
Reply-To: hiroo.ono+freebsd@gmail.com
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Injection-Info: news.muc.de; posting-host="news.muc.de:193.149.48.2";
logging-data="97576"; mail-complaints-to="news-admin@muc.de"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim;
t=1795644804; h=from:from:reply-to:reply-to:subject:subject:date:date:
message-id:message-id:to:to:cc:mime-version:mime-version:
content-type:content-type:list-id:list-help:list-owner:
list-unsubscribe:list-subscribe:list-post;
bh=xT9Bgmb5J0GNlJDGZi3eOYFLoE3BdWQm8EHTseHIJhA=;
b=RVkW/geIdllZm9KH3bz6M1LdXoTqpWD4a6HMJ20DpLQCpS0VPy5RwGcRcBPtUN+aNiUtZ8
NCsXoiLg76j8bNpGCTf+bmEgT/yR8HaMb6AtB/+tHE3Lt1J6fZVvjY79hgcqvE31HPl5v+
lsnKhUcvK+cGfmB58E0RtoiMkcVAQZoKoNqEs6xK9dtBtnsW3eogKnuVf0J95ofS97vZkO
XBe26pby4wgneMNFspfMHy3CDeHGA2srfVq6vnLhGIYfsSvKJaHJsPuK2jqWC2L/oEG3hB
Vz3f6Gef/l5/oHiOkbuRgv6/P76s3cPm9yeT2N2l0MIjhblCIRp6syDT2ggSWQ==
X-Original-To: freebsd-ports@mlmmj.nyi.freebsd.org
Authentication-Results: mx1.freebsd.org;
dkim=pass header.d=gmail.com header.s=20260707 header.b=fcxVBEho;
spf=pass (mx1.freebsd.org: domain of hiroo.ono@gmail.com designates 2607:f8b0:4864:20::b12f as permitted sender) smtp.mailfrom=hiroo.ono@gmail.com;
dmarc=pass (policy=none) header.from=gmail.com;
arc=pass ("google.com:s=arc-20260327:i=1")
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20260707; t=1795644787; x=1796249587; darn=freebsd.org;
h=content-type:to:subject:message-id:date:from:reply-to:mime-version
:from:to:cc:subject:date:message-id:reply-to:content-type;
bh=xT9Bgmb5J0GNlJDGZi3eOYFLoE3BdWQm8EHTseHIJhA=;
b=fcxVBEhoA7g/zYgk/IO6Nx2GxkRPJEfZqmDaGGERM3yodqZO9DJz5OgKjJWeLX4Ykr
2gwNLO572K8L0+7IdYsobdkp9lu0JpVH3rI4OJnZijPVF87lnmml8Jif3S2CllD2z1XO
HNiLyGe1qabfhsy77SiR4/DTWwGX+X+PcgnoFRJiGtRBzKo59keDNT7G+bL8ImRbriDi
a1buY2ONfZ4KmVAOhO/hrzcvGaHpIC93EgS+B23Ij6NUB27B4GsjJN7c7EqZhFgqXWeE
JMiHeN//Id758T1HgAiVx8w/xyfoiRSsG5CGtrMSRaRX319/lbUErXyeXW+ZwzEvAnMF
wsWQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1795644787; x=1796249587;
h=content-type:to:subject:message-id:date:from:reply-to:mime-version
:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id
:reply-to:content-type;
bh=xT9Bgmb5J0GNlJDGZi3eOYFLoE3BdWQm8EHTseHIJhA=;
b=A923SXPDORAEpxV7G717OtNcFJZ5jCSQv1sRTYgZLegpsNl48nJ6DZNMPGgHd6XyCd
8v/AkQSnC02oju/Y9DKr0vTveeoZumk6MKuaJMRrA/Vj4sZdkFqQfGPiO2z4fi59ou8p
BBdqUd3xXKk9hE/9ZM5r81Dw4UTdEIhvQgYBGsux7YKgS/8cY6rBwNbz5iWcaGx9YTkD
AbeFX/frOQosI9Y0FWbo5yUrm/si1VD3v3SDxS62FpOays2qqV8qhilbpAlrMtL1BS94
W6jDr5GAPTNUZbaJhI+/nJ6R84YrtwGT8I5lv3cyBSIzCkdqzR5LMYl7O+M+yoz9CVto
shGw==
X-Gm-Message-State: APuU4Z/W2QjXReyFwLitCJyq99wbqGfs5wvhfVAFDRvVRoMtaAxkvoWv
EQmMfKk+z6fGIZUENREvBuHKfr3c6qse7OseNuJvnJ5EdZTV5WYOfnwvJLfDG0fMqWrfV42JchM
7jc52E2nfMyglOHiE0vi4gICXZZzRLOgPcc7x
X-Gm-Gg: AZFdTZc9i1UiyVRAHaUkwn04y8xyJFhmLXxwhFWe5dublkTd4RK9lo6dvJwaIYcp0eb
1khsgfgU2wQ2kwyDK7TE+2FzuX7BNNGwui5yChm1cEbabg8K1vWfYwqhcQYOZlyxRWx38UECTO3
19PRt3ffq50kKsH1CUvyWd8WS8G0V//wSX6AEauqqydApsPDbNNTqwQnGEn6/ATgCeSo/UN5e4j
VZVqjPckWuLi01UTrC52AzJExQAOjohgAsgCYFveyDjAwpUJd+39Zwu9CftF3ZQRxGXUuqzCJns
3zNAr+X65FaD1f4y6+fWYUmjanQPuXwH6Hjm42NVY6iqijlQZTbutuhAT5oUzFNLueqD5LgBWr/
gRQtscOZptphVW1nwIOZEl2JXa9QHplsu/afUGMnUB+9vbs9i4OKjBCz/wSuP0vzWdZ0FAyskP6
DzJu4mAx2klGLKvxQCPtbkb8LBWeXwyGT2BAzwNUaqQ37ln3n+gg==
X-BeenThere: freebsd-ports@freebsd.org
Precedence: list
X-Gm-Features: Aa3M54qs-hYjLPegCzXyyoUWSonLRgD4g9pxexLsGhlF7oAEJqPYJl-1FzFjbYk
X-Rspamd-Queue-Id: 4jZYpX2Qm4z4vPr
X-Spamd-Bar: --
X-Spamd-Result: default: False [-2.00 / 15.00];
ARC_ALLOW(-1.00)[google.com:s=arc-20260327:i=1];
DMARC_POLICY_ALLOW(-0.50)[gmail.com,none];
R_DKIM_ALLOW(-0.20)[gmail.com:s=20260707];
R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4864::/56];
MIME_GOOD(-0.10)[text/plain];
TAGGED_FROM(0.00)[freebsd];
DKIM_TRACE(0.00)[gmail.com:+];
TO_MATCH_ENVRCPT_ALL(0.00)[];
RCVD_TLS_LAST(0.00)[];
FROM_HAS_DN(0.00)[];
MIME_TRACE(0.00)[0:+];
FREEMAIL_ENVFROM(0.00)[gmail.com];
RCPT_COUNT_ONE(0.00)[1];
DWL_DNSWL_NONE(0.00)[gmail.com:dkim];
FREEMAIL_FROM(0.00)[gmail.com];
REPLYTO_DOM_NEQ_TO_DOM(0.00)[];
MISSING_XM_UA(0.00)[];
RCVD_COUNT_ONE(0.00)[1];
HAS_REPLYTO(0.00)[hiroo.ono+freebsd@gmail.com];
TO_DN_NONE(0.00)[];
REPLYTO_ADDR_EQ_FROM(0.00)[];
FROM_EQ_ENVFROM(0.00)[];
RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::b12f:from];
PREVIOUSLY_DELIVERED(0.00)[freebsd-ports@freebsd.org];
MLMMJ_DEST(0.00)[freebsd-ports@freebsd.org];
ALIAS_RESOLVED(0.00)[];
ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US];
MID_RHS_MATCH_FROMTLD(0.00)[];
FREEMAIL_REPLYTO(0.00)[gmail.com]
X-Newsgate-Id: f02c70b8849f+
X-No-Archive: Yes