about summary refs log tree commit diff
path: root/compiler/rustc_target/src/callconv/mod.rs
AgeCommit message (Collapse)AuthorLines
2025-07-28use let chains in mir, resolve, targetKivooeo-12/+10
2025-07-07compiler: Parse `p-` specs in datalayout string, allow definition of custom ↵Edoardo Marangoni-2/+2
default data address space
2025-06-16Fix RISC-V C function ABI when passing/returning structs containing floatsbeetrees-27/+57
2025-06-14Remove all support for wasm's legacy ABIbjorn3-10/+3
2025-06-08Rollup merge of #142053 - heiher:loong32-none, r=wesleywiserJubilee-2/+2
Add new Tier-3 targets: `loongarch32-unknown-none*` MCP: https://github.com/rust-lang/compiler-team/issues/865 NOTE: LoongArch32 ELF object support is available starting with object v0.37.0.
2025-06-06Add new Tier-3 targets: `loongarch32-unknown-none*`WANG Rui-2/+2
MCP: https://github.com/rust-lang/compiler-team/issues/865
2025-06-04x86 (32/64): go back to passing SIMD vectors by-ptrRalf Jung-22/+5
2025-06-03compiler: actually remove Conv now that it is irrelevantJubilee Young-101/+0
2025-06-03compiler: simplify TargetOptions ABI functionsJubilee Young-1/+0
`adjust_abi` is not needed and `is_abi_supported` can be a 1-liner.
2025-06-03compiler: change Conv to CanonAbiJubilee Young-3/+3
2025-06-03compiler: add AbiMapJubilee Young-0/+1
- Add AbiMapping for encoding the nuance of deprecated ABIs
2025-05-17Rollup merge of #135808 - tiif:conv_display, r=workingjubileeMatthias Krüger-0/+32
Implement Display for ``rustc_target::callconv::Conv`` Follow up of https://github.com/rust-lang/rust/pull/133103#discussion_r1885552854
2025-05-12Use unreachable instead of panictiif-1/+1
Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com>
2025-04-07mitigate MSVC unsoundness by not emitting alignment attributes on win32-msvc ↵Ralf Jung-0/+1
targets also mention the MSVC alignment issue in platform-support.md
2025-04-06remove compiler support for `extern "rust-intrinsic"` blocksSkgland-8/+5
2025-04-04Rollup merge of #138949 - madsmtm:rename-to-darwin, r=WaffleLapkinMatthias Krüger-1/+1
Rename `is_like_osx` to `is_like_darwin` Replace `is_like_osx` with `is_like_darwin`, which more closely describes reality (OS X is the pre-2016 name for macOS, and is by now quite outdated; Darwin is the overall name for the OS underlying Apple's macOS, iOS, etc.). ``@rustbot`` label O-apple r? compiler
2025-03-25Rename `is_like_osx` to `is_like_darwin`Mads Marquart-1/+1
2025-03-25make -Zwasm-c-abi=legacy suppress the lintRalf Jung-1/+1
2025-03-12Remove invalid Convtiif-9/+8
2025-03-12fmttiif-8/+8
2025-03-12Implement Display by mapping Conv to ExternAbitiif-26/+27
2025-03-12impl Display for Convtiif-0/+32
2025-03-07Rollup merge of #137363 - workingjubilee:untangle-x86-abi-impl, r=jieyouxuJacob Pratt-1/+6
compiler: factor Windows x86-32 ABI impl into its own file While it shares more than zero code with the SysV x86-32 ABI impl, there is no particular reason to organize wildly different ABIs using if-else in the same function.
2025-03-05compiler: factor Windows x86-32 ABI impl into its own fileJubilee Young-1/+6
While it shares more than zero code with the SysV x86-32 ABI impl, there is no particular reason to organize wildly different ABIs using if-else in the same function.
2025-02-28rename BackendRepr::Vector → SimdVectorRalf Jung-3/+3
2025-02-20Rollup merge of #137318 - bjorn3:cg_clif_abi_workaround, r=workingjubileeJubilee-1/+3
Workaround Cranelift not yet properly supporting vectors smaller than 128bit While it would technically be possible to workaround this in cg_clif, it quickly becomes very messy and would likely cause correctness issues. Working around it in rustc instead is much simper and won't have any negative impact for code running on stable as vectors smaller than 128bit can only be made on nightly using core::simd or #[repr(simd)].
2025-02-20Remove `BackendRepr::Uninhabited`, replaced with an `uninhabited: bool` ↵Zachary S-2/+1
field in `LayoutData`. Also update comments that refered to BackendRepr::Uninhabited.
2025-02-20Workaround Cranelift not yet properly supporting vectors smaller than 128bitbjorn3-1/+3
While it would technically be possible to workaround this in cg_clif, it quickly becomes very messy and would likely cause correctness issues. Working around it in rustc instead is much simper and won't have any negative impact for code running on stable as vectors smaller than 128bit can only be made on nightly using core::simd or #[repr(simd)].
2025-02-18x86-sse2 ABI: use SSE registers for floats and SIMDRalf Jung-44/+74
2025-02-12Rollup merge of #136807 - ↵Jacob Pratt-4/+2
workingjubilee:merge-gpus-to-get-the-arcradeongeforce, r=bjorn3 compiler: internally merge `PtxKernel` into `GpuKernel` r? ``@bjorn3`` for review
2025-02-10compiler: die immediately instead of handling unknown target codegenJubilee Young-22/+3
We cannot produce anything useful if asked to compile unknown targets. We should handle the error immediately at the point of discovery instead of propagating it upward, and preferably in the simplest way: Die. This allows cleaning up our "error-handling" spread across 5 crates.
2025-02-09compiler: internally merge `Conv::PtxKernel` into `GpuKernel`Jubilee Young-4/+2
It is speculated that these two can be conceptually merged, and it can start by ripping out rustc's notion of the PtxKernel call convention. Leave the ExternAbi for now, but the nvptx target now should see it as just a different way to spell Conv::GpuKernel.
2025-02-07compiler: remove reexports from rustc_target::callconvJubilee Young-3/+2
2025-02-06compiler: make rustc_target have less weird reexportsJubilee Young-9/+11
rustc_target has had a lot of weird reexports for various reasons, but now we're at a point where we can actually start reducing their number. We remove weird shadowing-dependent behavior and import directly from rustc_abi instead of doing weird renaming imports. This is only incremental progress and does not entirely fix the crate.
2025-01-17Auto merge of #135047 - Flakebi:amdgpu-kernel-cc, r=workingjubileebors-0/+3
Add gpu-kernel calling convention The amdgpu-kernel calling convention was reverted in commit f6b21e90d1ec01081bc2619efb68af6788a63d65 (#120495 and https://github.com/rust-lang/rust-analyzer/pull/16463) due to inactivity in the amdgpu target. Introduce a `gpu-kernel` calling convention that translates to `ptx_kernel` or `amdgpu_kernel`, depending on the target that rust compiles for. Tracking issue: #135467 amdgpu target tracking issue: #135024
2025-01-16Add gpu-kernel calling conventionFlakebi-0/+3
The amdgpu-kernel calling convention was reverted in commit f6b21e90d1ec01081bc2619efb68af6788a63d65 due to inactivity in the amdgpu target. Introduce a `gpu-kernel` calling convention that translates to `ptx_kernel` or `amdgpu_kernel`, depending on the target that rust compiles for.
2025-01-12on Windows, consistently pass ZST by-refRalf Jung-2/+2
2025-01-10fix ZST handling for Windows ABIs on MSVC targetRalf Jung-16/+15
2024-12-02rust_for_linux: -Zreg-struct-return commandline flag for X86 (#116973)Andrew Zhogin-1/+3
2024-11-20aarch64 softfloat target: always pass floats in int registersRalf Jung-0/+1
2024-11-08pointee_info_at: fix logic for recursing into enumsRalf Jung-1/+2
2024-10-29compiler: `rustc_abi::Abi` => `BackendRepr`Jubilee Young-12/+17
The initial naming of "Abi" was an awful mistake, conveying wrong ideas about how psABIs worked and even more about what the enum meant. It was only meant to represent the way the value would be described to a codegen backend as it was lowered to that intermediate representation. It was never meant to mean anything about the actual psABI handling! The conflation is because LLVM typically will associate a certain form with a certain ABI, but even that does not hold when the special cases that actually exist arise, plus the IR annotations that modify the ABI. Reframe `rustc_abi::Abi` as the `BackendRepr` of the type, and rename `BackendRepr::Aggregate` as `BackendRepr::Memory`. Unfortunately, due to the persistent misunderstandings, this too is now incorrect: - Scattered ABI-relevant code is entangled with BackendRepr - We do not always pre-compute a correct BackendRepr that reflects how we "actually" want this value to be handled, so we leave the backend interface to also inject various special-cases here - In some cases `BackendRepr::Memory` is a "real" aggregate, but in others it is in fact using memory, and in some cases it is a scalar! Our rustc-to-backend lowering code handles this sort of thing right now. That will eventually be addressed by lifting duplicated lowering code to either rustc_codegen_ssa or rustc_target as appropriate.
2024-10-23Set `signext` or `zeroext` for integer arguments on LoongArch64Asuna-0/+1
2024-10-23Set `signext` or `zeroext` for integer arguments on RISC-VAsuna-0/+1
2024-10-23Introduce `adjust_for_rust_abi` in `rustc_target`Asuna-2/+115
2024-10-18compiler: Revert -Zregparm handling for extern RustJubilee Young-22/+0
2024-10-18rust_for_linux: -Zregparm=<N> commandline flag for X86 (#116972)Andrew Zhogin-9/+35
2024-10-11compiler: Wire `{TyAnd,}Layout` into `rustc_abi`Jubilee Young-247/+2
This finally unites TyAndLayout, Layout, and LayoutS into the same crate, as one might imagine they would be placed. No functional changes.
2024-10-11compiler: Empty out rustc_target::abiJubilee Young-0/+1009