Win64: Use LLVM's vector calling convention for extern(D) (#2714)

I.e., pass and return vectors in registers. With the default C calling
convention (and the Win64 TargetABI not touching any vectors), vectors
are returned in XMM0, but inefficiently passed as ref to hidden copy
(automatically by LLVM).

Microsoft's vector calling convention, introduced opt-in with VS 2013,
additionally puts HFAs and HVAs (Homogeneous Float/Vector Aggregates)
into registers, see
https://blogs.msdn.microsoft.com/vcblog/2013/07/11/introducing-vector-calling-convention/.
This commit is contained in:
Martin Kinkelin 2018-05-31 01:44:46 +02:00 committed by GitHub
parent af7e19eb09
commit 7816e7730a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 51 additions and 9 deletions

View file

@ -104,17 +104,20 @@ struct llvm_init_obj {
};
std::string decorate(const std::string &name) {
#if defined(__APPLE__)
#if __APPLE__
return "_" + name;
#elif defined(_WIN32) && defined(_M_IX86)
#elif _WIN32
assert(!name.empty());
if (0x1 == name[0]) {
if (name[0] == 0x1)
return name.substr(1);
}
#if _M_IX86
return "_" + name;
#else
return name;
#endif
#else
return name;
#endif
}
auto getSymbolInProcess(const std::string &name)