Skip to content
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

Why are some x86 intrinsic vector functions missing? #41332

Closed
RamType0 opened this issue Aug 25, 2020 · 13 comments
Closed

Why are some x86 intrinsic vector functions missing? #41332

RamType0 opened this issue Aug 25, 2020 · 13 comments
Labels
area-System.Runtime.Intrinsics question Answer questions and provide assistance, not an issue with source code or documentation.

Comments

@RamType0
Copy link

Where are MOVS(L/H)DUP,and string comparison intrinsic functions?
Why are they missing?

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label Aug 25, 2020
@Dotnet-GitSync-Bot
Copy link
Collaborator

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@huoyaoyuan
Copy link
Member

I've heard that those instructions are unfriendly for modern CPU architectures (comparing to the time they were introduced), and will have strong negative performance impact.

For their functionality, they should be able to be directly represented by Span methods. Let BCL to choose the most optimal way to do these.

@ghost
Copy link

ghost commented Aug 25, 2020

Tagging subscribers to this area: @tannergooding, @pgovind
See info in area-owners.md if you want to be subscribed.

@ghost
Copy link

ghost commented Aug 25, 2020

Tagging subscribers to this area: @tannergooding
See info in area-owners.md if you want to be subscribed.

@benaadams
Copy link
Member

benaadams commented Aug 25, 2020

Avx.DuplicateEvenIndexed, Avx.DuplicateOddIndexed etc?

/// <summary>
/// __m256 _mm256_moveldup_ps (__m256 a)
/// VMOVSLDUP ymm, ymm/m256
/// </summary>
public static Vector256<float> DuplicateEvenIndexed(Vector256<float> value) => DuplicateEvenIndexed(value);
/// <summary>
/// __m256d _mm256_movedup_pd (__m256d a)
/// VMOVDDUP ymm, ymm/m256
/// </summary>
public static Vector256<double> DuplicateEvenIndexed(Vector256<double> value) => DuplicateEvenIndexed(value);
/// <summary>
/// __m256 _mm256_movehdup_ps (__m256 a)
/// VMOVSHDUP ymm, ymm/m256
/// </summary>
public static Vector256<float> DuplicateOddIndexed(Vector256<float> value) => DuplicateOddIndexed(value);

Sse3.MoveAndDuplicate, Sse3.MoveHighAndDuplicate, Sse3.MoveLowAndDuplicate

/// <summary>
/// __m128d _mm_movedup_pd (__m128d a)
/// MOVDDUP xmm, xmm/m64
/// </summary>
public static Vector128<double> MoveAndDuplicate(Vector128<double> source) => MoveAndDuplicate(source);
/// <summary>
/// __m128 _mm_movehdup_ps (__m128 a)
/// MOVSHDUP xmm, xmm/m128
/// </summary>
public static Vector128<float> MoveHighAndDuplicate(Vector128<float> source) => MoveHighAndDuplicate(source);
/// <summary>
/// __m128 _mm_moveldup_ps (__m128 a)
/// MOVSLDUP xmm, xmm/m128
/// </summary>
public static Vector128<float> MoveLowAndDuplicate(Vector128<float> source) => MoveLowAndDuplicate(source);

@benaadams
Copy link
Member

Sse42 only has Crc, no string functions though

@RamType0
Copy link
Author

I found SSE3 MOVS(L/H)DUP, but I could not found AVX one,thanks!
But why are their naming is inconsistent?

@tannergooding
Copy link
Member

@RamType-0, do you mean why do the .NET names differ from the C/C++ names?

e.g Sse3.MoveAndDuplicate vs _mm_movedup_pd?

@RamType0
Copy link
Author

@RamType-0, do you mean why do the .NET names differ from the C/C++ names?

e.g Sse3.MoveAndDuplicate vs _mm_movedup_pd?

No.
I mean Sse3.MoveLowAndDuplicate vs Avx.DuplicateEvenIndexed.

@tannergooding
Copy link
Member

Likely just an oversight here.

DuplicateEvenIndexed and DuplicateOddIndexed are the logically better names, while MoveLowAndDuplicate is the description used for the double variant, as it only has two indices for the 128-bit version.

@tannergooding tannergooding added question Answer questions and provide assistance, not an issue with source code or documentation. and removed untriaged New issue has not been triaged by the area owner labels Sep 11, 2020
@tannergooding
Copy link
Member

Going to close this as resolved. The methods exist, they just have different names.

@RamType0
Copy link
Author

RamType0 commented Sep 12, 2020

Going to close this as resolved. The methods exist, they just have different names.

@tannergooding
Where is string comparison functions?
And also,will we have any changes about inconsistent naming?

@tannergooding
Copy link
Member

Where is string comparison functions?

They are tracked by #957 and require someone to propose some better names and API surface to ensure the functionality is exposed.

And also,will we have any changes about inconsistent naming?

At this point, I'd probably say not likely. That would just lead to additional surface area that does the same thing and adds a bit more inconsistency.
If you feel strongly, you should feel free to open an API proposal suggesting we expose them and I can take it to API review: https://github.com/dotnet/runtime/issues/new?assignees=&labels=api-suggestion&template=02_api_proposal.md

@ghost ghost locked as resolved and limited conversation to collaborators Dec 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Runtime.Intrinsics question Answer questions and provide assistance, not an issue with source code or documentation.
Projects
None yet
Development

No branches or pull requests

6 participants