Skip to content

[libc++] <experimental/simd> Add implicit type conversion constructor for class simd/simd_mask #71132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 23, 2023

Conversation

joy2myself
Copy link
Member

No description provided.

@joy2myself joy2myself requested a review from a team as a code owner November 3, 2023 02:02
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Nov 3, 2023
@joy2myself
Copy link
Member Author

Gentle ping. @philnik777

Copy link
Contributor

@philnik777 philnik777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM % comments.

};

template <class U, class T, class SimdAbi = ex::simd_abi::compatible<T>, class = void>
struct has_conversion_ctor : std::false_type {};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is_convertible?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried it but it seems is_convertible can not accurately test the type conversion constructor. When U is the same as T, simd[_mask]<U, Abi> is the same as simd[_mask]<T, Abi>. And the default copy constructor make them convertible no matter what the Abi is.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, my previous understanding may not right. The new commit may be what you want.

Copy link

github-actions bot commented Nov 17, 2023

✅ With the latest revision this PR passed the C/C++ code formatter.

@philnik777 philnik777 merged commit ba89749 into llvm:main Nov 23, 2023
Guzhu-AMD pushed a commit to GPUOpen-Drivers/llvm-project that referenced this pull request Nov 30, 2023
Local branch amd-gfx 461597c Merged main:0a9c6bea6b08 into amd-gfx:fad78e377956
Remote branch main ba89749 [libc++] <experimental/simd> Add implicit type conversion constructor for class simd/simd_mask (llvm#71132)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants