Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AIX: use align 8 for byval parameter #134396

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion compiler/rustc_target/src/callconv/powerpc64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@ where

// The AIX ABI expect byval for aggregates
// See https://github.com/llvm/llvm-project/blob/main/clang/lib/CodeGen/Targets/PPC.cpp.
// The incoming parameter is represented as a pointer in the IR,
// the alignment is associated with the size of the register. (align 8 for 64bit)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there be a TODO regarding PowerPC SIMD vector types (https://doc.rust-lang.org/core/arch/powerpc64/index.html)?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably. Its 16 for vector types?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably. Its 16 for vector types?

It's 16 for vector types and aggregates with (non-packed) vector subobjects. There seems to be a bug in Clang for the packed cases.

if !is_ret && abi == AIX {
arg.pass_by_stack_offset(None);
arg.pass_by_stack_offset(Some(Align::from_bytes(8).unwrap()));
return;
}

Expand Down
Loading