From a3b104176cc416bc2083ba46a8edf6efd489230a Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Thu, 1 May 2025 00:38:21 -0400 Subject: [PATCH] Align f128 to 16 bytes when passing on x86 LLVM does not seem to enforce the required 16-byte alignment, which is causing an ABI mismatch. This is not yet working locally. --- llvm/lib/Target/X86/X86CallingConv.td | 3 +++ 1 file changed, 3 insertions(+) diff --git a/llvm/lib/Target/X86/X86CallingConv.td b/llvm/lib/Target/X86/X86CallingConv.td index 0d087e057a2bd..52665050244e9 100644 --- a/llvm/lib/Target/X86/X86CallingConv.td +++ b/llvm/lib/Target/X86/X86CallingConv.td @@ -829,6 +829,9 @@ def CC_X86_32_Common : CallingConv<[ // Long doubles get slots whose size and alignment depends on the subtarget. CCIfType<[f80], CCAssignToStack<0, 0>>, + // f128 get 16-byte slots that are 16-byte aligned. + CCIfType<[f128], CCAssignToStack<16, 16>>, + // Boolean vectors of AVX-512 are passed in SIMD registers. // The call from AVX to AVX-512 function should work, // since the boolean types in AVX/AVX2 are promoted by default.