about summary refs log tree commit diff
path: root/compiler/rustc_target/src/abi/call
AgeCommit message (Collapse)AuthorLines
2021-09-20Auto merge of #88321 - glaubitz:m68k-linux, r=wesleywiserbors-0/+32
Add initial support for m68k This patch series adds initial support for m68k making use of the new M68k backend introduced with LLVM-13. Additional changes will be needed to be able to actually use the backend for this target.
2021-09-18Querify `fn_abi_of_{fn_ptr,instance}`.Eduard-Mihai Burtescu-0/+1
2021-09-18ty::layout: intern `FnAbi`s as `&'tcx`.Eduard-Mihai Burtescu-11/+11
2021-09-18ty::layout: propagate errors up to (but not out of) `FnAbi::of_*`.Eduard-Mihai Burtescu-2/+25
2021-09-18rustc_target: `adjust_for_cabi` -> `adjust_for_foreign_abi`.Eduard-Mihai Burtescu-1/+1
2021-09-17compiler/rustc_target: Add support for m68k-linux-gnuJohn Paul Adrian Glaubitz-0/+32
2021-09-09Make `abi::Abi` `Copy` and remove a *lot* of refsAndreas Liljeqvist-12/+12
fix fix Remove more refs and clones fix more fix
2021-08-30rustc_target: remove `LayoutOf` bound from `TyAbiInterface`.Eduard-Mihai Burtescu-56/+49
2021-08-27rustc_target: rename `TyAndLayoutMethods` to `TyAbiInterface`.Eduard-Mihai Burtescu-54/+54
2021-08-27rustc_target: add lifetime parameter to `LayoutOf`.Eduard-Mihai Burtescu-67/+57
2021-06-23Point to the updated version of some dead linksSmitty-1/+1
2021-06-23Use HTTPS links where possibleSmitty-4/+4
2021-06-14Use the now available implementation of `IntoIterator` for arraysLeSeulArtichaut-1/+1
2021-05-29BPF: abi: extend args/ret to 32 bitsAlessandro Decina-3/+3
Let LLVM extend to 64 bits when alu32 is not enabled
2021-05-23Add support for BPF inline assemblyAlessandro Decina-1/+1
2021-05-23Add BPF targetAlessandro Decina-0/+33
This change adds the bpfel-unknown-none and bpfeb-unknown-none targets which can be used to generate little endian and big endian BPF
2021-04-19fix few typosklensy-2/+2
2021-04-08rustc: Add a new `wasm` ABIAlex Crichton-97/+35
This commit implements the idea of a new ABI for the WebAssembly target, one called `"wasm"`. This ABI is entirely of my own invention and has no current precedent, but I think that the addition of this ABI might help solve a number of issues with the WebAssembly targets. When `wasm32-unknown-unknown` was first added to Rust I naively "implemented an abi" for the target. I then went to write `wasm-bindgen` which accidentally relied on details of this ABI. Turns out the ABI definition didn't match C, which is causing issues for C/Rust interop. Currently the compiler has a "wasm32 bindgen compat" ABI which is the original implementation I added, and it's purely there for, well, `wasm-bindgen`. Another issue with the WebAssembly target is that it's not clear to me when and if the default C ABI will change to account for WebAssembly's multi-value feature (a feature that allows functions to return multiple values). Even if this does happen, though, it seems like the C ABI will be guided based on the performance of WebAssembly code and will likely not match even what the current wasm-bindgen-compat ABI is today. This leaves a hole in Rust's expressivity in binding WebAssembly where given a particular import type, Rust may not be able to import that signature with an updated C ABI for multi-value. To fix these issues I had the idea of a new ABI for WebAssembly, one called `wasm`. The definition of this ABI is "what you write maps straight to wasm". The goal here is that whatever you write down in the parameter list or in the return values goes straight into the function's signature in the WebAssembly file. This special ABI is for intentionally matching the ABI of an imported function from the environment or exporting a function with the right signature. With the addition of a new ABI, this enables rustc to: * Eventually remove the "wasm-bindgen compat hack". Once this ABI is stable wasm-bindgen can switch to using it everywhere. Afterwards the wasm32-unknown-unknown target can have its default ABI updated to match C. * Expose the ability to precisely match an ABI signature for a WebAssembly function, regardless of what the C ABI that clang chooses turns out to be. * Continue to evolve the definition of the default C ABI to match what clang does on all targets, since the purpose of that ABI will be explicitly matching C rather than generating particular function imports/exports. Naturally this is implemented as an unstable feature initially, but it would be nice for this to get stabilized (if it works) in the near-ish future to remove the wasm32-unknown-unknown incompatibility with the C ABI. Doing this, however, requires the feature to be on stable because wasm-bindgen works with stable Rust.
2021-04-04wasm64Gus Caplan-0/+60
2021-03-21Move decision aboute noalias into codegen_llvmNikita Popov-1/+4
The frontend shouldn't be deciding whether or not to use mutable noalias attributes, as this is a pure LLVM concern. Only provide the necessary information and do the actual decision in codegen_llvm.
2021-02-28Explicitly mark x86-interrupt ABI argument as byvalNikita Popov-0/+7
The first argument to an x86-interrupt ABI function was implicitly treated as byval prior to LLVM 12. Since LLVM 12, it has to be marked as such explicitly: https://github.com/llvm/llvm-project/commit/2e0e03c6a089da39039ec3f464f7cee5df86646b
2021-02-03Auto merge of #81346 - hug-dev:nonsecure-call-abi, r=jonas-schievinkbors-0/+1
Add a new ABI to support cmse_nonsecure_call This adds support for the `cmse_nonsecure_call` feature to be able to perform non-secure function call. See the discussion on Zulip [here](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Support.20for.20callsite.20attributes/near/223054928). This is a followup to #75810 which added `cmse_nonsecure_entry`. As for that PR, I assume that the changes are small enough to not have to go through a RFC but I don't mind doing one if needed 😃 I did not yet create a tracking issue, but if most of it is fine, I can create one and update the various files accordingly (they refer to the other tracking issue now). On the Zulip chat, I believe `@jonas-schievink` volunteered to be a reviewer 💯
2021-02-02Rollup merge of #81455 - Amanieu:aarch64_ilp32, r=sanxiynJack Huey-30/+3
Add AArch64 big-endian and ILP32 targets This PR adds 3 new AArch64 targets: - `aarch64_be-unknown-linux-gnu` - `aarch64-unknown-linux-gnu_ilp32` - `aarch64_be-unknown-linux-gnu_ilp32` It also fixes some ABI issues on big-endian ARM and AArch64.
2021-02-02Bump rustfmt versionMark Rousskov-1/+1
Also switches on formatting of the mir build module
2021-02-02Add a new ABI to support cmse_nonsecure_callHugues de Valon-0/+1
This commit adds a new ABI to be selected via `extern "C-cmse-nonsecure-call"` on function pointers in order for the compiler to apply the corresponding cmse_nonsecure_call callsite attribute. For Armv8-M targets supporting TrustZone-M, this will perform a non-secure function call by saving, clearing and calling a non-secure function pointer using the BLXNS instruction. See the page on the unstable book for details. Signed-off-by: Hugues de Valon <hugues.devalon@arm.com>
2021-01-30Consider Scalar to be a bool only if its unsignedSimonas Kazlauskas-1/+6
This seems right, given that conceptually bools are unsigned, but the implications of this change may have more action at distance that I'm not sure how to exhaustively consider. For instance there are a number of cases where code attaches range metadata if `scalar.is_bool()` holds. Supposedly it would no longer be attached to the `repr(i8)` enums? Though I'm not sure why booleans are being special-cased here in the first place... Fixes #80556
2021-01-27Fix ARM and AArch64 calling convention for passing small composite typesAmanieu d'Antras-30/+3
On big-endian the values need to be right-aligned within a 64-bit register, as if the value had been read with a 64-bit load instruction.
2021-01-26Use PassMode::Direct for Abi::Aggregate by defaultbjorn3-2/+2
2021-01-26Revert "Wasm-bindgen abi compat using cast_to"bjorn3-48/+8
This reverts commit 903c553f4a2fc8344edac0da565e6c1a7fad4b39.
2021-01-26Wasm-bindgen abi compat using cast_tobjorn3-8/+48
2021-01-26Revert "Share wasm-bindgen compat abi selection code"bjorn3-16/+4
This reverts commit e7a056fe20f7ec5a475923ff2f4eda8ca9e1a74b.
2021-01-25Share wasm-bindgen compat abi selection codebjorn3-4/+16
2021-01-23Add some comments to PassModebjorn3-0/+6
2021-01-23Never create an temporary PassMode::Direct when it is not a valid pass mode ↵bjorn3-17/+31
for a type
2021-01-23Use PassMode::Pair by default for Abi::ScalarPair for all abi's and in ↵bjorn3-2/+8
return position Abi::ScalarPair is only ever used for types that don't have a stable layout anyway so this doesn't break any FFI. It does however reduce the amount of special casing on the abi outside of the code responsible for abi specific adjustments to the pass mode.
2021-01-11squash! fix wasiGus Caplan-4/+5
2021-01-11new targetGus Caplan-6/+1
2021-01-11Use correct ABI for wasm32 by defaultGus Caplan-1/+6
Introduces `RUSTC_USE_WASM32_BINDGEN_COMPAT_ABI` env var to use the compat ABI if need.
2020-11-21Replace sext() and zext() with single ext() methodbjorn3-15/+9
2020-11-21Rename prefix_chunk to prefix_chunk_sizebjorn3-6/+6
2020-11-21Remove StructRet arg attrbjorn3-5/+0
It is applied exactly when the return value has an indirect pass mode. Except for InReg on x86 fastcall, arg attrs are now only used for optimization purposes and thus are fine to ignore.
2020-11-21Replace ByVal attribute with on_stack field for Indirectbjorn3-12/+19
This makes it clearer that only PassMode::Indirect allows ByVal
2020-11-21Replace ZExt and SExt flags with ArgExtension enumbjorn3-7/+33
Both flags are mutually exclusive
2020-11-08rustc_target: Rename some target options to avoid tautologyVadim Petrochenkov-2/+2
`target.target_endian` -> `target.endian` `target.target_c_int_width` -> `target.c_int_width` `target.target_os` -> `target.os` `target.target_env` -> `target.env` `target.target_vendor` -> `target.vendor` `target.target_family` -> `target.os_family` `target.target_mcount` -> `target.mcount`
2020-11-08Collapse all uses of `target.options.foo` into `target.foo`Vadim Petrochenkov-4/+4
with an eye on merging `TargetOptions` into `Target`. `TargetOptions` as a separate structure is mostly an implementation detail of `Target` construction, all its fields logically belong to `Target` and available from `Target` through `Deref` impls.
2020-10-30Fix even more clippy warningsJoshua Nelson-28/+10
2020-10-02Returns values up to 2*usize by valueJonas Schievink-12/+0
2020-09-26Return values up to 128 bits in registersJonas Schievink-0/+12
2020-08-30mv compiler to compiler/mark-0/+2526