about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc/example
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-05-30 07:01:30 +0200
committerGitHub <noreply@github.com>2025-05-30 07:01:30 +0200
commit5023691213f12b49ff9b47dba8c1f79479279f5e (patch)
treeb5f0524d53caec8f0b096e437884290b068e6052 /compiler/rustc_codegen_gcc/example
parentad2d91ce11ccdad5af3b7eca3c29c72a4ed06f74 (diff)
parent94cc72682ee840f7330f7703af74a2eee67fbba3 (diff)
downloadrust-5023691213f12b49ff9b47dba8c1f79479279f5e.tar.gz
rust-5023691213f12b49ff9b47dba8c1f79479279f5e.zip
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 https://github.com/llvm/llvm-project/blob/9a440f84773c56d3803f330774acb2b4f471d5b4/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
Diffstat (limited to 'compiler/rustc_codegen_gcc/example')
0 files changed, 0 insertions, 0 deletions