What is the netCore SSE2 counterpart of _mm_set1_epi32

0

I'm porting some c++ SIMD instruction code to netCore Intrinsics and went over following line:

__m128i ssd = _mm_set1_epi32((unsigned __int32)(alpha_value & 0x000000FF) << 24); //ALPHA CHANNEL MASK

In the docs of netCore SSE2 Intrinsics I could not find any corresponding method for the _mm_set1_epi32 intrinsic.

What this instruction does is setting each of the 4 32 bit uint in the 128 bit vector to a specified value.

How to do that in netCore with Vector128<uint>?

c#
.net-core
sse
simd
intrinsics
asked on Stack Overflow Jul 7, 2020 by Quergo • edited Jul 7, 2020 by Peter Cordes

1 Answer

2

It's not in that class, instead Vector128 has static a Create function with various overloads that can be used in place of both the set1-group and set-group of functions. Since they are overloads and don't have the type in the name, special care must be taken that the parameter type is correct.

answered on Stack Overflow Jul 8, 2020 by harold

User contributions licensed under CC BY-SA 3.0