[libc][math] Optimize pow 128-bit and 256-bit accurate passes and share exp2_df128
- Refactor 128-bit and 256-bit accurate passes to use multi-tier fixed-point arithmetic (Frac64, Frac128, Frac256) and share double_eval::exp2_df128 with exp/exp2/exp10.
- Simplify is_exact_rounding_boundary to operate on normalized (x_e, x_mant), unify power loops, and replace 64-bit hardware divisions with a leading-zero bit-width bound.
- Avoid general multi-limb normalization and conversion overhead in pow_accurate and pow_accurate_256.
Assisted by: Gemini for analysis and refactoring
libthr: Create landing pad in thr_once in C++ exception
In _thr_once, if init_routine fails with exception, the stack allocate
__cup will become invalid when unwinder walk back and free the stack of
thr_once. This cause cleanup linked list be dangling. In here, we give
the cleanup function a landing pad so that we td can correctly point
to previous cleanup function.
Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D61212
[InstrProf] Use CreatePtrAddWithSExtOrTrunc() for bias (#239261)
The bias is always 64-bit, but we may be adding it to a 32-bit
pointer, resulting in a mismatch with the pointer index type.
Use CreatePtrAddWithSExtOrTrunc() to adjust for the index type.
(In practice, only the "trunc" case will occur, as otherwise the
index type would have to be larger than 64-bit bits.)
www/gitea: Security update 28.2.0 => 28.3.0, fix 21 CVEs
It contains a large number of security fixes, mostly around token
scopes, and bug fixes and performance improvements for Actions,
issues, pull requests and packages.
We strongly recommend that all users upgrade as soon as possible.
URL: https://blog.gitea.com/release-of-28.3.0/
PR: 300499
Approved by: portmgr@ (blanket, security fix)
MFH: 2026Q4
(cherry picked from commit 4d2e00911ddaa5f72c2833a803627a107da6be05)
libthr: Predict libthr is initialized in _thr_check_init
_thr_check_init() is called on hot paths such as pthread_once(), and
the uninitialized case can only happen once. Mark it with
__predict_false so the compiler lays out the initialized case as the
fall-through path.
Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D61213
www/gitea: Security update 28.2.0 => 28.3.0, fix 21 CVEs
It contains a large number of security fixes, mostly around token
scopes, and bug fixes and performance improvements for Actions,
issues, pull requests and packages.
We strongly recommend that all users upgrade as soon as possible.
URL: https://blog.gitea.com/release-of-28.3.0/
PR: 300499
Approved by: portmgr@ (blanket, security fix)
MFH: 2026Q4
NAS-145070 / 28.0.0-BETA.1 / Send the system global ID to HexOS alongside the hostid hash (by creatorcary) (#20144)
HexOS identifies each server by a hash of `/etc/hostid`, but hostids
collide across installs: until
[NAS-143895](https://ixsystems.atlassian.net/browse/NAS-143895) the
installer's hostid generator seeded itself from the process ID and the
clock, so machines installed without a working RTC could end up with the
same hostid, and that fix only helps new installs. The HexOS tunnel URL
now also carries the system's global ID (the random UUID behind
`system.global.id`) as a `gid` query parameter. The URL path is
unchanged so HexOS can keep matching servers it already knows by hostid,
and when the ID cannot be read the URL is exactly what it was before.
The ID is read straight from the config database, so starting the tunnel
never waits on middlewared.
Original PR: https://github.com/truenas/middleware/pull/20122
---------
Co-authored-by: Logan Cary <logan.cary at ixsystems.com>
[AMDGPU] Align packed-f64 VALU source operands (#236873)
The 128-bit source operands of the packed 64-bit VALU instructions
(v_pk_add_f64, v_pk_fma_f64, v_pk_add_nc_u64, v_pk_lshl_add_u64, ...)
wrapped the unaligned VS_128 register class, so on subtargets requiring
aligned VGPR tuples the machine verifier accepted odd-aligned source
registers, and the assembler rejected them only through the generic
validateVGPRAlign scan.
Introduce VS_128_AlignTarget (a RegClassByHwMode that resolves to VS_128
or VS_128_Align2 per subtarget) and use it for VSrc_v2b64 / VSrc_v2f64,
matching the existing VS_64_AlignTarget handling for the 64-bit case. Make the
matching assembler operand predicates resolve the class per HwMode as
well, so misaligned sources are rejected by the operand class.
Co-authored-by: Claude <noreply at anthropic.com>
[CIR] Match classic codegen for saturating fixed-point negation and padded conversions
Three CIR fixed-point paths diverged from classic codegen. Unary minus on a
saturating fixed-point type emitted a plain subtraction instead of a
saturating 0 - x. With -fpadding-on-unsigned-fixed-point, float to unsigned
fixed-point conversion used fptoui and compared against 0 as unsigned, so the
clamp to 0 never fired; it now converts and clamps as signed, like
llvm::FixedPointBuilder. A saturating fixed-point conversion that kept the
width but changed signedness returned a value of the source CIR type, which
broke the cir.cmp verifier and needed a pointer bitcast to store; it now
casts to the destination type.
Assisted-by: Claude Code (Opus 5.5).
hastd: Remove pidfile on exit
Make hastd remove its pidfile before exit after catching a signal or a
stop control message, not just on failure to start.
MFC after: 1 week
Reviewed by: ngie
Differential Revision: https://reviews.freebsd.org/D60192
(cherry picked from commit 3f2f6bb8f7b562276bffd04a9ae4c05a351b4435)
hastd: Remove pidfile on exit
Make hastd remove its pidfile before exit after catching a signal or a
stop control message, not just on failure to start.
MFC after: 1 week
Reviewed by: ngie
Differential Revision: https://reviews.freebsd.org/D60192
(cherry picked from commit 3f2f6bb8f7b562276bffd04a9ae4c05a351b4435)
[SLP]Allow copyable when other operand is built from same-lane operand
Copyable lanes were rejected if the second operand column had more
than one instruction. If each such instruction uses only the same-lane
first operand and constants, the column is a vector op over the
vectorized first operand, not a gather.
Fixes #183730
Assisted-by: Cursor
Reviewers:
Pull Request: https://github.com/llvm/llvm-project/pull/239268
NAS-145079 / 28.0.0-BETA.1 / Release NFS locks before unmounting a dataset (#20129)
### Background
nfsd and lockd keep a file open for every NFSv3 lock and every NFSv4
open or delegation, and deleting a share does not release them. Once the
share is gone, an NFSv3 client can't even release a write lock anymore:
lockd reopens the file through nfsd for the unlock, and the handle is
stale by then. The dataset stays busy, so `pool.dataset.delete`,
`pool.dataset.lock` and `pool.export` fail with EBUSY, even after a lazy
unmount has hidden it. We saw this on a customer system weeks after the
shares had been deleted.
### Change
A private `nfs.release_dataset_filesystems` that the three operations
call right before they unmount. For every live filesystem in the tree it
writes `/proc/fs/nfsd/unlock_filesystem`, reaching the filesystem
through `fsmount()` so a lazily unmounted one works too, and does the
same for snapshots automounted under `.zfs/snapshot`. This releases
NFSv3 locks and NFSv4 opens and delegations. A filesystem another share
[20 lines not shown]
[libc] Fix AVX2 compare_and_mask broadcasting byte needle with epi16 (#235246)
In `libc/src/string/memory_utils/x86_64/inline_strlen.h`, the AVX2
specialization of `compare_and_mask` used `_mm256_set1_epi16(c)` instead
of `_mm256_set1_epi8(c)`.
Because `compare_and_mask` is used by `find_first_character` (and
therefore `memchr`), this caused:
1. Matches at odd offsets to be missed (since odd bytes in the vector
mask were 0x00 instead of `c`).
2. False positive matches when 0x00 (or 0xFF) occurred at odd offsets
while searching for a nonzero character.
This change fixes the broadcast intrinsic to `_mm256_set1_epi8(c)`
(matching the SSE2 and AVX-512 specializations) and adds regression
tests to `memchr_test`.
Fixes #226787.