Skip to content

Commit 4ff6697

Browse files
committed
Revert r345676 due to test failure.
This was causing CodeGen/mingw-long-double.c to start failing. llvm-svn: 345691
1 parent ef83ddc commit 4ff6697

File tree

2 files changed

+11
-49
lines changed

2 files changed

+11
-49
lines changed

clang/lib/CodeGen/TargetInfo.cpp

Lines changed: 11 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3943,40 +3943,18 @@ ABIArgInfo WinX86_64ABIInfo::classify(QualType Ty, unsigned &FreeSSERegs,
39433943
// Otherwise, coerce it to a small integer.
39443944
return ABIArgInfo::getDirect(llvm::IntegerType::get(getVMContext(), Width));
39453945
}
3946+
// Bool type is always extended to the ABI, other builtin types are not
3947+
// extended.
3948+
const BuiltinType *BT = Ty->getAs<BuiltinType>();
3949+
if (BT && BT->getKind() == BuiltinType::Bool)
3950+
return ABIArgInfo::getExtend(Ty);
39463951

3947-
if (const BuiltinType *BT = Ty->getAs<BuiltinType>()) {
3948-
switch (BT->getKind()) {
3949-
case BuiltinType::Bool:
3950-
// Bool type is always extended to the ABI, other builtin types are not
3951-
// extended.
3952-
return ABIArgInfo::getExtend(Ty);
3953-
3954-
case BuiltinType::LongDouble:
3955-
// Mingw64 GCC uses the old 80 bit extended precision floating point
3956-
// unit. It passes them indirectly through memory.
3957-
if (IsMingw64) {
3958-
const llvm::fltSemantics *LDF = &getTarget().getLongDoubleFormat();
3959-
if (LDF == &llvm::APFloat::x87DoubleExtended())
3960-
return ABIArgInfo::getIndirect(Align, /*ByVal=*/false);
3961-
break;
3962-
}
3963-
3964-
case BuiltinType::Int128:
3965-
case BuiltinType::UInt128:
3966-
// If it's a parameter type, the normal ABI rule is that arguments larger
3967-
// than 8 bytes are passed indirectly. GCC follows it. We follow it too,
3968-
// even though it isn't particularly efficient.
3969-
if (!IsReturnType)
3970-
return ABIArgInfo::getIndirect(Align, /*ByVal=*/false);
3971-
3972-
// Mingw64 GCC returns i128 in XMM0. Coerce to v2i64 to handle that.
3973-
// Clang matches them for compatibility.
3974-
return ABIArgInfo::getDirect(
3975-
llvm::VectorType::get(llvm::Type::getInt64Ty(getVMContext()), 2));
3976-
3977-
default:
3978-
break;
3979-
}
3952+
// Mingw64 GCC uses the old 80 bit extended precision floating point unit. It
3953+
// passes them indirectly through memory.
3954+
if (IsMingw64 && BT && BT->getKind() == BuiltinType::LongDouble) {
3955+
const llvm::fltSemantics *LDF = &getTarget().getLongDoubleFormat();
3956+
if (LDF == &llvm::APFloat::x87DoubleExtended())
3957+
return ABIArgInfo::getIndirect(Align, /*ByVal=*/false);
39803958
}
39813959

39823960
return ABIArgInfo::getDirect();

clang/test/CodeGen/win64-i128.c

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)