pci: Accept D3hot in pci_set_powerstate_method()
Since D3 was split into D3hot and D3cold, PCI_POWERSTATE_D3 is D3cold
and the switch rejects D3hot with EINVAL. Devices whose _SxD is 3
(D3hot) then stay in D0 on suspend, and acpi_pci skips their ACPI
transition. LinuxKPI pci_set_power_state(PCI_D3hot) fails the same way.
The PM register has a single D3 state, so write it for both.
Reviewed by: kbowling
Approved by: kbowling
Fixes: 84bbfc32a3f4 ("acpi_powerres: D3cold support")
MFC after: 1 week
Pull Request: https://ron-dev.freebsd.org/FreeBSD/src/pulls/111
[Sparc] Support 64-bit atomics in 32-bit V8+ code (#242578)
Implement 64-bit atomics for 32-bit SPARC when targeting V9 in V8+
mode, mirroring what GCC does:
- 64-bit atomic loads and stores use ldd/std (GCC's atomic_loaddi_1
and atomic_storedi_1).
- 64-bit compare-and-swap packs the 32-bit halves into %g/%o
registers, issues casx and splits the result back, using the same
sequence as GCC's *atomic_compare_and_swapdi_v8plus. Only %g/%o
registers are used for the 64-bit temporaries since those are the
only registers whose upper halves are preserved under the V8+ ABI
(GCC's "h" constraint / I64_REGS class, minus %o7, which holds the
return address in leaf procedures). The pseudo is expanded after
register allocation so no 64-bit value is spilled via a 32-bit slot.
- Other atomic RMW operations are expanded to cmpxchg loops.
The new %g/%o register class can allocate %o registers before %l0 is
used, which breaks the assumption behind the leaf procedure %i -> %o
[22 lines not shown]
[flang][CodeGen] Fix narrowing conversion in genGEP call (#244972)
Fixes a -Wnarrowing error (unsigned -> int32_t) in the genGEP call using
kRankPosInBox, which breaks GCC -Werror builds (seen on the
flang-s390x-linux bot).
tools/build: also stage machine/cpu_flags.h on powerpc
powerpc's machine/elf.h now includes machine/cpu_flags.h, but only elf.h
gets copied into the legacy include directory. Building world natively
on a powerpc host that doesn't have cpu_flags.h installed yet then fails
in libllvmminimal.
Reviewed by: jhibbits
Fixes: 90bc40e26c61 ("powerpc: Split CPU flags into separate file...")
MFC with: 90bc40e26c61
Differential Revision: https://reviews.freebsd.org/D61920
[mlir][ODS] Generate hooks that register the attributes and types of a dialect
Dialects registered their generated attributes and types by expanding
`GET_ATTRDEF_LIST` (or `GET_TYPEDEF_LIST`) into the template arguments
of `addAttributes` (or `addTypes`).
This requires each and every type and attribute and their storage classes' to be defined at the callsite and is generally boilerplate that exists in most dialects.
This PR introduces a single registration hook that is generated by ODS and should be called from dialects' `initialize` method instead. The implementation of the hook now performs the registration.
The motivation and further advantage of this approach is that we can then also change the implementation of the registration method in ODS while keeping API compatibility. This is required for partitioning of attributes and types e.g. (https://github.com/llvm/llvm-project/pull/241935).
Docs have been updated to advise users to use the new registration method. However, no upstream dialect beyond the test dialect has been switched nor is the old method of registration planned to be deprecated as it is still useful in some contexts (e.g., extendible dialects or C++ defined types and attributes).
Co-authored-by: Claude <noreply at anthropic.com>
[APFloat] Support user defined bit conversions (#242370)
[APFloat] Support user provided conversion to/from bits
This change allows users to provide custom functions to convert to/from
bits.
- fltSemantics has function pointers for conversion and user provided
values of it are supported
- built-in semantics also use these instead of chained if, making the
code less repetitive and slightly faster
- APFloat/IEEFloat internals like types and ranges of significand,
mantissa etc. can only be accessed using FloatRepr interface so only
user defined bitcast functions will be affected by changes
Resubmitted https://github.com/llvm/llvm-project/pull/233961 / #240920
with fixes for GCC 7 and MSVC2019
[CodeGen] Honor disabled and reserved CSRs in `getCalleeSavedRegs` (#241593)
Previously, `getCalleeSavedRegs` simply returned the unfiltered TRI CSRs
on its first invocation, even when it had already populated
`UpdatedCSRs`. And calling `disableCalleeSavedRegister` prior to
`getCalleeSavedRegs` initialized `UpdatedCSRs` without filtering out
user-reserved registers.
Additionally, both the prolog/epilog inserter for zeroing call used
registers, and the register usage collector queried
`TRI.getCalleeSavedRegs`, ignoring anything disabled with
`disableCalleeSavedRegister`.
All this led to miscompiles:
https://cpp.compiler-explorer.com/z/rKdcnq7oP
Fixed by correctly returning `UpdatedCSRs` from MRI's
`getCalleeSavedRegs`, filtering user-reserved registers when populating
it, and changing the places to call it rather than TRI.
Assisted-by: Antigravity with Gemini
[clang][Sparc] Define _SOFT_FLOAT instead of SOFT_FLOAT (#245137)
With -msoft-float, Clang defined SOFT_FLOAT to 1. GCC defines
_SOFT_FLOAT, and SOFT_FLOAT is not in the reserved namespace. Do what
GCC does.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
composite: fix a problem with recursed VERBOSE=1 use
eval would pick up the cd .. echoed by make on stdout
instead of stderr, causing commits to run twice and
breaking subsequent runs of the print target. Instead
of retaining the command echo on stderr we simply remove
that feature since debugging the make launch into the
build and composite scripts is not something we need
to debug a lot.
[CIR] Add a split mode to cir-offload-merge
Write each module of an offload container to its own file, named after
the driver's offload files (<stem>-<kind>-<triple>.cir). Combine keeps
the original module name in cir.offload.source_name so split can give
back the modules as they were before combine.
[LoopUnroll] Avoid revisiting shared SCEVs in uniformity checks (#244318)
Checking whether a backedge count is uniform can take exponential time
when its SCEV contains shared subexpressions. Use SCEVExprContains to
visit each node once.
LoopUnroll only checks backedge count uniformity for targets with branch
divergence. The regression test uses AMDGPU to exercise that check.
Assisted-by: OpenAI Codex
ng_ether: restore promisc from classification
Reclassify frames returned through the upper hook before passing
them to ether_demux(). This prevents foreign unicast frames
from reaching upper protocol layers while preserving CARP
destination handling.