about summary refs log tree commit diff
path: root/compiler/rustc_target/src/abi
AgeCommit message (Collapse)AuthorLines
2021-09-09WrapAndreas Liljeqvist-1/+1
2021-09-09rename `is_valid_for` to `is_valid`Andreas Liljeqvist-2/+2
2021-09-09Rename `(un)signed` to `(un)signed_int`Andreas Liljeqvist-6/+6
2021-09-09Move `unsigned_max` etc into `Size` againAndreas Liljeqvist-7/+22
2021-09-09Make `abi::Abi` `Copy` and remove a *lot* of refsAndreas Liljeqvist-19/+19
fix fix Remove more refs and clones fix more fix
2021-09-09Fix docstringAndreas Liljeqvist-2/+1
2021-09-09Use special `Debug` format when `start` > `end`Andreas Liljeqvist-1/+5
2021-09-09Remove `contains_zero`, respect the compilerAndreas Liljeqvist-8/+1
2021-09-09derive Copy for WrappingRange and ScalarAndreas Liljeqvist-5/+5
2021-09-09fix matchAndreas Liljeqvist-2/+4
2021-09-09Add methods for checking for full ranges to `Scalar` and `WrappingRange`Andreas Liljeqvist-21/+15
Move *_max methods back to util change to inline instead of inline(always) Remove valid_range_exclusive from scalar Use WrappingRange instead implement always_valid_for in a safer way Fix accidental edit
2021-09-02rustc_target: move `LayoutOf` to `ty::layout`.Eduard-Mihai Burtescu-41/+0
2021-08-30rustc_target: remove `LayoutOf` bound from `TyAbiInterface`.Eduard-Mihai Burtescu-61/+51
2021-08-30rustc_target: `TyAndLayout::field` should never error.Eduard-Mihai Burtescu-9/+8
2021-08-27rustc_target: require `TyAbiInterface` in `LayoutOf`.Eduard-Mihai Burtescu-2/+2
2021-08-27rustc_target: rename `TyAndLayoutMethods` to `TyAbiInterface`.Eduard-Mihai Burtescu-65/+71
2021-08-27rustc_target: add lifetime parameter to `LayoutOf`.Eduard-Mihai Burtescu-79/+64
2021-08-26`#[inline]` non-generic `pub fn`s in `rustc_target::abi` and `ty::layout`.Eduard-Mihai Burtescu-0/+21
2021-08-26Auto merge of #88308 - eddyb:cooked-layouts, r=nagisabors-1/+1
Morph `layout_raw` query into `layout_of`. Before this PR, `LayoutCx::layout_of` wrapped the `layout_raw` query, to: * normalize the type, before attempting to compute the layout * pass the layout to `record_layout_for_printing`, for `-Zprint-type-sizes` Moving those two responsibilities into the query may reduce overhead (due to cached calls skipping those steps), but I want to do a perf run to know. One of the changes I had to make was changing the return type of the query, to be able to both get out the type produced by normalizing inside the query *and* to match the signature of the old `TyCtxt::layout_of`. This change may be worse, perf-wise, so that's another reason I want to check. r? `@nagisa` cc `@oli-obk`
2021-08-25use undef for uninitialized bytes in constantsErik Desjardins-0/+38
2021-08-24Morph `layout_raw` query into `layout_of`.Eduard-Mihai Burtescu-1/+1
2021-08-24use convention for with_* methodsAndreas Liljeqvist-7/+9
2021-08-24Force inline: small functions and single call-siteAndreas Liljeqvist-2/+4
2021-08-23Simplify zero checkAndreas Liljeqvist-1/+1
2021-08-23add `with_start` and `with_end`Andreas Liljeqvist-1/+11
2021-08-23implement debug in similar way to RangeInclusiveAndreas Liljeqvist-1/+8
2021-08-23Rename to WrappingRangeAndreas Liljeqvist-5/+5
2021-08-23implement contains_zero methodAndreas Liljeqvist-3/+9
2021-08-23Use refAndreas Liljeqvist-2/+2
2021-08-23Removed fixed fixmeAndreas Liljeqvist-3/+0
2021-08-22Use custom wrap-around type instead of RangeAndreas Liljeqvist-30/+43
2021-08-12Add c_enum_min_bits to target specManish Goregaokar-0/+17
2021-06-23Point to the updated version of some dead linksSmitty-1/+1
2021-06-23Use HTTPS links where possibleSmitty-5/+5
2021-06-14Use the now available implementation of `IntoIterator` for arraysLeSeulArtichaut-3/+3
2021-06-07Use `try_into` instead of asserting manuallyLingMan-10/+2
2021-06-06Auto merge of #79608 - alessandrod:bpf, r=nagisabors-0/+33
BPF target support This adds `bpfel-unknown-none` and `bpfeb-unknown-none`, two new no_std targets that generate little and big endian BPF. The approach taken is very similar to the cuda target, where `TargetOptions::obj_is_bitcode` is enabled and code generation is done by the linker. I added the targets to `dist-various-2`. There are [some tests](https://github.com/alessandrod/bpf-linker/tree/main/tests/assembly) in bpf-linker and I'm planning to add more. Those are currently not ran as part of rust CI.
2021-06-02Miscellaneous inlining improvementsTomasz Miąsko-0/+4
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-05-18add Align::ONE; add methods to access alloc.extraRalf Jung-1/+3
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-2/+5
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