Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
clang/lib/CodeGen/CGBuiltin.cpp
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 100 Lines • ▼ Show 20 Lines | static SmallDenseMap<unsigned, StringRef, 8> F128Builtins{ | ||||
{Builtin::BI__builtin_vsnprintf, "__vsnprintfieee128"}, | {Builtin::BI__builtin_vsnprintf, "__vsnprintfieee128"}, | ||||
{Builtin::BI__builtin_vsprintf, "__vsprintfieee128"}, | {Builtin::BI__builtin_vsprintf, "__vsprintfieee128"}, | ||||
{Builtin::BI__builtin_sprintf, "__sprintfieee128"}, | {Builtin::BI__builtin_sprintf, "__sprintfieee128"}, | ||||
{Builtin::BI__builtin_snprintf, "__snprintfieee128"}, | {Builtin::BI__builtin_snprintf, "__snprintfieee128"}, | ||||
{Builtin::BI__builtin_fprintf, "__fprintfieee128"}, | {Builtin::BI__builtin_fprintf, "__fprintfieee128"}, | ||||
{Builtin::BI__builtin_nexttowardf128, "__nexttowardieee128"}, | {Builtin::BI__builtin_nexttowardf128, "__nexttowardieee128"}, | ||||
}; | }; | ||||
// The AIX library functions frexpl, ldexpl, and modfl are for 128-bit | |||||
// IBM 'long double' (i.e. __ibm128). Map to the 'double' versions | |||||
daltenty: I feel like we should be clear about which 128-bit double format we are talking about, since it… | |||||
Modified as suggested, thanks! xingxue: Modified as suggested, thanks! | |||||
// if it is 64-bit 'long double' mode. | |||||
static SmallDenseMap<unsigned, StringRef, 4> AIXLongDouble64Builtins{ | |||||
Please rename to "AIXLongDouble64Builtins". hubert.reinterpretcast: Please rename to "AIXLongDouble64Builtins". | |||||
Renamed as suggested, thanks! xingxue: Renamed as suggested, thanks! | |||||
{Builtin::BI__builtin_frexpl, "frexp"}, | |||||
{Builtin::BI__builtin_ldexpl, "ldexp"}, | |||||
{Builtin::BI__builtin_modfl, "modf"}, | |||||
}; | |||||
// If the builtin has been declared explicitly with an assembler label, | // If the builtin has been declared explicitly with an assembler label, | ||||
// use the mangled name. This differs from the plain label on platforms | // use the mangled name. This differs from the plain label on platforms | ||||
// that prefix labels. | // that prefix labels. | ||||
if (FD->hasAttr<AsmLabelAttr>()) | if (FD->hasAttr<AsmLabelAttr>()) | ||||
Name = getMangledName(D); | Name = getMangledName(D); | ||||
else { | else { | ||||
// TODO: This mutation should also be applied to other targets other than | // TODO: This mutation should also be applied to other targets other than | ||||
// PPC, after backend supports IEEE 128-bit style libcalls. | // PPC, after backend supports IEEE 128-bit style libcalls. | ||||
if (getTriple().isPPC64() && | if (getTriple().isPPC64() && | ||||
&getTarget().getLongDoubleFormat() == &llvm::APFloat::IEEEquad() && | &getTarget().getLongDoubleFormat() == &llvm::APFloat::IEEEquad() && | ||||
F128Builtins.find(BuiltinID) != F128Builtins.end()) | F128Builtins.find(BuiltinID) != F128Builtins.end()) | ||||
Name = F128Builtins[BuiltinID]; | Name = F128Builtins[BuiltinID]; | ||||
else if (getTriple().isOSAIX() && | |||||
&getTarget().getLongDoubleFormat() == | |||||
&llvm::APFloat::IEEEdouble() && | |||||
AIXLongDouble64Builtins.find(BuiltinID) != | |||||
AIXLongDouble64Builtins.end()) | |||||
Name = AIXLongDouble64Builtins[BuiltinID]; | |||||
else | else | ||||
Name = Context.BuiltinInfo.getName(BuiltinID) + 10; | Name = Context.BuiltinInfo.getName(BuiltinID) + 10; | ||||
} | } | ||||
llvm::FunctionType *Ty = | llvm::FunctionType *Ty = | ||||
cast<llvm::FunctionType>(getTypes().ConvertType(FD->getType())); | cast<llvm::FunctionType>(getTypes().ConvertType(FD->getType())); | ||||
return GetOrCreateLLVMFunction(Name, Ty, D, /*ForVTable=*/false); | return GetOrCreateLLVMFunction(Name, Ty, D, /*ForVTable=*/false); | ||||
▲ Show 20 Lines • Show All 19,530 Lines • Show Last 20 Lines |
I feel like we should be clear about which 128-bit double format we are talking about, since it may not be immediately clear for folks who aren't intimately familiar with AIX. Maybe we can reference __ibm128 or ibm 128-bit, so it's clear what we mean.