Bug 20652 – extern(C++) doesn't seem to mangle the types in core.simd right

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-03-09T17:25:09Z
Last change time
2021-01-01T18:40:26Z
Keywords
pull, SIMD
Assigned to
No Owner
Creator
Manu

Comments

Comment #0 by turkeyman — 2020-03-09T17:25:09Z
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...
Comment #1 by bugzilla — 2020-12-22T09:59:54Z
What does it mangle to and what should it mangle to?
Comment #2 by ibuclaw — 2020-12-30T12:15:12Z
And on what ABI? MSVC++ or Itanium?
Comment #3 by dlang-bot — 2020-12-30T12:42:42Z
@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
Comment #4 by ibuclaw — 2020-12-30T12:54:58Z
(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.
Comment #5 by ibuclaw — 2020-12-30T18:07:34Z
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.
Comment #6 by dlang-bot — 2021-01-01T06:03:14Z
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
Comment #7 by dlang-bot — 2021-01-01T18:40:26Z
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