[all-commits] [llvm/llvm-project] c9de04: [ARM] Fixing ABI mismatch for packed structs passe...
Jirui-Wu via All-commits
all-commits at lists.llvm.org
Wed Jul 26 09:33:22 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: c9de04ea64ed4e30d5bad1e6cdc2b3eeccdcd701
https://github.com/llvm/llvm-project/commit/c9de04ea64ed4e30d5bad1e6cdc2b3eeccdcd701
Author: Jirui Wu <jirui.wu at arm.com>
Date: 2023-07-26 (Wed, 26 Jul 2023)
Changed paths:
M clang/lib/CodeGen/Targets/AArch64.cpp
M clang/test/CodeGen/aarch64-ABI-align-packed-assembly.c
M clang/test/CodeGen/aarch64-ABI-align-packed.c
M clang/test/CodeGen/aarch64-args-hfa.c
M clang/test/CodeGen/aarch64-neon-ldst-one.c
M clang/test/CodeGen/aarch64-neon-tbl.c
M clang/test/CodeGen/aarch64-poly64.c
M clang/test/CodeGen/arm-aapcs-vfp.c
M clang/test/CodeGen/arm64-aapcs-arguments.c
M clang/test/CodeGen/complex-math.c
M clang/test/CodeGenCXX/homogeneous-aggregates.cpp
Log Message:
-----------
[ARM] Fixing ABI mismatch for packed structs passed as function arguments
Previously when a packed struct, containing vector data types such as
uint16x8_t, is passed as a function argument, the alignment of the
struct used by the function caller and the alignment used by the callee
to load the argument from stack does not match.
This patch implements section 6.8.2, stage C.4 of the Procedure Call
Standard for the Arm 64-bit Architecture (AAPCS64): "If the argument is
an HFA, an HVA, a Quad-precision Floating-point or short vector type
then the NSAA is rounded up to the next multiple of 8 if its natural
alignment is ≤ 8 or the next multiple of 16 if its natural alignment
is ≥ 16." This ensures the alignments of the packed structs used as
function arguments are the same as described in the AAPCS64 for both
the caller and callee.
Reference:
AAPCS64 (https://github.com/ARM-software/abi-aa/blob/latest-release/aapcs64/aapcs64.rst)
Reviewed By: olista01, rjmccall, tmatheson
Differential Revision: https://reviews.llvm.org/D146242
More information about the All-commits
mailing list