[libc][math] Improve math implementation selection and exp*f dispatch. (#240169)
- Allow users to specify functions
- Add `LIBC_MATH_IMPL_IS` in `src/__support/macros/optimization.h` and
guard `LIBC_MATH_<FUNC>_IMPL` definitions with `#ifndef` across math
dispatch headers so external overrides only include the selected
`*_eval.h` header.
- Require `LIBC_TARGET_CPU_HAS_FPU_FLOAT` before selecting float_eval in
expf.h, exp2f.h, and exp10f.h so soft-float targets fall through to
`integer_eval` or `double_eval`.
- Change `exp2f_eval_bits` from `LIBC_ALWAYS_INLINE` to `LIBC_INLINE` in
`exp2f_integer_utils.h` to allow outlining when optimizing for code
size.
Assisted-by: Gemini
[Clang][OpenMP] Fix crash on a range-based for loop counted by `ordered(n)` but not collapsed (#240126)
Fixes #199449
Sema analyzes `max(collapse, ordered)` loops and hoists their bounds
into the pre-inits, which for a range-based `for` refer to its implicit
`__range`, `__begin` and `__end`. CodeGen emitted those only for the
collapsed loops, so a loop counted by `ordered(n)` alone hit
`llvm_unreachable("DeclRefExpr for Decl not entered in LocalDeclMap?")`.
The collapsed shape from the report was already fixed by #146772; this
one still crashed on main.
CodeGen now walks the same loops Sema did. The helpers of the extra
loops serve the pre-inits only, since such a loop is emitted as an
ordinary loop in the body and declares its own, so their mappings are
dropped afterwards.
AI Assisted!
[clang] Include source locations in macro directive dumps
`#pragma clang __debug macro` dumps macro directive history without
showing where each directive occurred.
Pass the `SourceManager` to `MacroDirective::dump()` and print each
directive's location alongside its address, making definitions and
undefinitions easier to trace.
[clang][NFC] Remove unused MacroDirective PCH origin tracking
`MacroDirective::IsFromPCH` is never set, and its accessors have no
callers. Macro history serialization instead uses the identifier's
deserialization and change state.
Remove the unused flag, accessors, and corresponding `dump()` output.
libalias: index fully specified inbound links by remote endpoint
Inbound lookups find the (alias address, alias port, link type) group
with a splay tree and then walk grp->full, a list of every fully
specified link in that group, comparing the remote address and port.
With redirect_addr in front of a busy server, every client connection
to public:443 lands in the same group, so each inbound packet that is
not near the head of the list walks all of it. TCP links live up to
24 hours unless libalias sees a clean close, so the list can grow to
hundreds of thousands of entries and saturate a core at a few hundred
packets per second.
Keep the fully specified links of a group in an RB tree ordered by
(dst_addr, dst_port). Links that share an endpoint are ordered newest
first by a per-instance insertion counter, which keeps the "most recent
link wins" behaviour of the list (tested by 3_natin:2_portoverlap).
Lookups with an unknown remote address and a known port still scan the
group. Each link grows by 16 bytes.
[10 lines not shown]
libalias: Handle GetNewPort() errors properly
AddLink() fails when memory allocation fails or no free port is
available; both are error conditions. However, functions such as
FindUdpTcpIn() were converting such failures to PKT_ALIAS_IGNORED, which
effectively means, "pass the packet without translation," which isn't
what we want.
Fix the problem by making sure that AddLink() errors are converted to
PKT_ALIAS_ERROR where appropriate. The diff is a bit large but is
mostly mechanical: functions like TcpAliasOut() are converted to return
a result code, and an additional out-parameter is added to return the
alias_link pointer.
Reported by: Yuxiang Yang <yangyx22 at mails.tsinghua.edu.cn>
Tested by: Yuxiang Yang <yangyx22 at mails.tsinghua.edu.cn>
MFC after: 2 months
Differential Revision: https://reviews.freebsd.org/D47778
(cherry picked from commit fb2ea26f3c3681f5ef639af9c798a631d800864b)
libalias: Add support for EIM NAT
Add support for endpoint-independent mapping ("full cone NAT") in
Libalias's UDP NAT.
This conforms to RFC 4787 requirements 1 and 3. All UDP packets sent out from a
particular internal address:port leave via the same NAT address:port,
regardless of their destination.
Add some libalias tests and supporting defines.
Reviewed by: igoro, thj
Differential Revision: https://reviews.freebsd.org/D46689D
(cherry picked from commit 61bf830cbb260c2a046cb44421d319184393e028)
AArch64: Use the DAG's libcall info in call and DAG lowering (#239829)
Libcall info should come from the analysis pass, and the static copy
in TargetLowering will be removed.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
net/yami4: Improve port
* Use HTTPS for MASTER_SITES.
* Always build the Core and C++ libraries, removing the option.
* Use PORTDOCS=* instead of listing a lot of documentation in pkg-plist.
PR: 300142
Approved by: osa, vvd (mentors, implicit)
net/yami4: Improve port
* Use HTTPS for MASTER_SITES.
* Always build the Core and C++ libraries, removing the option.
* Use PORTDOCS=* instead of listing a lot of documentation in pkg-plist.
PR: 300142
Approved by: osa, vvd (mentors, implicit)
SEV-SNP: Disable ipmi(4) on confidential VMs
The CD_COCOVM filter already keeps ipmi(4) from attaching on a
confidential VM, but it runs too late: ipmi_probe() is called directly
from mainbus_attach() and scans the BIOS ROM window at 0xc0000-0xfffff
for an IPMI signature before config_found() is reached. Skip the probe
as well.
ok mlarkin@
Add ML-DSA 44 support with tests
This adds ML-DSA 44 support based on BoringSSL's changes to
add support for the 44 rank.
It also adds the NIST ACVP test vectors and unit tests for
MLDSA 44 to the existing regress tests.
ok tb@
SEV-SNP: Add memory clobber to vmgexit()
The hypervisor reads and writes the GHCB while handling a VMGEXIT.
Without a memory clobber the compiler may cache GHCB contents across
the instruction. "asm volatile" alone does not prevent that.
No change in generated code.
ok mlarkin@
py-dunamai: update to 1.26.4.
## v1.26.4 (2026-11-07)
* Fixed: Hyphenated tags in the `describe` field in `.git_archival.json` were not parsed correctly
when the repository was exactly on a tagged commit.
([Contributed by TohruSu](https://github.com/mtkennerly/dunamai/pull/120))