[CIR] Do not inline a cleanup scope body that starts with a label (#243775)
`cir.cleanup.scope` canonicalization inlines a single-block body in
front of the scope when its cleanup region is trivial. If the body
starts with a `cir.label` and other operations precede the scope, the
label lands in the middle of a block and verification fails with "must
be the first operation in a block". The canonicalizer now keeps a body
that starts with a label in its scope. Splitting the parent block would
also work, but it adds a block and a branch for IR that CIRGen does not
produce.
Assisted-by: Claude Code (claude-opus-5-5).
[clang] Convert to a C23 enum with bool underlying type like bool (#244494)
In C23, conversion to an enum with a fixed underlying type has the
semantics of conversion to the underlying type (6.7.3.3p16). For `enum E
: bool` clang truncated instead of comparing against zero, so `(enum E :
bool)2` was 0, and converting a double like 2.5 emitted `fptoui double
to i1` (poison), giving different results at -O0 and -O3. Compound
assignment and increment had the same problem: `e += 2` with e == 0 gave
0, and `e++` with e == 1 gave 0.
`Type::getScalarTypeKind()` now returns `STK_Bool` for such an enum, so
casts get the `*ToBoolean` cast kinds, as C++ `static_cast` already
does. In CodeGen, `EmitScalarConversion` and
`EmitComplexToScalarConversion` treat the enum as bool when it is the
destination, which covers compound assignment, and the bool special case
for `++` (plain and atomic) covers it too.
Fixes #241289
Advertise TrueNAS over mDNS as _truenas._tcp
The service is on the web UI's HTTPS port, so a client such as the
TrueNAS Connect app can find a TrueNAS whatever its host name. Its TXT
record holds what the NAS answers before signing in:
api=min=v25.10.0,max=v28.0.0
boot_id=<system.boot_id>
auth_mech_choices=API_KEY_PLAIN,TOKEN_PLAIN,PASSWORD_PLAIN,SCRAM
Reload discovery after nginx restarts or reloads, so the ports that
_http._tcp and _truenas._tcp advertise follow the UI's.
ZTS: run the renameat2 tests on FreeBSD
FreeBSD has renameat2(2) since 16.0 and 15.1, with AT_RENAME_NOREPLACE,
and FreeBSD 16 (and stable/15) also have AT_RENAME_EXCHANGE. The VFS
passes both flags to the filesystem in VOP_RENAME()'s new a_flags
argument and leaves it to the filesystem to swap the two names.
Build the renameat2 helper on FreeBSD too, using libc's renameat2(),
and run renameat2_noreplace and renameat2_exchange there. ZFS on
FreeBSD does not implement the exchange (#19504), so on FreeBSD
renameat2_exchange checks that the call fails with EOPNOTSUPP and
leaves both files, their contents and their inode numbers as they were,
and that the directory still works afterwards.
ZFS on FreeBSD ignores a_flags today, so the exchange is done as a
plain rename: it succeeds, the source replaces the target, and the
target's data is gone.
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
[2 lines not shown]
print/lyx: Update to 2.5.3, add a qt6 flavor; follow the locale's charset
Changes: https://www.lyx.org/announce/2_5_3.txt
LyX reads its message catalogs itself and keeps all text, translations
included, in UTF-8, so its stdout and stderr were UTF-8 whatever the
locale: with LANG=ru_RU.KOI8-R the messages came out in Russian, but
unreadable. Add a stream buffer, which converts the UTF-8 written to
cout and cerr into the charset of the current locale (LC_CTYPE), with
iconv(3). Characters, which the charset lacks, are printed as "?".
Nothing changes, if the locale is already UTF-8, or is C or POSIX.
This was reported upstream long ago:
https://www.lyx.org/trac/ticket/6392
Fix detection of Qt: configure ran make(1) on a qmake-generated Makefile,
that needs GNU make; use ${MAKE} instead.
Add a qt6 flavor (lyx-qt6), as 2.5 supports both Qt5 and Qt6; qt5 remains
[27 lines not shown]
install: add --ignore-unavailable
a package named on the command line which no repository provides is now
reported and skipped instead of failing the whole request
Fixes: #2195
linux: Move the machine-dependent ioctl bits into per-arch headers
Move both out of <compat/linux/linux_ioctl.h> and into
<machine/../linux/linux_ioctl.h> and <machine/../linux/linux_termbits.h>,
following the lead of linux_emul_md.h. Every architecture linuxulator
currently supports uses the asm-generic values, so the new per-arch
headers either spell out the generic encoding or just include the common
termbits set, and nothing changes for them. This is all in preparation
for powerpc64 linuxulator.
While here, move the termio structures from linux_ioctl.c up to
linux_ioctl.h, next to the constants that size them.
No functional change intended.
Differential Revision: https://reviews.freebsd.org/D61330
[Mips] Use 0/1 booleans for R6 FP compares (#245469)
cmp.cond.fmt on MIPS32r6/MIPS64r6 writes 0 or -1, so the backend set
the scalar FP boolean contents to ZeroOrNegativeOne while integer
booleans stay ZeroOrOne. Generic SelectionDAG code often takes the
boolean contents from the result type, not from the compared type, so
it picked the wrong true value for FP compares. For example, visitXOR
folded (xor (setcc), 1) into an inverted setcc, which is not a logical
not for a 0/-1 mask.
Use ZeroOrOne for all scalar booleans instead. Custom lower scalar FP
SETCC on R6 to (and R6FCmp, 1), where the new R6FCmp node is the native
0/-1 mask. Branches and SEL.fmt only read bit 0, and SELEQZ/SELNEZ only
test for zero, so match them on the mask directly. Also fold a select
of -1/0 on such a condition to a sign extension of the mask.
Since the boolean contents now agree, generic combines that were
disabled for mismatched contents also apply again, which removes a few
instructions in the existing tests.
[7 lines not shown]
linux: Add a LINUX_TODO() macro
Unimplemented corners of the Linuxulator are easier to find when they
announce themselves instead of silently returning. LINUX_TODO() prints
a rate-limited message naming the function and what the stub is still
missing, built on the existing LINUX_RATELIMIT_MSG_OPT1().
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D61329
lindebugfs: Remove unneeded header
linux_ioctl.h is not needed in order to build, so remove it. A future
change will split linux_ioctl.h into arch-specific headers, and 32-bit
arm does not have a compat linux so would fail the build, and adding a
header just to appease lindebugfs would be superfluous, given that it's
not needed.
[Mips] Mark prologue instructions as FrameSetup (#244894)
The scavenger can hoist an emergency spill above the stack allocation,
because the prologue instructions aren't marked FrameSetup. Only the FP
setup is, so without a frame pointer, the spill and the reload end up
using different addresses.
[AArch64][NFC] Add [de]interleave6 tests
interleave6 and deinterleave6 already have support for custom lowering
using st3/ld3 and uzp/zip, but was missing test coverage for a sequence
where values are interleaved and stored, or loaded and deinterleaved.
Assisted-by: Codex
[AArch64] Enable Custom Lowering of [de]interleave8 (#245244)
To enable lowering of [de]interleave8 intrinsics, we can use the custom
lowering for Factors of 4, as these are split into intrinsics where
native support is available for the relevant ld/st instructions on
AArch64.
Previously an operation where a store follows an interleave, or a
deinterleave follows a load, this would have been lowered to scalar ldr
and str instructions, instead, ld4/st4 is used reducing the number of
uzp or zip instructions needed to complete the sequence.
Assisted-by: Codex (tests)
sys/arm64: TTL fixes
Set TTL bits in TLBI_RANGE_FIELDS() regardless of FEAT_TTL; these bits are
defined by FEAT_TLBIRANGE.
Set TTL in per-page invalidate path (pmap_s1_invalidate_loop()).
Reported by: alc
Reviewed by: alc
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D61390
[AMDGPU] Precommit TRANS co-exec tests (NFC)
Add a gfx950 coexec scheduler case where a v_exp_f32 and a v_add_f32
compete for the window of an XDL2x (v_mfma_f32_16x16x32_bf16) MFMA.
No MFMA row allows TRANS so far, so the v_exp_f32 issues after the
MFMA window.
Assisted-by: Claude Opus 5.5
[AMDGPU] Fix gfx950/gfx942 TRANS co-execute slot
On gfx950/gfx942, fix TRANS co-exec slot to be same as VALU.
Excluded from this commit:
TRANS on gfx950 (in unit of hardware cycle):
Reciprocal throughput (per SIMD):
f32/f16: 8
f64: 16
Def-to-use latency:
f32/f16: 12 to a non-TRANS reader, 8 to a TRANS reader
f64: 20 to a non-TRANS reader, 16 to a TRANS reader
Blocks this wave's issue for:
f32/f16: 8
f64: 16
On gfx942, f32/f16 have the same numbers as f64 above.
Currently, GCNHazardRecognizer inserts the correct s_nop between a TRANS
[5 lines not shown]
[AMDGPU] Fix gfx950/gfx942 v_pk f32 instr co-exec slot
On gfx950/gfx942, v_pk f32 instrs can issue only after the MFMA's own
cycles (in hardware cycles):
XDL/SMFMAC: 8 cycles
XDL2x/SMFMAC2x: 12 cycles
SGEMM/DGEMM: 8 cycles
Currently they are categorized as VALU. This is wrong for
XDL/SMFMAC/XDL2x/SMFMAC2x, since VALU can issue within the MFMA's own
cycles.
Fix this by adding a PK_F32 CoExecMask bit, a PK_F32 slot in each MFMA
row, and a PackedF32VALU InstructionFlavor. Classify the following
instrs as PackedF32VALU on gfx942/gfx950:
V_PK_{ADD,FMA,MUL}_F32, V_PK_MOV_B32.
NFC for gfx1250.
[2 lines not shown]
[clang][Mips] Set __mips and _MIPS_ISA from the ISA level (#244951)
__mips and _MIPS_ISA were set from the ABI only, so -march=mips1 to
-march=mips5 got __mips 32 or 64 and _MIPS_ISA_MIPS32 or
_MIPS_ISA_MIPS64. Code that checks for MIPS I, such as for the load
delay slot or the missing ll/sc, could not tell.
Do what GCC does: __mips is 1 to 5 for MIPS I to MIPS V and 32 or 64
for MIPS32 and MIPS64, and _MIPS_ISA follows it. __mips64 stays based on
the ABI. __mips_isa_rev is now only defined for MIPS32 and MIPS64, as
GCC does, instead of being defined as 0 for the older ISAs.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[Mips] Check overlapping registers in MIPS I load and FPU delay slots (#244860)
SafeInLoadDelaySlot and SafeInFPUDelaySlot only looked for the exact
register written by the load or FPU move. On MIPS I a double is in an
even/odd pair, so a lwc1 or mtc1 that writes $f3 directly followed by
an instruction that reads $d1 was not seen as a hazard and got no nop.
Check explicit operands for any overlap with the written register.
Implicit operands keep the exact match, so the implicit uses of whole
argument and return registers on calls and returns don't add nops.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[Mips] Accept l.s, s.s, l.d and li.d on MIPS I (#244949)
MIPS I has lwc1 and swc1, but the l.s and s.s aliases for them were
marked ISA_MIPS2, so the assembler rejected them on MIPS I. Mark them
ISA_MIPS1.
MIPS I has no ldc1 and sdc1. The assembler already expanded s.d into
two swc1 on MIPS I, but rejected l.d, and li.d emitted ldc1. Expand l.d
into two lwc1 and have li.d load the constant with two lwc1, as GAS
does. ldc1 and sdc1 themselves are still rejected, as in GAS.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DAG: Express atomic extload and truncstore legality more like non-atomic
Make legalization of ATOMIC_LOAD behave more like LOAD, and
ATOMIC_STORE more like STORE. Previously atomic legality was decided
by the value type alone. Extending atomic loads now use the atomic
load extension actions, queried with a new getAtomicLoadExtAction
instead of an Atomic flag on getLoadAction. This removes a lot of
noise from the common case without introducing an unsafe default
argument. Truncating atomic stores check the truncating store actions
shared with non-atomic stores since there's no practical usecase for
distinguishing them.
An expanded sign or zero extending atomic load becomes an
any-extending atomic load plus an in-register extend, and an expanded
truncating atomic store of a legal memory type becomes a truncate and
a non-truncating atomic store. Atomic extload support differs from
non-atomic extloads on some targets. All extending atomic loads
default to Expand, unlike load.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>