I was recently looking at an assembly code which used psadbw
and pshufd
on xmm registers which are 128-bit register.
As per the documentation here on x86 architecture. It shows pshufd xmm0, xmm0, imm8
But I fail to understand how we can use it practically under what cases.
Similarly, psadbw
computes sum of absoulte differences of bytes. So, does it means like for 128bits register (16 bytes)
.
So let's say my instruction is psadbw xmm0 xmm5
does this do like |1st byte of xmm5 - 1st byte of xmm0| + |2nd byte of xmm5 - 2nd byte of xmm0| + ... + | 16th byte of xmm5 - 16th byte of xmm0|
? If not, how does that works.
Can anyone provide practical scenario ?