mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-08 20:06:03 +03:00
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:
parent
af7e19eb09
commit
7816e7730a
4 changed files with 51 additions and 9 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue