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

Avx2.BroadcastScalarToVector128(T*) overloads are missing #26444

Closed
tannergooding opened this issue Jun 11, 2018 · 6 comments · Fixed by dotnet/coreclr#20055
Closed

Avx2.BroadcastScalarToVector128(T*) overloads are missing #26444

tannergooding opened this issue Jun 11, 2018 · 6 comments · Fixed by dotnet/coreclr#20055

Comments

@tannergooding
Copy link
Member

Avx2 is currently only exposing the Avx2.BroadcastScalarToVector128(Vector128<T>) overloads.

It should also expose the Avx2.BroadcastScalarToVector128(T*) overloads (exploding T, due to the limitations on using T*) to have parity with the overloads available for float/double in Avx and to ensure that the VPBROADCASTB xmm, m8 encodings are properly exposed.

@tannergooding
Copy link
Member Author

FYI. @eerhardt, @CarolEidt, @fiigii

@tannergooding
Copy link
Member Author

Found this API missing when porting the DirectX math library: https://github.com/Microsoft/DirectXMath

@fiigii
Copy link
Contributor

fiigii commented Jun 26, 2018

@tannergooding Can we implement these overloads by containment optimization?

@tannergooding
Copy link
Member Author

@fiigii, not easily.

Users would have to convert a ref T into a ref Vector128<T> and understand that it is safe to do that since this operation only reads T bytes.

I think it is more understandable, and easier to handle, if we just add T* overloads.

@fiigii
Copy link
Contributor

fiigii commented Jun 26, 2018

Users would have to convert a ref T into a ref Vector128

Agree.

if we just add T* overloads.

Don't you mean the overloads of pointers to all integer types (e.g., byte*, short*, etc) or generic ref? As I know, C# does not have generic pointers.

@tannergooding
Copy link
Member Author

Don't you mean the overloads of pointers to all integer types

Right, hence the exploding T, due to the limitations on using T* comment in the original post.

As I know, C# does not have generic pointers.

It does, as of C# 7.3 with the unmanaged constraint. But there are issues with doing that (such as requiring the compiler to understand the new modreq attribute) that make it less desirable to use in the framework.

@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the 3.0 milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants