rust/compiler/rustc_codegen_llvm/src
Matthias Krüger 5023691213
Rollup merge of #141538 - folkertdev:systemv-x86_64-va_arg, r=workingjubilee
implement `va_arg` for x86_64 systemv

tracking issue: https://github.com/rust-lang/rust/issues/44930

Turns out LLVM's `va_arg` is also unreliable for this target.

https://github.com/llvm/llvm-project/issues/141361

So, like clang, we implement our own. I used

- the spec at https://gitlab.com/x86-psABIs/x86-64-ABI
- the clang implementation at 9a440f8477/clang/lib/CodeGen/Targets/X86.cpp (L3041)

We can take a bunch of shortcuts because the return type of `va_list` must implement `VaArgSafe`. I also extended some of the tests, because up to 11 floats can be stored in the `reg_safe_area` for this calling convention.

r? `@workingjubilee`
`@rustbot` label +F-c_variadic

try-job: x86_64-apple-1
2025-05-30 07:01:30 +02:00
..
back Mark all optimize methods and the codegen method as safe 2025-05-28 20:55:00 +00:00
builder add custom enzyme markers to target methods 2025-04-25 11:09:52 +05:30
coverageinfo Remove methods from StaticCodegenMethods that are not called in cg_ssa itself 2025-05-28 20:55:00 +00:00
debuginfo Initial support for dynamically linked crates 2025-05-04 22:03:15 +03:00
llvm get rid of rustc_codegen_ssa::common::AtomicOrdering 2025-05-28 22:57:55 +02:00
abi.rs Remove unused arg_memory_ty method 2025-05-28 20:55:00 +00:00
allocator.rs Remove implicit #[no_mangle] for #[rustc_std_internal_symbol] 2025-03-17 14:08:09 +00:00
asm.rs Flatten control-flow in inline_asm_call after verification 2025-05-11 14:38:42 +10:00
attributes.rs don't depend on rustc_attr_parsing if rustc_data_structures will do 2025-05-09 23:16:55 +02:00
base.rs Make predefine methods take &mut self 2025-05-28 20:55:00 +00:00
builder.rs get rid of rustc_codegen_ssa::common::AtomicOrdering 2025-05-28 22:57:55 +02:00
callee.rs don't depend on rustc_attr_parsing if rustc_data_structures will do 2025-05-09 23:16:55 +02:00
common.rs Rename OperandBundleOwned to OperandBundleBox 2025-05-11 21:21:38 +10:00
consts.rs Remove methods from StaticCodegenMethods that are not called in cg_ssa itself 2025-05-28 20:55:00 +00:00
context.rs Remove a couple of uses of interior mutability around statics 2025-05-28 20:55:00 +00:00
declare.rs Make allocator shim creation mostly use safe code 2025-02-24 15:11:29 +00:00
errors.rs KCFI: Add KCFI arity indicator support 2025-04-05 04:05:04 +00:00
intrinsic.rs Remove usage of FnAbi in codegen_intrinsic_call 2025-05-26 10:13:03 +00:00
lib.rs Mark all optimize methods and the codegen method as safe 2025-05-28 20:55:00 +00:00
llvm_util.rs Added apxf target feature support, under flag apx_target_feature 2025-05-06 23:28:27 +05:30
mono_item.rs Make predefine methods take &mut self 2025-05-28 20:55:00 +00:00
type_.rs remove noinline attribute and add alwaysinline after AD pass 2025-04-28 21:10:32 +05:30
type_of.rs rename BackendRepr::Vector → SimdVector 2025-02-28 17:17:45 +01:00
va_arg.rs implement va_arg for x86_64 systemv and macOS 2025-05-29 22:06:02 +02:00
value.rs Add warn(unreachable_pub) to rustc_codegen_llvm. 2024-08-16 08:46:57 +10:00