Commit Graph

2530 Commits

Author SHA1 Message Date
Jonathan Brouwer
c81d09ca81 Rollup merge of #161667 - beetrees:f16-inline-asm-nvptx, r=folkertdev
Add `f16` inline ASM support for `nvptx64-nvidia-cuda`

This PR adds `f16` inline ASM support for `nvptx64-nvidia-cuda`.

Ping target maintainers: @kjetilkjeka @kulst

Tracking issues:
`f16` inline ASM: rust-lang/rust#125398 (part of rust-lang/rust#116909)
PTX inline ASM: rust-lang/rust#93335
2026-09-22 22:50:32 +02:00
Jonathan Brouwer
4d635106d9 Rollup merge of #162325 - RalfJung:aix-abi, r=beetrees
powerpc64-ibm-aix: fix cfg(target_abi) value

Our powerpc64-ibm-aix target currently sets `cfg_abi` to "vec-extabi", which means that programs compiled for this target *think* they use that ABI. Even our inline asm logic trusts this field. But that's a lie, we're actually using the default ABI since we are never setting `EnableAIXExtendedAltivecABI` on the LLVM side. We should fix that discrepancy.

Between changing how we generate the code, and changing the label we put into `cfg_abi`, the latter is the less risky change. So let's do that.

This has been tried before in https://github.com/rust-lang/rust/pull/153830. We then decided to wait a bit while the target maintainers investigate whether they want to change the ABI or not. I think we have waited long enough. The last comment from them that I found is [this one](https://github.com/rust-lang/rust/issues/153876#issuecomment-4101480953) which says "I'd conclude the extend vector ABI should be disabled for now"; there have been further questions but no further communication. We can always still change the ABI in the future, but for now let's fix the obvious bug where the ABI we report in `cfg_abi` does not match the actual ABI we are compiling for.

Cc @Gelbpunkt @daltenty @gilamn5tr @amy-kwan @taiki-e
2026-09-22 17:06:45 +02:00
Bee
baf4778d7c Add f16 inline ASM support for nvptx64-nvidia-cuda 2026-09-22 14:40:53 +01:00
Ralf Jung
7dc9aeebf8 remove incorrect cfg_abi check from asm/powerpc; that makes CfgAbi::VecExtAbi basically unused so remove it 2026-09-22 09:09:52 +02:00
Ralf Jung
22e16a4eae powerpc64-ibm-aix: fix cfg(target_abi) value 2026-09-21 18:33:12 +02:00
Jonathan Brouwer
e1b8be29ff Rollup merge of #160859 - Jamesbarford:feat/fb16-pt1, r=folkertdev,tgross35
`core::num::f16b` Rust's 16bit Brain Float

Implements the [RFC: f16b type](https://github.com/rust-lang/rfcs/pull/3983). Best reviewed commit by commit, happy to split into separate PRs if that is deemed easier to review. However the line count and surface area is, in my opinion, reasonably small.

Adds;
- ABI plumbing for the `f16b` along with `bfloat` lang item to work with LLVM, GCC is explicitly `unimplemented!(...)`
- `f16b` feature gate, page for `f16b` on libruscdoc and a `struct bf16` in `core::num`
- Tests
- Treat `f16b` as a scalar primitive for scalable vectors

Issues;
- [Tracking Issue](https://github.com/rust-lang/rust/issues/160630)
- [RFC](https://github.com/rust-lang/rfcs/pull/3983)
2026-09-21 15:19:23 +02:00
James Barford-Evans
cdde2f00b5 Add F16B to Float enum & wireup trivial matches 2026-09-21 08:57:51 +01:00
Jonathan Brouwer
73cf3019a8 Rollup merge of #160401 - folkertdev:sparc-abi-fixes, r=beetrees
sparc: make ABI consistent with clang

fixes https://github.com/rust-lang/rust/issues/43894

I've hacked together a version of abi-cafe that can cross-compile. It finds many GCC vs. Clang inconsistencies, but for this target it found 3 ABI bugs that are specific to the rust implementation.

For reference

- [`SparcV8ABIInfo::{classifyArgumentType, classifyReturnType}`](6849789a8f/clang/lib/CodeGen/Targets/Sparc.cpp (L34-L59))
- [`DefaultABIInfo::{classifyArgumentType, classifyReturnType}`](6849789a8f/clang/lib/CodeGen/ABIInfoImpl.cpp (L17-L68))

## Pass ZST arguments

https://godbolt.org/z/P7KoqTWvr

The `sparc` ABI does not skip zero-sized arguments.

## Pass and return `f128` (i.e. `long double`) indirectly

The `long double` type, which corresponds to rust `f128`, is special-cased, it uses `getNaturalAlignIndirect` for both arguments and returns.

## pass aggregate arguments by reference

https://godbolt.org/z/hM8Gh1bfY

The implementation defers to `DefaultABIInfo::{classifyReturnType, classifyArgumentType}`, which use `byval` and `sret` for aggregate types.
2026-09-18 23:05:17 +02:00
bors
498b89dd40 Auto merge of #161583 - RalfJung:x86-sse-abi, r=nikic
x86: on targets that requires SSE, use those registers for ABI



Now that https://github.com/llvm/llvm-project/issues/142321 is fixed, we can use the vector ABI without re-introducing https://github.com/rust-lang/rust/issues/139029. So this effectively reverts https://github.com/rust-lang/rust/pull/141309.

Since this means we are relying on the SSE target feature for the Rust ABI, we also need to turn the ABI target feature check into a hard error. If we don't do that, we'll get post-mono errors in some situations and plain miscompilations in others.

Also this will cause performance regressions on LLVM 22 and 21 as those don't have the fix for  https://github.com/llvm/llvm-project/issues/142321. IMO that's fine. Programs will do the right thing, they will just be a bit slower due to https://github.com/rust-lang/rust/issues/139029.

r? @nikic 
Cc @tgross35
2026-09-18 04:48:34 +00:00
Jonathan Brouwer
370012b288 Rollup merge of #162552 - TechnoPorg:riscv-feature-zmmul, r=beetrees
RISC-V: Add Zmmul target feature

Zmmul is a ratified subset of the M extension that only supports multiplication, but not division ([spec](https://docs.riscv.org/reference/isa/v20260120/unpriv/m-st-ext.html#11-1-3-zmmul-extension-version-1-0)). LLVM already supports the extension under the same name, so until rust-lang/rust#162235 I'd just been using it directly.

There are two things I would particularly appreciate input on:

- Should M imply Zmmul?
  - From the [Machine-Level ISA spec](https://docs.riscv.org/reference/isa/v20260120/priv/machine.html) and [this discussion](https://github.com/riscv/riscv-isa-manual/issues/869) in the RISC-V ISA Manual repo, it seems that Zmmul means all multiplication instructions are always supported, whereas M means they're only supported if the M bit is set in the `misa` register.
  - On the other hand, LLVM has M imply Zmmul ([RISCVFeatures.td](f6f71edb43/llvm/lib/Target/RISCV/RISCVFeatures.td (L214-L229))), so it feels nice to match that.
- How might I go about stabilizing this?
  - Can it be done right away?
  - Should it wait a few releases?
  - Is it better to batch it with the stabilization of other RISC-V target features, similarly to how it was done in rust-lang/rust#145948?

No LLMs were used in the making of this PR, and all mistakes are those of a first-time rustc contributor.
2026-09-17 21:00:09 +02:00
Jonathan Brouwer
85779afa09 Rollup merge of #161987 - folkertdev:single-fp-element, r=beetrees
fix `is_single_fp_element` for `s390x` and `x86`

In https://github.com/rust-lang/rust/pull/161950#discussion_r3886952310 we discovered that the old `is_single_fp_element` is incorrect in a number of ways.

- it did not consider `f16` or `f128`
- it did not consider transparent wrappers
- on x86, it incorrectly accepted over-aligned types
- on s390x, it incorrectly accepted single-element unions and arrays

So, in practice each target does something slightly different here, and I've split the function into two.

cc @beetrees
2026-09-17 21:00:08 +02:00
Ralf Jung
429c1c18ca x86: on targets that requires SSE, use those registers for ABI 2026-09-17 08:03:01 +02:00
Folkert de Vries
8aff3e62f2 wasm: fix ABI of repr(int) enums with ZST fields 2026-09-15 23:10:34 +02:00
Folkert de Vries
9dcbee96b3 add RegKind::from_primitive 2026-09-15 23:01:10 +02:00
Folkert de Vries
9d60f8642c rename unwrap_trivial_aggregate -> is_aggregate_for_abi 2026-09-15 22:22:24 +02:00
Folkert de Vries
e251a4ba98 wasm: return early on f128/i128
changes in later commits need this case out of the way
2026-09-15 21:44:13 +02:00
Jonathan Brouwer
af5ab5897b Rollup merge of #162806 - folkertdev:wasm-union-abi, r=alexcrichton
wasm: correctly implement `union` trivial aggregates

A union with two scalar fields, even if they overlap exactly, is not a trivial aggregate, based on the implementation in `clang`:

e78970f80f/clang/lib/CodeGen/ABIInfoImpl.cpp (L338-L402)

It never explicitly considers unions, but essentially views them as records. The `clang` implementation is a plausible interpretation of the specification (though I'd like it to be a bit clearer):

83e5d715d0/BasicCABI.md (function-arguments-and-return-values)

> [2] Any struct or union that recursively (including through nested structs, unions, and arrays) contains just a single scalar value and is not specified to have greater than natural alignment.

We previously got this wrong. I also don't think this was really tested very well, so I added a bunch of test for various cases.

This change moves away from using the `homogeneous_aggregate` method, which is convenient because it is a bit broken and now we don't have to consider wasm when we fix that.

I've validated this against `clang` with abi-cafe.

r? alexcrichton
2026-09-15 16:46:25 +02:00
Folkert de Vries
417882b7cb wasm: correctly implement union trivial aggregates
A union with two scalar fields, even if they overlap exactly, is not a trivial aggregate
2026-09-15 13:24:43 +02:00
Jonathan Brouwer
3821b7471e Rollup merge of #160911 - adamgemmell:dev/adagem01/remove-d32, r=Amanieu
Remove d32 feature from 32-bit Arm targets

Fixes https://github.com/rust-lang/rust/issues/159973

In https://github.com/rust-lang/rust/pull/149512/ I removed `-d32` from some specs, but since LLVM enables `neon` by default for v7 targets `d32` was left enabled while it should be optional on this target. For a similar reason `-d32` was removed from some armv6 targets and has been readded.

This PR adds a test to ensure this specific instance does not happen again and has been tested locally on armv7-unknown-linux-gnueabihf, armv7a-none-eabihf and arm-unknown-linux-gnueabihf.

It might be a good idea in general to have a test that runs `--print cfg` and captures the set of rust target features enabled to show when PRs change them, but most of these targets are not run in Rust's CI so it's out of scope for this issue.

For reference, here is the manually-expanded LLVM features and their implications - necessary as these targets rely on a feature from LLVM that Rust doesn't yet expose:

```
vfp4 -> vfp3 + fp16 + vfp4d16 + vfp4sp
vfp4d16 -> vfp3d16 + fp16 + fp64 + vfp4d16sp
vfp4sp -> vfp3sp + fp16 + d32 + vfp4d16sp
vfp4d16sp -> vfp3d16sp + fp16
vfp3 -> vfp2 + vfp3d16 + vfp3sp
vfp3d16 -> vfp2 + fp64 + vfp3d16sp
vfp3sp -> vfp2 + d32 + vfp3d16sp
vfp3d16sp -> vfp2sp
vfp2 -> vfp2sp + fp64
vfp2sp -> fpregs
```
2026-09-15 09:32:28 +02:00
Jonathan Brouwer
5c301f6b33 Rollup merge of #162610 - malezjaa:fix-tailcall-indirect-return, r=folkertdev
fix tailcall indirect return

Fixes rust-lang/rust#162585

This branch should only be intended for arguments, but it also marked return values as being passed on the stack. It later caused codegen to panic because return values can't use `on_stack`.
2026-09-14 15:15:57 +02:00
Jonathan Brouwer
09c7c12af1 Rollup merge of #161903 - nnethercote:fix-target_config-cycle, r=nikic
Fix initialization cycle in `target_config`

There is an initialization cycle in `target_config`. Details in the final commit. The previous commits are precursors that support the changes in the final commit.

r? @nikic
cc @cuviper @RalfJung @Zalathar @Patryk27
2026-09-14 15:15:56 +02:00
Folkert de Vries
ee524a2ab7 fix is_single_fp_element for s390x and x86 2026-09-14 01:17:42 +02:00
Folkert de Vries
a44d3adcff sparc: pass and return f128 indirectly and return aggregates indirectly
long double (i.e. f128) is special-case in the sparc abi
2026-09-13 21:45:02 +02:00
malezjaa
bb6549342f fix tailcall indirect return 2026-09-13 21:08:28 +02:00
Folkert de Vries
2324b37d3d sparc: pass ZST arguments 2026-09-13 20:58:08 +02:00
Roland Xu
430e887aae Rollup merge of #161385 - RalfJung:riscv-d-f, r=mejrs
riscv: stabilize 'd' and 'f' target features

https://github.com/rust-lang/rust/pull/156188 has been reverted in https://github.com/rust-lang/rust/pull/161064 due to concerns about "e" being a negative target feature.

"d" and "f" however are almost normal target features, so let's re-land them.
The one thing that's odd about them is that we cannot allow you to use `-Ctarget-feature` or `#[target_feature]` for them on *some* riscv ABIs. (For now, it remains unstable on all riscv ABIs.) So this means we need the concept of target-features that are fixed by the target spec and cannot be changed by the user. OTOH we kind of already have that, even for fully stable target features:
- On x86-64, we don't let people disable "sse2". On aarch64, we don't let people disable "neon".
- [Soon](https://github.com/rust-lang/rust/pull/160302), on x86-64 softfloat, we don't let people enable "sse2".

"neon" and "sse2" are even stable target features. So  I see no reason not to fully stabilize "d" and "f", with the following constraints:
- on riscv targets that use a "d" ABI (ilp32d, lp64d), you can't disable either of them
- on riscv targets that use an "f" ABI (ilp32f, lp64f), you can't disable "f"
- on riscv ilp32e targets, you can't *enable* "d"

Cc @romancardenas
2026-09-13 09:39:01 +08:00
TechnoPorg
d609aff297 Tweak wording of comment in target_features.rs 2026-09-11 08:42:35 -04:00
Jieyou Xu
c5eb55cb8b Fix target spec metadata for i686-pc-windows-msvc
We no longer ship host tools for this target.
2026-09-11 16:22:31 +08:00
Jacob Pratt
b1baa4f7b9 Rollup merge of #162546 - heiher:loong64-gnu-lld-nightly, r=chenyukang
Use lld by default on `loongarch64-unknown-linux-gnu` nightly

This PR makes LLD the default linker for `loongarch64-unknown-linux-gnu` on nightly.

As a prerequisite, it aligns the LoongArch64 Linux `LOAD` segment layout of LLD and other GNU-compatible linkers with GNU ld. This keeps the layout consistent and allows Linux to make better use of file-backed PMD mappings.

The LLD default is initially limited to nightly to allow some soak time before rolling it out to beta and stable.

To opt out of using LLD, `RUSTFLAGS="-Clinker-features=-lld"` would be used. To opt out of using rust-lld, falling back to the LLD installed on the system, `RUSTFLAGS="-Clink-self-contained=-linker"` would be used.
2026-09-11 00:03:11 -04:00
Mateusz Mikuła
6d92da7642 Update windows-gnu support docs 2026-09-10 20:46:58 +02:00
TechnoPorg
7a6e24abe1 Document interaction between "m" and "zmmul" 2026-09-10 08:33:36 -04:00
TechnoPorg
0c8e36095d RISC-V: Add zmmul target feature 2026-09-09 15:36:33 -04:00
WANG Rui
25ee3c3d58 Align LoongArch64 Linux segments with GNU LD
Configure the LoongArch64 Linux targets to place read-only code in the
first LOAD segment when linking with LLD, mold, and other GNU-compatible
linkers.

This keeps the segment layout consistent with GNU ld and allows Linux to
make better use of file-backed PMD mappings, reducing iTLB misses.
2026-09-09 23:55:06 +08:00
Stuart Cook
b2e166a43b Rollup merge of #162505 - PiJoules:revert-fuchsia-safestack-default, r=chenyukang
Revert "fuchsia: Add safestack as a supported sanitizer for x86_64 fuchsia"

This reverts commit 7a44484407.

This is leading to the issue seen in
https://github.com/rust-lang/rust/issues/162272. We're also seeing the same build issues when using a rust toolchain that contains this commit for building fuchsia targets.
2026-09-09 16:25:20 +10:00
Leonard Chan
3206f026cf Revert "fuchsia: Add safestack as a supported sanitizer for x86_64 fuchsia"
This reverts commit 7a44484407.

This is leading to the issue seen in
https://github.com/rust-lang/rust/issues/162272. We're also seeing the
same build issues when using a rust toolchain that contains this commit
for building fuchsia targets.
2026-09-08 22:37:07 +00:00
Jonathan Brouwer
37719fa2b6 Rollup merge of #160712 - mati865:gnullvm-static-libunwind, r=petrochenkov
windows-gnullvm: always link libunwind statically

Previously shared library was used by default, meaning that programs and libraries couldn't be loaded if `libunwind.dll` was missing from the PATH. Using Wine (on Linux) because it better shows the problem (and is more convenient):
```
❯ cargo new hello &> /dev/null

❯ cargo rustc --target x86_64-pc-windows-gnullvm &> /dev/null

❯ wine target/x86_64-pc-windows-gnullvm/debug/hello.exe
0024:err:module:import_dll Library libunwind.dll (which is needed by L"Z:\\tmp\\hello\\target\\x86_64-pc-windows-gnullvm\\debug\\hello.exe") not found
0024:err:module:loader_init Importing dlls for L"Z:\\tmp\\hello\\target\\x86_64-pc-windows-gnullvm\\debug\\hello.exe" failed, status c0000135

❯ llvm-readobj --coff-imports target/x86_64-pc-windows-gnullvm/debug/hello.exe
...
Import {
  Name: libunwind.dll
  ImportLookupTableRVA: 0x3D308
  ImportAddressTableRVA: 0x3D678
  Symbol: _GCC_specific_handler (0)
  Symbol: _Unwind_DeleteException (0)
  Symbol: _Unwind_GetDataRelBase (0)
  Symbol: _Unwind_GetIPInfo (0)
  Symbol: _Unwind_GetLanguageSpecificData (0)
  Symbol: _Unwind_GetRegionStart (0)
  Symbol: _Unwind_GetTextRelBase (0)
  Symbol: _Unwind_RaiseException (0)
  Symbol: _Unwind_Resume (0)
  Symbol: _Unwind_SetGR (0)
  Symbol: _Unwind_SetIP (0)
}
...
```
Optionally libunwind could be linked statically via `+crt-static`:
```
❯ cargo rustc --target x86_64-pc-windows-gnullvm -- -C target-feature=+crt-static &> /dev/null

❯ wine target/x86_64-pc-windows-gnullvm/debug/hello.exe
Hello, world!

❯ llvm-readobj --coff-imports target/x86_64-pc-windows-gnullvm/debug/hello.exe | rg 'libunwind.dll' || echo "doesn't depend on shared libunwind"
doesn't depend on shared libunwind
```

After a discussion of approach in rust-lang/rust#159782 with @bjorn3 (thanks BTW!), I changed the proposed approach to always link static libunwind.

I don't have a good solution for https://github.com/rust-lang/rust/pull/121794 that will resurface. I guess the user has three options:
- symlink `libunwind.dll.a` as `libunwind.a`
- add `--unwindlib=none -lunwind` to the linker args
- create linker wrapper
- use self-contained mode which is likely is undesirable

I think the ease of use (not having to deal with additional DLL dependency) outweights the benefit of working with incomplete C toolchain.

The size bloat is also not a problem, sizes (in bytes) of the binary for the literal hello world project:
- debug build:
  - shared libunwind 4194816
  - static libunwind 4323328
- release build:
  - shared libunwind 382464
  - static libunwind 423424

Debug diff +125.5 KiB, release diff: +40 KiB.
Size of `libunwind.dll` that has to be provided when linking shared libunwind: 204288 bytes (199.5 KiB).
2026-09-08 18:19:37 +02:00
Jacob Pratt
4e27adb224 Rollup merge of #161697 - folkertdev:complex-sparc64-powerpc64, r=JohnTitor
make `Complex` ABI-compatible on sparc64 and powerpc64

tracking issue: https://github.com/rust-lang/rust/issues/154023

Make the ABI for `Complex` match C for two slightly more involved targets.

For Sparc64 the implementation matches GCC and Clang 24 and up. In https://github.com/llvm/llvm-project/pull/215015 a bug with how small complex numbers are passed was fixed.

For powerpc64 we match Clang exactly (and Clang is compatible with GCC for this target).

cc @beetrees @Gelbpunkt
2026-09-07 04:06:30 -04:00
bors
f207aa3913 Auto merge of #162333 - Zalathar:rollup-DdpfsFl, r=Zalathar
Rollup of 14 pull requests

Successful merges:

 - rust-lang/rust#162324 (miri subtree update)
 - rust-lang/rust#162170 (bootstrap: use target's LLVM libdir when cross-compiling)
 - rust-lang/rust#158312 (Adds support for AArch64 SVE to inline assembly)
 - rust-lang/rust#159792 (A more readable debug map for IndexMaps)
 - rust-lang/rust#160745 (make closures act like MaybeDangling)
 - rust-lang/rust#161263 (break rustc_expand-rustc_middle dependency)
 - rust-lang/rust#161895 (std::sys::pal::sgx: fix mismatched alloc/free alignment)
 - rust-lang/rust#161940 (Promote `wasm32-wasip3` to a tier 2 target)
 - rust-lang/rust#161397 (coverage: Tidy tests and add some new ones)
 - rust-lang/rust#161616 (Report precondition violation for `<usize as SliceIndex>::get_unchecked` in const-eval)
 - rust-lang/rust#162248 (Add regression test for unsized const parameter default ICE)
 - rust-lang/rust#162250 (Fix hashing of span end columns in incremental compilation)
 - rust-lang/rust#162265 (cargotest: add lockfiles)
 - rust-lang/rust#162318 (bootstrap: Fix broken path for `./x doc compiler/rustc --open`)
2026-09-05 17:04:57 +00:00
Stuart Cook
eaa6c852f5 Rollup merge of #161940 - alexcrichton:wasip3, r=davidtwco
Promote `wasm32-wasip3` to a tier 2 target

This commit updates documentation, configuration, etc, within the compiler to promote the `wasm32-wasip3` target to tier 2. This means that precompiled binaries will be made available in `rustup` for usage. This target MCP for this change is [rust-lang/compiler-team/100][mcp].

This target requires LLVM 23 which rustc recently has updated to, and then additionally requires wasi-sdk-34 which additionally uses LLVM 23 which was also updated recently. With these ingredients in place the ABI for `wasm32-wasip3` is all lined up and ready to go. These changes were all necessary to bring cooperative threading to the target in the future, but that's not quite ready in the ecosystem yet.

I've locally been testing this target and it's done well so far, but I suspect this'll need subsequent bug fixes here and there as other new issues crop up. I don't expect anything major will be necessary, however.

[mcp]: https://github.com/rust-lang/compiler-team/issues/1001
2026-09-05 23:04:49 +10:00
Jonathan Brouwer
e82904d34b Rollup merge of #161394 - folkertdev:arm-aarch64-hva-vector-unit, r=davidtwco
fix `is_homogeneous_aggregate`: use unit size, not total size

fixes https://github.com/rust-lang/rust/issues/161382

The vector case of the three (arm, aarch64, powerpc64) `is_homogeneous_aggregate` implementations looked at the total type size, instead of the unit size.

blocked on https://github.com/rust-lang/rust/pull/161070 merging

r? davidtwco
2026-09-04 22:29:07 +02:00
Jonathan Brouwer
1a6452f354 Rollup merge of #162072 - ZephyrCodesStuff:main, r=davidtwco
Add new Tier-3 target: `powerpc64-sony-ps3`

Implements a compatible target for the Sony PlayStation 3 console's PPU processor.

> A tier 3 target must have a designated developer or developers (the “target maintainers”) on record to be CCed when issues arise regarding the target. (The mechanism to track and CC such developers may evolve over time.)

I ([@ZephyrCodesStuff](https://github.com/ZephyrCodesStuff)) am the maintainer and developer, both for this PR's target, as well as a [Rust PS3 SDK](https://github.com/zephyrcodesstuff/rust-ps3) to help developers get started.

> Targets must use naming consistent with any existing targets; for instance, a target for the same CPU or OS as an existing Rust target should use the same name for that CPU or OS. Targets should normally use the same names and naming conventions as used elsewhere in the broader ecosystem beyond Rust (such as in other toolchains), unless they have a very good reason to diverge. Changing the name of a target can be highly disruptive, especially once the target reaches a higher tier, so getting the name right is important even for a tier 3 target.

Addressed. The PPU is a standard `powerpc64` core, with only marginal changes made for the PS3's hardware configuration. `sony` is used among other Sony console targets, and `ps3` is the console's shorthand.

> Target names should not introduce undue confusion or ambiguity unless absolutely necessary to maintain ecosystem compatibility. For example, if the name of the target makes people extremely likely to form incorrect beliefs about what it targets, the name should be changed or augmented to disambiguate it.
If possible, use only letters, numbers, dashes and underscores for the name. Periods (.) are known to cause issues in Cargo.

Addressed.

> Tier 3 targets may have unusual requirements to build or use, but must not create legal issues or impose onerous legal terms for the Rust project or for Rust developers or users.
The target must not introduce license incompatibilities.

Although it does require a separate linker (`mold`) and a post-fix binary patching tool (included in the SDK above), no part of the build process, from the code, to the compiler, linker or SDK are closed-source. This target is compatible with the aformentioned SDK without any reliance on community "homebrew" tools, nor any licensed Sony / SN Systems compiler or linker.

> Anything added to the Rust repository must be under the standard Rust license (MIT OR Apache-2.0).

All of my code in this PR, including the SDK above, are licensed `MIT OR Apache-2.0`.

> The target must not cause the Rust tools or libraries built for any other host (even when supporting cross-compilation to the target) to depend on any new dependency less permissive than the Rust licensing policy. This applies whether the dependency is a Rust crate that would require adding new license exceptions (as specified by the tidy tool in the rust-lang/rust repository), or whether the dependency is a native library or binary. In other words, the introduction of the target must not cause a user installing or running a version of Rust or the Rust tools to be subject to any new license requirements.
Compiling, linking, and emitting functional binaries, libraries, or other code for the target (whether hosted on the target itself or cross-compiling from another target) must not depend on proprietary (non-FOSS) libraries. Host tools built for the target itself may depend on the ordinary runtime libraries supplied by the platform and commonly used by other applications built for the target, but those libraries must not be required for code generation for the target; cross-compilation to the target must not require such libraries at all. For instance, rustc built for the target may depend on a common proprietary C runtime library or console output library, but must not depend on a proprietary code generation library or code optimization library. Rust’s license permits such combinations, but the Rust project has no interest in maintaining such combinations within the scope of Rust itself, even at tier 3.

Addressed.

> “onerous” here is an intentionally subjective term. At a minimum, “onerous” legal/licensing terms include but are not limited to: non-disclosure requirements, non-compete requirements, contributor license agreements (CLAs) or equivalent, “non-commercial”/“research-only”/etc terms, requirements conditional on the employer or employment of any particular Rust developers, revocable terms, any requirements that create liability for the Rust project or its developers or users, or any requirements that adversely affect the livelihood or prospects of the Rust project or its developers or users.
Neither this policy nor any decisions made regarding targets shall create any binding agreement or estoppel by any party. If any member of an approving Rust team serves as one of the maintainers of a target, or has any legal or employment requirement (explicit or implicit) that might affect their decisions regarding a target, they must recuse themselves from any approval decisions regarding the target’s tier status, though they may otherwise participate in discussions.

All of the components are free, open-source software.

> This requirement does not prevent part or all of this policy from being cited in an explicit contract or work agreement (e.g. to implement or maintain support for a target). This requirement exists to ensure that a developer or team responsible for reviewing and approving a target does not face any legal threats or obligations that would prevent them from freely exercising their judgment in such approval, even if such judgment involves subjective matters or goes beyond the letter of these requirements.

Addressed.

> Tier 3 targets should attempt to implement as much of the standard libraries as possible and appropriate (core for most targets, alloc for targets that can support dynamic memory allocation, std for targets with an operating system or equivalent layer of system-provided functionality), but may leave some code unimplemented (either unavailable or stubbed out as appropriate), whether because the target makes it impossible to implement or challenging to implement. The authors of pull requests are not obligated to avoid calling any portions of the standard library on the basis of a tier 3 target not implementing those portions.

This target currently does not support the `std` library, but can fully support the `core` and `alloc` feature-sets. Tested and verified on official hardware with the aid of the SDK above.

> The target must provide documentation for the Rust community explaining how to build for the target, using cross-compilation if possible. If the target supports running binaries, or running tests (even if they do not pass), the documentation must explain how to run such binaries or tests for the target, using emulation if possible or dedicated hardware if necessary.

Documentation is included, both in this PR's Markdown files, as well as the SDK's repository.

> Tier 3 targets must not impose burden on the authors of pull requests, or other developers in the community, to maintain the target. In particular, do not post comments (automated or manual) on a PR that derail or suggest a block on the PR based on a tier 3 target. Do not send automated messages or notifications (via any medium, including via @) to a PR author or others involved with a PR regarding a tier 3 target, unless they have opted into such messages.

This target should not cause issues, as its scope is relatively limited to Sony PlayStation 3 development.

> Backlinks such as those generated by the issue/PR tracker when linking to an issue or PR are not considered a violation of this policy, within reason. However, such messages (even on a separate repository) must not generate notifications to anyone involved with a PR who has not requested such notifications.

Noted.

> Patches adding or updating tier 3 targets must not break any existing tier 2 or tier 1 target, and must not knowingly break another tier 3 target without approval of either the compiler team or the maintainers of the other tier 3 target.

This patch does not touch any other target.

> In particular, this may come up when working on closely related targets, such as variations of the same architecture with different features. Avoid introducing unconditional uses of features that another variation of the target may not have; use conditional compilation or runtime detection, as appropriate, to let each target run code supported by that target.

This target only has one feature, `+altivec`, universally supported on any Sony PlayStation 3 unit.

> Tier 3 targets must be able to produce assembly using at least one of rustc’s supported backends from any host target. (Having support in a fork of the backend is not sufficient, it must be upstream.)

Artifacts built by this target are confirmed to be fully functional on official hardware, once linked with the `mold` linker and patched by the SDK toolchain.
2026-09-04 22:28:58 +02:00
Folkert de Vries
9e53b26932 make PowerPC64 Complex ABI GCC-compatible 2026-09-04 16:50:41 +02:00
Folkert de Vries
821527b611 make SPARC64 Complex ABI GCC-compatible 2026-09-04 16:50:41 +02:00
Folkert de Vries
a305a9c3b6 fix is_homogeneous_aggregate: use unit size, not total size 2026-09-04 16:15:13 +02:00
Amanieu d'Antras
c91f5cb687 Gate asm support for SVE under asm_experimental_reg 2026-09-04 13:29:49 +00:00
Amanieu d'Antras
51b3f52eab Merge zreg into vreg and keep ffr in a clobber-only class 2026-09-04 13:29:17 +00:00
Reuben Cruise
7b2bfecd72 Adds support for AArch64 SVE to inline assembly
Adds new `zreg` register type and `SveVec*` variants to `InlineAsmType`
2026-09-04 13:29:17 +00:00
Reuben Cruise
cbe88adf39 Creates new InlineAsmSize enum
Facilitates scalable vector support in inline assembly.
2026-09-04 13:29:17 +00:00
Ralf Jung
dc66d145d7 fully stabilize d, f 2026-09-04 13:58:41 +02:00
Ralf Jung
55c68a8af0 do not stabilize 'e' 2026-09-04 13:58:21 +02:00