================
@@ -3450,10 +3448,31 @@ ABIArgInfo WinX86_64ABIInfo::classify(QualType Ty,
unsigned &FreeSSERegs,
// Mingw64 GCC returns i128 in XMM0. Coerce to v2i64 to handle that.
// Clang matches them for compatibility.
- // NOTE: GCC actually returns f128 indirectly but will hopefully change.
- // See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115054#c8.
- return ABIArgInfo::getDirect(llvm::FixedVectorType::get(
- llvm::Type::getInt64Ty(getVMContext()), 2));
+ if (BT->getKind() == BuiltinType::Int128 ||
+ BT->getKind() == BuiltinType::UInt128)
+ return ABIArgInfo::getDirect(llvm::FixedVectorType::get(
+ llvm::Type::getInt64Ty(getVMContext()), 2));
+
+ // Mingw64 GCC returns f128 via sret, and Clang matches that for
+ // compatibility. This mirrors the X86 backend's CanLowerReturn logic.
+ if (BT->getKind() == BuiltinType::Float128) {
+ auto IsWin64F128StackCC = [this](unsigned CC) -> bool {
+ switch (CC) {
+ case llvm::CallingConv::Win64:
+ return true;
+ case llvm::CallingConv::C:
----------------
folkertdev wrote:
`VectorCall` is, from what I can find, clang-specific and so I don't think we
need to be compatible with anything for it. Leaving it as before is easier.
https://github.com/llvm/llvm-project/pull/204887
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits