[PATCH] D158169: [X86] Fix i128 argument passing under SysV ABI
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 17 03:41:52 PDT 2023
nikic created this revision.
nikic added reviewers: pengfei, craig.topper, efriedma.
Herald added subscribers: StephenFan, hiraditya.
Herald added a project: All.
nikic requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
The x86_64 SysV ABI specifies that `__int128` is passed either in two registers (if available) or in a 16 byte aligned stack slot. GCC implements this behavior. However, if only one free register is available, LLVM will instead pass one half of the i128 in a register, and the other on the stack.
Make sure that either both are passed in registers or both on the stack.
Fixes https://github.com/llvm/llvm-project/issues/41784. The patch is basically what @craig.topper proposed to do there.
https://reviews.llvm.org/D158169
Files:
llvm/lib/Target/X86/X86CallingConv.td
llvm/test/CodeGen/X86/addcarry.ll
llvm/test/CodeGen/X86/i128-abi.ll
llvm/test/CodeGen/X86/sadd_sat_vec.ll
llvm/test/CodeGen/X86/ssub_sat_vec.ll
llvm/test/CodeGen/X86/subcarry.ll
llvm/test/CodeGen/X86/uadd_sat_vec.ll
llvm/test/CodeGen/X86/usub_sat_vec.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D158169.551075.patch
Type: text/x-patch
Size: 11973 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230817/d76bf0dc/attachment.bin>
More information about the llvm-commits
mailing list