c++: #include <immintrin.h> void test(const __m128&) {} d: import core.simd; extern(C++) void test(ref const float4); void main() { float4 f4; test(f4); } __mm128 doesn't seem to mangle right...
What does it mangle to and what should it mangle to?
And on what ABI? MSVC++ or Itanium?
@ibuclaw created dlang/dmd pull request #12080 "fix Issue 20652 - extern(C++) doesn't seem to mangle the types in core.simd right" fixing this issue: - fix Issue 20652 - extern(C++) doesn't seem to mangle the types in core.simd right https://github.com/dlang/dmd/pull/12080
(In reply to Iain Buclaw from comment #2) > And on what ABI? MSVC++ or Itanium? I've just realised that there's still this in cppmangle.d --- version (none) { buf.writestring("Dv"); buf.print((cast(TypeSArray *)t.basetype).dim.toInteger()); // -- Gnu ABI v.4 buf.writeByte('_'); } else buf.writestring("U8__vector"); //-- Gnu ABI v.3 --- I thought I dealt with this after introducing target.cpp.typeMangle(). A pull has been raised to enable the V4 ABI path. The V4 ABI first appeared in g++ 4.5, and became the default in g++ 5.
According to the testsuite, it looks like the MSVC mangler is broken too, not just the Itanium one. DMD: ?test20652@@YAXAET__m128@@@Z MSVC: ?test20652@@YAXAEBT__m128@@@Z The B looks to be for const, this has also been addressed in the PR.
dlang/dmd pull request #12080 "fix Issue 20652 - extern(C++) doesn't seem to mangle the types in core.simd right" was merged into stable: - 67cbcf1dceee5b7fd327a774b1a43b6c07175561 by Iain Buclaw: fix Issue 20652 - extern(C++) doesn't seem to mangle the types in core.simd right https://github.com/dlang/dmd/pull/12080
dlang/dmd pull request #12088 "merge stable" was merged into master: - cd5c6d49f3c52945cf8d1eeca4d11db6555d2125 by Iain Buclaw: fix Issue 20652 - extern(C++) doesn't seem to mangle the types in core.simd right https://github.com/dlang/dmd/pull/12088