I am trying to use _mm_slli_epi64
to shift a _m128i
by one position. What I don't understand is, that the following code does not give me an all-zeroes output as I expected, but rather prints 0x00010000000000000000000000000000
. What might be wrong?
__m128i z = _mm_setr_epi8(0x80,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
printblock("z = ", z);
z = _mm_slli_epi64(z, 1);
printblock("z = ", z);
return;
_mm_slli_epi64
shifts each 64 bit integer left by the given number of bits. You have two 64 bit integers in your __m128i
:
0x0000000000000000 0x0000000000000080
and so when you shift each one left by one bit you get:
0x0000000000000000 0x0000000000000100
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With