rust/tests/assembly
Matthias Krüger 713c852a2f
Rollup merge of #117671 - kjetilkjeka:nvptx_c_abi_avoid_direct, r=davidtwco
NVPTX: Avoid PassMode::Direct for args in C abi

Fixes #117480

I must admit that I'm confused about `PassMode` altogether, is there a good sum-up threads for this anywhere? I'm especially confused about how "indirect" and "byval" goes together. To me it seems like "indirect" basically means "use a indirection through a pointer", while "byval" basically means "do not use indirection through a pointer".

The return used to keep `PassMode::Direct` for small aggregates. It turns out that `make_indirect` messes up the tests and one way to fix it is to keep `PassMode::Direct` for all aggregates. I have mostly seen this PassMode mentioned for args. Is it also a problem for returns? When experimenting with `byval` as an alternative i ran into [this assert](61a3eea804/compiler/rustc_codegen_llvm/src/abi.rs (L463C22-L463C22))

I have added tests for the same kind of types that is already tested for the "ptx-kernel" abi. The tests cannot be enabled until something like #117458 is completed and merged.

CC: ``@RalfJung`` since you seem to be the expert on this and have already helped me out tremendously

CC: ``@RDambrosio016`` in case this influence your work on `rustc_codegen_nvvm`

``@rustbot`` label +O-NVPTX
2024-05-28 18:04:31 +02:00
..
asm Add support for Arm64EC inline assembly 2024-04-10 10:06:44 -07:00
auxiliary
libs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
nvptx-kernel-abi NVPTX: Enable previously disabled tests 2024-03-11 13:35:58 +01:00
stack-protector also update windows slack-protector tests 2024-04-22 23:45:04 -04:00
targets test: Add assembly tests for x86_64-unknown-linux-none target 2024-05-12 01:25:11 +02:00
aarch64-naked-fn-no-bti-prolog.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
aarch64-pointer-auth.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
align_offset.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
closure-inherit-target-feature.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
dwarf4.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
dwarf5.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
is_aligned.rs stabilize ptr.is_aligned, move ptr.is_aligned_to to a new feature gate 2024-03-29 19:59:46 -04:00
manual-eq-efficient.rs Add test for efficient codegen of manual eq implementations of a small struct 2024-04-30 13:21:08 +00:00
niche-prefer-zero.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
nvptx-arch-default.rs NVPTX: Enable previously disabled tests 2024-03-11 13:35:58 +01:00
nvptx-arch-emit-asm.rs NVPTX: Enable previously disabled tests 2024-03-11 13:35:58 +01:00
nvptx-arch-link-arg.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
nvptx-arch-target-cpu.rs NVPTX: Enable previously disabled tests 2024-03-11 13:35:58 +01:00
nvptx-atomics.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
nvptx-c-abi-arg-v7.rs NVPTX: Avoid PassMode::Direct for args in C abi 2024-05-10 18:39:05 +02:00
nvptx-c-abi-ret-v7.rs NVPTX: Avoid PassMode::Direct for args in C abi 2024-05-10 18:39:05 +02:00
nvptx-internalizing.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
nvptx-linking-binary.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
nvptx-linking-cdylib.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
nvptx-safe-naming.rs NVPTX: Enable previously disabled tests 2024-03-11 13:35:58 +01:00
panic-no-unwind-no-uwtable.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
panic-unwind-no-uwtable.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
pic-relocation-model.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
pie-relocation-model.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
simd-bitmask.rs Add tests for the generated assembly of mask related simd instructions. 2024-03-12 08:52:54 +01:00
simd-intrinsic-gather.rs Add tests for the generated assembly of mask related simd instructions. 2024-03-12 08:52:54 +01:00
simd-intrinsic-mask-load.rs Add tests for the generated assembly of mask related simd instructions. 2024-03-12 08:52:54 +01:00
simd-intrinsic-mask-reduce.rs Add inline comments why we're forcing the target cpu 2024-05-01 16:54:20 -07:00
simd-intrinsic-mask-store.rs Add tests for the generated assembly of mask related simd instructions. 2024-03-12 08:52:54 +01:00
simd-intrinsic-scatter.rs Add tests for the generated assembly of mask related simd instructions. 2024-03-12 08:52:54 +01:00
simd-intrinsic-select.rs Add tests for the generated assembly of mask related simd instructions. 2024-03-12 08:52:54 +01:00
slice-is_ascii.rs Ignore less tests in debug builds 2024-02-23 18:04:01 -05:00
sparc-struct-abi.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
stack-probes.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
static-relocation-model.rs Ignore less tests in debug builds 2024-02-23 18:04:01 -05:00
strict_provenance.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
target-feature-multiple.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
thin-lto.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
wasm_exceptions.rs Update test directives for wasm32-wasip1 2024-03-11 09:36:35 -07:00
x86_64-array-pair-load-store-merge.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
x86_64-cmp.rs Add+Use mir::BinOp::Cmp 2024-03-23 23:23:41 -07:00
x86_64-floating-point-clamp.rs Add inline comments why we're forcing the target cpu 2024-05-01 16:54:20 -07:00
x86_64-fortanix-unknown-sgx-lvi-generic-load.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
x86_64-fortanix-unknown-sgx-lvi-generic-ret.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
x86_64-fortanix-unknown-sgx-lvi-inline-assembly.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
x86_64-function-return.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
x86_64-naked-fn-no-cet-prolog.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
x86_64-no-jump-tables.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
x86_64-sse_crc.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
x86_64-typed-swap.rs Avoid non-windows non-linux in assembly x64 test 2024-03-23 00:02:53 -07:00