[clang] [clang] Always pass fp128 arguments indirectly on Windows (PR #115052)

2024-11-05 Thread Nikita Popov via cfe-commits
nikic wrote: @tgross35 Libcalls are handled by the backend. I think you'd have to modify the CC_X86_Win64_C / RetCC_X86_Win64_C calling conventions in https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/X86/X86CallingConv.td for that. https://github.com/llvm/llvm-project/pull/11505

[clang] [clang] Always pass fp128 arguments indirectly on Windows (PR #115052)

2024-11-05 Thread Trevor Gross via cfe-commits
tgross35 wrote: It seems like arguments aren't actually getting passed indirectly to libcalls. Simple test program ```c #include #include union ty128 { struct { uint64_t hi, lo; } u64x2; __float128 f128; }; void f128_add(__float128 a, __float128 b) { union ty128 cvt; cvt.f128 =

[clang] [clang] Always pass fp128 arguments indirectly on Windows (PR #115052)

2024-11-05 Thread Trevor Gross via cfe-commits
@@ -0,0 +1,19 @@ +// RUN: %clang_cc1 -triple x86_64-windows-gnu -emit-llvm -o - %s \ +// RUN:| FileCheck %s --check-prefix=GNU64 +// __float128 is unsupported on MSVC + +__float128 fp128_ret(void) { return 0; } +// GNU64: define dso_local void @fp128_ret(ptr dead_on_unwind noa

[clang] [clang] Always pass fp128 arguments indirectly on Windows (PR #115052)

2024-11-05 Thread Trevor Gross via cfe-commits
https://github.com/tgross35 updated https://github.com/llvm/llvm-project/pull/115052 >From 432e8a66156f08d45ad691017255364cfb0fd947 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Tue, 5 Nov 2024 07:00:35 -0500 Subject: [PATCH 1/2] [clang] Add fp128 ABI tests for MinGW (NFC) Duplicate `win64

[clang] [clang] Always pass fp128 arguments indirectly on Windows (PR #115052)

2024-11-05 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-backend-x86 @llvm/pr-subscribers-clang Author: Trevor Gross (tgross35) Changes Clang currently passes and returns `__float128` in vector registers on MinGW targets. However, the Windows x86-64 calling convention [1] states the following: > __m128 type

[clang] [clang] Always pass fp128 arguments indirectly on Windows (PR #115052)

2024-11-05 Thread Trevor Gross via cfe-commits
tgross35 wrote: Cc @beetrees and @wesleywiser https://github.com/llvm/llvm-project/pull/115052 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Always pass fp128 arguments indirectly on Windows (PR #115052)

2024-11-05 Thread via cfe-commits
github-actions[bot] wrote: Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it

[clang] [clang] Always pass fp128 arguments indirectly on Windows (PR #115052)

2024-11-05 Thread Trevor Gross via cfe-commits
https://github.com/tgross35 created https://github.com/llvm/llvm-project/pull/115052 Clang currently passes and returns `__float128` in vector registers on MinGW targets. However, the Windows x86-64 calling convention [1] states the following: > __m128 types, arrays, and strings are never pas