llvm/llvm-project
Vedi su GitHubCalling convention differs from MSVC for member functions returning SIMD types
Open
#104 aperta il 22 gen 2020
ABIbackend:X86extension:microsoftgood first issueplatform:windows
Metriche repository
- Star
- (26.378 star)
- Metriche merge PR
- (Merge medio 1g 2h) (1000 PR mergiate in 30 g)
Descrizione
#include "xmmintrin.h"
class Foo {
public:
__declspec(noinline) __m128 bar() {
return __m128{};
}
};
clang-cl returns in xmm0, msvc takes a second hidden parameter to write to, so when the caller and callee come from objects created by different compilers any integer parameters are offset and the return value is incorrect.
The visual studio documentation (https://docs.microsoft.com/en-us/cpp/build/x64-calling-convention?view=vs-2019#return-values) seem to imply that clang's behaviour is correct, unless __m128 etc are considered user defined types.