Skip to content

Conversation

Xazax-hun
Copy link
Contributor

@Xazax-hun Xazax-hun commented Aug 7, 2025

This supports both built-in vector types and the SIMDX Swift types
that are used through type aliases like float3. These SIMD types are
passed via compatibility structs (with their valued memcpy-d into the
ABI compatible struct) as they have special ABI rules. E.g., a float3 is
not passed as float3, but as float4 on the ABI level.

Previously, we did not expose simd types from Swift to C++ (unless the
SIMD types were impoted from clang).

rdar://153218744

@Xazax-hun Xazax-hun added the c++ interop Feature: Interoperability with C++ label Aug 7, 2025
@Xazax-hun Xazax-hun force-pushed the reverse-interop-better-simd branch from 59ebd61 to 5b0a382 Compare August 8, 2025 10:46
@Xazax-hun Xazax-hun changed the title [cxx-interop] Better support SIMD types [cxx-interop] Support SIMD types in reverse interop Aug 8, 2025
@Xazax-hun Xazax-hun marked this pull request as ready for review August 8, 2025 10:47
@Xazax-hun
Copy link
Contributor Author

@swift-ci please smoke test

@Xazax-hun Xazax-hun force-pushed the reverse-interop-better-simd branch from 5b0a382 to 39d90cc Compare August 8, 2025 14:53
@Xazax-hun
Copy link
Contributor Author

@swift-ci please smoke test

@Xazax-hun
Copy link
Contributor Author

@swift-ci please smoke test Windows

This supports both built-in vector types and the SIMDX<T> Swift types
that are used through type aliases like float3. These SIMD types are
passed via compatibility structs (with their valued memcpy-d into the
ABI compatible struct) as they have special ABI rules. E.g., a float3 is
not passed as float3, but as float4 on the ABI level.

Previously, we did not expose simd types from Swift to C++ (unless the
SIMD types were impoted from clang).

rdar://153218744
@Xazax-hun Xazax-hun force-pushed the reverse-interop-better-simd branch from 39d90cc to 9807881 Compare September 9, 2025 13:52
@Xazax-hun
Copy link
Contributor Author

@swift-ci please smoke test

@Xazax-hun Xazax-hun enabled auto-merge September 22, 2025 16:11
@Xazax-hun Xazax-hun merged commit ab4e416 into swiftlang:main Sep 22, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ interop Feature: Interoperability with C++

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants