about summary refs log tree commit diff
path: root/compiler/rustc_target/src/abi
AgeCommit message (Collapse)AuthorLines
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
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-2/+7
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-28Auto merge of #81388 - bjorn3:wasm_bindgen_fix, r=nikomatsakisbors-2/+2
Fix abi for wasm-bindgen Hopefully fixes https://github.com/rust-lang/rust/issues/81386. `@alexcrichton` can you confirm this fixes wasm-bindgen? r? `@alexcrichton`
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-27Inline trivial implementation of rustc_target::abi::AlignTomasz MiÄ…sko-2/+18
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-12Rollup merge of #80042 - sivadeilra:cold_bits, r=oli-obkYuki Okushi-6/+20
Split a func into cold/hot parts, reducing binary size I noticed that the Size::bits function is called in many places, and is inlined into them. On x86_64-pc-windows-msvc, this function is inlined 527 times, and compiled separately (non-inlined) 3 times. Each of those inlined calls contains code that panics. This commit moves the `panic!` call into a separate function and marks that function with `#[cold]`. This reduces binary size by 24 KB. Not much, but it's something. Changes like this often reduce pressure on instruction-caches, since it reduces the amount of code that is inlined into hot code paths. Or more precisely, it removes cold code from hot cache lines.
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.
2021-01-06Prefer enum Endian in rustc_target::TargetLzu Tao-8/+41
2021-01-05Split a func into cold/hot parts, reducing binary sizeArlie Davis-6/+20
I noticed that the Size::bits function is called in many places, and is inlined into them. On x86_64-pc-windows-msvc, this function is inlined 527 times, and compiled separately (non-inlined) 3 times. Each of those inlined calls contains code that panics. This commit moves the `panic!` call into a separate function and marks that function with `#[cold]`. This reduces binary size by 24 KB. By itself, that's not a substantial reduction. However, changes like this often reduce pressure on instruction-caches, since it reduces the amount of code that is inlined into hot code paths. Or more precisely, it removes cold code from hot cache lines. It also removes all conditionals from Size::bits(), which is called in many places.
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-4/+4
`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-11-04Update compiler/rustc_target/src/abi/mod.rsOli Scherer-1/+1
Co-authored-by: Ralf Jung <post@ralfj.de>
2020-11-04Update compiler/rustc_target/src/abi/mod.rsOli Scherer-1/+1
Co-authored-by: Ralf Jung <post@ralfj.de>
2020-11-04`u128` truncation and sign extension are not just interpreter relatedoli-0/+29
2020-10-30Fix even more clippy warningsJoshua Nelson-44/+14
2020-10-15Rename target_pointer_width to pointer_width and turn it into an u32est31-2/+2
Rename target_pointer_width to pointer_width because it is already member of the Target struct. The compiler supports only three valid values for target_pointer_width: 16, 32, 64. Thus it can safely be turned into an int. This means less allocations and clones as well as easier handling of the type.
2020-10-02Returns values up to 2*usize by valueJonas Schievink-12/+0
2020-09-27Auto merge of #71274 - RalfJung:raw-init-check-aggregate, r=petrochenkovbors-4/+19
might_permit_raw_init: also check aggregate fields This is the next step for https://github.com/rust-lang/rust/issues/66151: when doing `mem::zeroed`/`mem::uninitialized`, also recursively check fields of aggregates (except for arrays) for whether they permit zero/uninit initialization.
2020-09-26Return values up to 128 bits in registersJonas Schievink-0/+12
2020-09-26might_permit_raw_init: also check aggregate fieldsRalf Jung-4/+19
2020-08-30mv compiler to compiler/mark-0/+3676