[mlir][arith] Fold trivial integer division and remainder (#212074)
Add value-preserving folds mirroring LLVM's InstructionSimplify for the
integer division and remainder ops:
```
divui/divsi/ceildivui/ceildivsi/floordivsi(0, x) -> 0
divui/divsi/ceildivui/ceildivsi/floordivsi(x, x) -> 1
remui/remsi(0, x) -> 0
remui/remsi(x, x) -> 0
```
The self and zero-dividend cases are valid refinements because division
or remainder by zero is undefined behaviour; no overflow flags are
required. The folds return a scalar or splat constant and bail out on
shaped types with a dynamic shape.
Folding `x / 0` and `x % 0` to poison is left as a TODO: it would make
the arith dialect depend on the ub dialect to materialize `ub.poison`.
[20 lines not shown]
math/openblas: fix build on i386
Due to a miscompilation, a stack variable accessed by the MOVAPS
instruction ends up being misaligned. With MOVAPS requiring memory
operands to be aligned, this causes a bus error on i386. The underlying
cause could be that gfortran assumes a 16-byte aligned stack as is the
case on current i386 Linux, while we have not done the same ABI change.
I have worked around the problem by passing -mpreferred-stack-boundary=2
to disable assumptions about stack alignment, though ultimately this
will need to be fixed in the gcc and gfortran ports.
PR: 293087
MFH: 2026Q3
Reported by: salvadore
See also: https://github.com/OpenMathLib/OpenBLAS/issues/5905
Approved by: portmgr (build fix blanket)
(cherry picked from commit 48bc034e072df81878dee9fc7efb3b1eb6f3e2e8)
net/gnunet: fix build on armv7
We don't have libatomic and don't need it in any case.
Approved by: portmgr (build fix blanket)
MFH: 2026Q3
(cherry picked from commit 6d0770557bb5d784a9ac3fa113b91dfd56d0e73e)
comms/inspectrum: fix build on 32 bit platforms
On such platforms size_t is int, not long, causing confusion in
std::max().
Approved by: portmgr (build fix blanket)
MFH: 2026Q3
(cherry picked from commit 22693405a70f71c8c494a05c340b26cb1006a7cb)
[libc++][chrono] Implement LWG 4274: Allow chrono::hh_mm_ss to be constructed from unsigned durations (#209686)
**_Implementation details_**:
- Use `is_unsigned_v` instead of `numeric_limits<Rep>::is_signed`, which
is used by `chrono::abs`. `numeric_limits<Rep>::is_signed` may return
false when a custom `Rep` does not specialize `numeric_limits`. Relying
on it to detect the unsigned case could therefore be unreliable for such
a type. `is_unsigned_v` instead gives a compile-time path for built-in
unsigned types, while the sign check keeps signed types correct.
- The constructor calls `__abs_d` four times because each member is
initialized separately. This should not affect runtime performance
because the compiler should inline `__abs_d` and eliminate the repeated
calculations. We could use another helper function or helper class to
explicitly compute the absolute duration only once. However, this would
add extra glue code, and the added complexity is not worthwhile I think.
---------
Co-authored-by: A. Jiang <de34 at live.cn>
math/openblas: fix build on i386
Due to a miscompilation, a stack variable accessed by the MOVAPS
instruction ends up being misaligned. With MOVAPS requiring memory
operands to be aligned, this causes a bus error on i386. The underlying
cause could be that gfortran assumes a 16-byte aligned stack as is the
case on current i386 Linux, while we have not done the same ABI change.
I have worked around the problem by passing -mpreferred-stack-boundary=2
to disable assumptions about stack alignment, though ultimately this
will need to be fixed in the gcc and gfortran ports.
PR: 293087
MFH: 2026Q3
Reported by: salvadore
See also: https://github.com/OpenMathLib/OpenBLAS/issues/5905
Approved by: portmgr (build fix blanket)
devel/matreshka: Sync with main; improve Port
Update and improve:
* Drop un-testable Oracle DB support
* Patch build to increase verbosity
* Patch and modify the Port to reduce update burden with ${PLIST_SUB}
support, and abstracting the shared object, and GNAT runtime
version information in pkg-plist
* Remove all hard-coded version information, freeing the library
from the current restriction of GNAT-12
* Set ${MAINTAINER} to ada at FreeBSD.org.
* Sync with Upstream main
PR: 296453
games/OpenLoco: Open source re-implementation of Chris Sawyer's Locomotion
OpenLoco is an open-source re-implementation of Chris Sawyer's
Locomotion (CSL), the spiritual successor to Transport Tycoon. OpenLoco
aims to improve the game similar to how OpenTTD improved Transport
Tycoon, and OpenRCT2 improved RollerCoaster Tycoon.
CSL was originally written in x86 assembly, building on top of the
RollerCoaster Tycoon 2 engine. However, the engine has changed
substantially enough that OpenLoco currently does not share its codebase
with OpenRCT2.
As of December 2025, we have completed reimplementing the game in C++.
It is now our goal to get a solid multiplayer experience working in
OpenLoco. It is also our goal to increase the map and vehicle limits.
However, until creating a new save format (NSF), we are bound to the
limits imposed by the CSL save format (SV5/SC5).
WWW: https://openloco.io/
emulators/fab-agon-emulator: clean up, fix on 16-CURRENT
- CARGO_CARGO_RUN includes cd ${WRKSRC}, and running it under
SETENVI means that /usr/bin/cd was executed, which clearly
didn't do any good.
- remove double dependency on sdl3
- spell product name right in COMMENT
- reflow to 80 columns
PR: 296905
devel/sfl-library: C++ datastructure library
This is a header-only C++11 library that provides several new or
lesser-known containers, most of which can be used in C++20 constant
expressions.
Sequence containers: vector, devector, small_vector, static_vector,
compact_vector, segmented_vector, segmented_devector.
Associative containers based on red-black trees: map, set, multimap,
multiset, small_map, small_set, small_multimap, small_multiset,
static_map, static_set, static_multimap, static_multiset.
Unordered associative containers based on hash tables with separate
chaining: unordered_map, unordered_set, unordered_multimap,
unordered_multiset, small_unordered_map, small_unordered_set
small_unordered_multimap, small_unordered_multiset,
static_unordered_map, static_unordered_set, static_unordered_multimap,
static_unordered_multiset.
[13 lines not shown]
databases/ladybug: fix build on armv7
Same polyfill as the one for textproc/krep.
See also: a002d848b52bda537a6d0a90da4616001303f80b
Approved by: portmgr (build fix blanket)
MFH: 2026Q3
comms/inspectrum: fix build on 32 bit platforms
On such platforms size_t is int, not long, causing confusion in
std::max().
Approved by: portmgr (build fix blanket)
MFH: 2026Q3
[libc++][NFC] Inline fstream functions into the class body (#211738)
The `fstream` member functions are all really short, so inlining them
removes quite a bit of boiler plate code.
[flang][OpenMP] Split DEFAULT into DEFAULT(dsa) and DEFAULT(variant)
The 5.0 and 5.1 specs used DEFAULT clause for what is now OTHERWISE.
Separate these two claues to be able to specify their properties
independently.
[clang][CFG] Fix compound assignment evaluation order (#212115)
CompoundAssignOperator (e.g. `+=`, `-=`, `<<=`) is a distinct StmtClass
deriving from BinaryOperator, but it was not handled in the CFGBuilder
dispatch switches. As a result it fell through to the generic default
path (VisitChildren over reverse_children), which emits the LHS before
the RHS in the CFG.
Per C++17 [expr.ass]/1, all assignment operators - simple and compound -
sequence the right operand before the left operand. Route
CompoundAssignOperator through VisitBinaryOperator (and
VisitBinaryOperatorForTemporaries), whose existing isAssignmentOp()
branch already emits the RHS before the LHS, matching simple assignment.
This mirrors the class of evaluation-order defect fixed for lambda
captures in f3b31871e9b8.
rdar://183253943
Assisted-By: claude