about summary refs log tree commit diff
path: root/tests/assembly
AgeCommit message (Collapse)AuthorLines
2024-11-08remove support for rustc_safe_intrinsic attribute; use rustc_intrinsic ↵Ralf Jung-3/+4
functions instead
2024-11-07Basic inline assembly support for SPARC and SPARC64Taiki Endo-0/+168
2024-11-06Auto merge of #132664 - matthiaskrgr:rollup-i27nr7i, r=matthiaskrgrbors-3/+0
Rollup of 5 pull requests Successful merges: - #131261 (Stabilize `UnsafeCell::from_mut`) - #131405 (bootstrap/codegen_ssa: ship llvm-strip and use it for -Cstrip) - #132077 (Add a new `wide-arithmetic` feature for WebAssembly) - #132562 (Remove the `wasm32-wasi` target from rustc) - #132660 (Remove unused errs.rs file) Failed merges: - #131721 (Add new unstable feature `const_eq_ignore_ascii_case`) r? `@ghost` `@rustbot` modify labels: rollup
2024-11-05Rollup merge of #132259 - mrkajetanp:branch-protection-pauth-lr, r=davidtwcoMatthias Krüger-4/+13
rustc_codegen_llvm: Add a new 'pc' option to branch-protection Add a new 'pc' option to -Z branch-protection for aarch64 that enables the use of PC as a diversifier in PAC branch protection code. When the pauth-lr target feature is enabled in combination with -Z branch-protection=pac-ret,pc, the new 9.5-a instructions (pacibsppc, retaasppc, etc) will be generated.
2024-11-03Remove the `wasm32-wasi` target from rustcAlex Crichton-3/+0
This commit is the final step in the journey of renaming the historical `wasm32-wasi` target in the Rust compiler to `wasm32-wasip1`. Various steps in this journey so far have been: * 2023-04-03: rust-lang/compiler-team#607 - initial proposal for this rename * 2024-11-27: rust-lang/compiler-team#695 - amended schedule/procedure for rename * 2024-01-29: rust-lang/rust#120468 - initial introduction of `wasm32-wasip1` * 2024-06-18: rust-lang/rust#126662 - warn on usage of `wasm32-wasi` * 2024-11-08: this PR - remove the `wasm32-wasi` target The full transition schedule is in [this comment][comment] and is summarized with: * 2024-05-02: Rust 1.78 released with `wasm32-wasip1` target * 2024-09-05: Rust 1.81 released warning on usage of `wasm32-wasi` * 2025-01-09: Rust 1.84 to be released without the `wasm32-wasi` target This means that support on stable for the replacement target of `wasm32-wasip1` has currently been available for 6 months. Users have already seen warnings on stable for 2 months about usage of `wasm32-wasi` and stable users have another 2 months of warnings before the target is removed from stable. This commit is intended to be the final step in this transition so the source tree should no longer mention `wasm32-wasi` except in historical reference to the older name of the `wasm32-wasip1` target. [comment]: https://github.com/rust-lang/rust/pull/120468#issuecomment-1977878747
2024-11-02Rollup merge of #132457 - taiki-e:needless-feature, r=workingjubileeMatthias Krüger-1/+1
Remove needless #![feature(asm_experimental_arch)] from loongarch64 inline assembly test inline assembly is already stable on this architecture.
2024-11-01Remove needless #![feature(asm_experimental_arch)] from loongarch64 inline ↵Taiki Endo-1/+1
assembly test
2024-11-01Move remaining inline assembly test files into asm directoryTaiki Endo-0/+0
2024-10-31rustc_codegen_llvm: Add a new 'pc' option to branch-protectionKajetan Puchalski-4/+13
Add a new 'pc' option to -Z branch-protection for aarch64 that enables the use of PC as a diversifier in PAC branch protection code. When the pauth-lr target feature is enabled in combination with -Z branch-protection=pac-ret,pc, the new 9.5-a instructions (pacibsppc, retaasppc, etc) will be generated.
2024-10-31tests/assembly: add `minicore` compiletest self-test许杰友 Jieyou Xu (Joe)-0/+5
Check that `minicore` cannot be used with `run-{pass,fail}` tests.
2024-10-28riscv-soft-abi-with-float-features.rs: adapt for LLVM 20Krasimir Georgiev-3/+8
2024-10-23Auto merge of #132079 - fmease:rollup-agrd358, r=fmeasebors-0/+108
Rollup of 9 pull requests Successful merges: - #130991 (Vectorized SliceContains) - #131928 (rustdoc: Document `markdown` module.) - #131955 (Set `signext` or `zeroext` for integer arguments on RISC-V and LoongArch64) - #131979 (Minor tweaks to `compare_impl_item.rs`) - #132036 (Add a test case for #131164) - #132039 (Specialize `read_exact` and `read_buf_exact` for `VecDeque`) - #132060 ("innermost", "outermost", "leftmost", and "rightmost" don't need hyphens) - #132065 (Clarify documentation of `ptr::dangling()` function) - #132066 (Fix a typo in documentation of `pointer::sub_ptr()`) r? `@ghost` `@rustbot` modify labels: rollup
2024-10-22Add wasm32v1-none target (compiler-team/#791)Graydon Hoare-0/+3
2024-10-23Set `signext` or `zeroext` for integer arguments on LoongArch64Asuna-1/+13
2024-10-23Set `signext` or `zeroext` for integer arguments on RISC-VAsuna-0/+96
2024-10-22Auto merge of #131871 - RalfJung:x86-32-float, r=workingjubileebors-2/+4
x86-32 float return for 'Rust' ABI: treat all float types consistently This helps with https://github.com/rust-lang/rust/issues/131819: for our own ABI on x86-32, we want to *never* use the float registers. The previous logic only considered F32 and F64, but skipped F16 and F128. So I made the logic just apply to all float types. try-job: i686-gnu try-job: i686-gnu-nopt
2024-10-22adjust asm testRalf Jung-2/+4
2024-10-21Rollup merge of #131807 - beetrees:riscv-target-abi, r=workingjubileeJubilee-0/+46
Always specify `llvm_abiname` for RISC-V targets For RISC-V targets, when `llvm_abiname` is not specified LLVM will infer the ABI from the target features, causing #116344 to occur. This PR adds the correct `llvm_abiname` to all RISC-V targets where it is missing (which are all soft-float targets), and adds a test to prevent future RISC-V targets from accidentally omitting `llvm_abiname`. The only affect of this PR is that `-Ctarget-feature=+f` (or similar) will no longer affect the ABI on the modified targets. <!-- homu-ignore:start --> r? `@RalfJung` <!--- homu-ignore:end -->
2024-10-19Auto merge of #131211 - bjorn3:rust_abi_follow_c_rules, r=nikic,jieyouxubors-1/+1
Return values larger than 2 registers using a return area pointer LLVM and Cranelift disagree about how to return values that don't fit in the registers designated for return values. LLVM will force the entire return value to be passed by return area pointer, while Cranelift will look at each IR level return value independently and decide to pass it in a register or not, which would result in the return value being passed partially in registers and partially through a return area pointer. While Cranelift may need to be fixed as the LLVM behavior is generally more correct with respect to the surface language, forcing this behavior in rustc itself makes it easier for other backends to conform to the Rust ABI and for the C ABI rustc already handles this behavior anyway. In addition LLVM's decision to pass the return value in registers or using a return area pointer depends on how exactly the return type is lowered to an LLVM IR type. For example `Option<u128>` can be lowered as `{ i128, i128 }` in which case the x86_64 backend would use a return area pointer, or it could be passed as `{ i32, i128 }` in which case the x86_64 backend would pass it in registers by taking advantage of an LLVM ABI extension that allows using 3 registers for the x86_64 sysv call conv rather than the officially specified 2 registers. This adjustment is only necessary for the Rust ABI as for other ABI's the calling convention implementations in rustc_target already ensure any return value which doesn't fit in the available amount of return registers is passed in the right way for the current target. Helps with https://github.com/rust-lang/rustc_codegen_cranelift/issues/1525 cc https://github.com/bytecodealliance/wasmtime/issues/9250
2024-10-19Fix test expectations for 32bit x86bjorn3-1/+1
2024-10-17Always specify `llvm_abiname` for RISC-V targetsbeetrees-0/+46
2024-10-11Rollup merge of #131208 - mustartt:aix-call-abi, r=davidtwcoMatthias Krüger-4/+39
ABI: Pass aggregates by value on AIX On AIX we pass aggregates byval. Adds new ABI for AIX for powerpc64. https://github.com/llvm/llvm-project/blob/313ad85dfa40a18f2edefd7ce2edc0528d5a554a/clang/lib/CodeGen/Targets/PPC.cpp#L216 Fixes the following 2 testcases on AIX: ``` tests/ui/abi/extern/extern-pass-TwoU16s.rs tests/ui/abi/extern/extern-pass-TwoU8s.rs ```
2024-10-11compiletest: Remove the magic hacks for finding output with `lto=thin`Zalathar-7/+0
This hack was intended to handle the case where `-Clto=thin` causes the compiler to emit multiple output files (when producing LLVM-IR or assembly). The hack only affects 4 tests, of which 3 are just meta-tests for the hack itself. The one remaining test that motivated the hack currently doesn't even need it! (`tests/codegen/issues/issue-81408-dllimport-thinlto-windows.rs`)
2024-10-07add aix aggregate testHenry Jiang-4/+39
2024-10-06more `asm!` -> `naked_asm!` in testsFolkert de Vries-4/+4
2024-10-05Add assembly tests to satisfy 'tidy'Henri Lunnikivi-0/+9
2024-10-04Rollup merge of #130453 - randomPoison:trusty-x86, r=pnkfelixJubilee-0/+3
Add x86_64-unknown-trusty as tier 3 target This PR adds a third target for the Trusty platform, `x86_64-unknown-trusty`. Please let me know if an MCP is required. https://github.com/rust-lang/compiler-team/issues/582 was made when adding the first two targets, I can make another one for the new target as well if needed. # Target Tier Policy Acknowledgements > 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.) - Nicole LeGare (```@randomPoison)``` - Andrei Homescu (```@ahomescu)``` - Chris Wailes (chriswailes@google.com) - As a fallback trusty-dev-team@google.com can be contacted Note that this does not reflect the maintainers currently listed in [`trusty.md`](https://github.com/rust-lang/rust/blob/c52c23b6f44cd19718721a5e3b2eeb169e9c96ff/src/doc/rustc/src/platform-support/trusty.md). #130452 is currently open to update the list of maintainers in the documentation. > 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. The new target `x86_64-unknown-trusty` follows the existing naming convention for similar targets. > 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. 👍 > 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. There are no known legal issues or license incompatibilities. > 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. 👍 > 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 PR only adds the target. `std` support is being worked on and will be added in a future PR. > 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. 👍 > 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. 👍 > 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. 👍 > 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.) 👍
2024-09-25Rollup merge of #130549 - biabbas:riscv32_wrs_vxworks, r=nnethercoteMatthias Krüger-0/+6
Add RISC-V vxworks targets Risc-V 32 and RISC-V 64 targets are to be added in the target list.
2024-09-24Rollup merge of #130752 - tdittr:cmse-assembly-tests, r=jieyouxuTrevor Gross-5/+81
Improve assembly test for CMSE ABIs Tracking issues: #75835 #81391 This ensures the code-gen for these ABIs does not change silently. There is a small chance that this code-gen might change, however even GCC (https://godbolt.org/z/16arxab5x and https://godbolt.org/z/16arxab5x) generates almost the same assembly for these ABIs. I hope the notes in the comments should help fix the tests if it ever breaks.
2024-09-23Rollup merge of #130750 - heiher:loong-linux-ohos-tier3, r=jieyouxuMichael Goulet-0/+3
Add new Tier-3 target: `loongarch64-unknown-linux-ohos` MCP: https://github.com/rust-lang/compiler-team/issues/784
2024-09-23Improve assembly test for CMSE ABIsTamme Dittrich-5/+81
This ensures the code-gen for these ABIs does not change silently. Co-authored-by: Folkert <folkert@folkertdev.nl>
2024-09-23Add new Tier-3 target: `loongarch64-unknown-linux-ohos`Xiaotian Wu-0/+3
MCP: https://github.com/rust-lang/compiler-team/issues/784 Co-authored-by: WANG Rui <wangrui@loongson.cn>
2024-09-23Rollup merge of #130657 - arttet:fix/fuchsia, r=jieyouxuJubilee-6/+0
Remove x86_64-fuchsia and aarch64-fuchsia target aliases Closes #106649.
2024-09-21Add assembly test for the cmse unstable featuresFolkert-0/+26
verifies that the correct return instructions are emitted. Co-authored-by: Tamme Dittrich <tamme@tweedegolf.com>
2024-09-21Remove x86_64-fuchsia and aarch64-fuchsia target aliasesArtyom Tetyukhin-6/+0
2024-09-20Add arm64e-apple-tvos targetArtyom Tetyukhin-0/+3
2024-09-20Add Vxworks RISC-V targetsB I Mohammed Abbas-0/+6
2024-09-18Update the minimum external LLVM to 18Josh Stone-9/+0
2024-09-16Add x86_64-unknown-trusty as tier 3Nicole LeGare-0/+3
2024-09-16Ignore reduce-fadd-unordered on SGX platformRaoul Strackx-0/+1
2024-09-15Rollup merge of #130325 - workingjubilee:plus-minus-zero-redux, ↵Jubilee-0/+29
r=RalfJung,jieyouxu Use -0.0 in `intrinsics::simd::reduce_add_unordered` -0.0 is the actual neutral additive float, not +0.0, and this matters to codegen. try-job: aarch64-gnu
2024-09-15Use -0.0 in `intrinsics::simd::reduce_add_unordered`Jubilee Young-0/+29
-0.0 is the actual neutral additive float, not +0.0, and this matters to codegen.
2024-09-12small_data_threshold.rs: Adapt to LLVM head changesTim Neumann-2/+2
2024-09-12Auto merge of #117465 - paulmenage:small-data-limit, r=compiler-errorsbors-0/+92
Add -Z small-data-threshold This flag allows specifying the threshold size above which LLVM should not consider placing small objects in a `.sdata` or `.sbss` section. Support is indicated in the target options via the small-data-threshold-support target option, which can indicate either an LLVM argument or an LLVM module flag. To avoid duplicate specifications in a large number of targets, the default value for support is DefaultForArch, which is translated to a concrete value according to the target's architecture.
2024-09-10Add -Z small-data-thresholdPaul Menage-0/+92
This flag allows specifying the threshold size above which LLVM should not consider placing small objects in a .sdata or .sbss section. Support is indicated in the target options via the small-data-threshold-support target option, which can indicate either an LLVM argument or an LLVM module flag. To avoid duplicate specifications in a large number of targets, the default value for support is DefaultForArch, which is translated to a concrete value according to the target's architecture.
2024-09-09Ban non-array SIMDScott McMurray-212/+60
2024-09-08added support for GNU/Hurd on x86_64Samuel Thibault-0/+3
2024-09-07Rollup merge of #129940 - liushuyu:s390x-target-features, r=RalfJungMichael Goulet-0/+46
s390x: Fix a regression related to backchain feature In #127506, we introduced a new IBM Z-specific target feature, `backchain`. This particular `target-feature` was available as a function-level attribute in LLVM 17 and below, so some hacks were used to avoid blowing up LLVM when querying the supported LLVM features. This led to an unfortunate regression where `cfg!(target-feature = "backchain")` will always return true. This pull request aims to fix this issue, and a test has been introduced to ensure it will never happen again. Fixes #129927. r? `@RalfJung`
2024-09-07Rollup merge of #129468 - Rajveer100:hack-to-avoid-function-merging, ↵Michael Goulet-126/+12
r=Mark-Simulacrum [testsuite][cleanup] Remove all usages of `dont_merge` hack to avoid function merging Resolves #129438 The `-Zmerge-functions=disabled` compile flag exists for this purpose.
2024-09-04tests: add an assembly scanning test for s390x backchain switchliushuyu-0/+46