SIMD Interleaving and Shuffling
'SIMD INTERLEAVING (LOW PAIR)
single s[20]={0,1,2,3,4,5,6,7}
movups xmm0,s[0]
movups xmm1,s[4]
unpcklps xmm0,xmm1
movups s[0],xmm0
print "SIMD: " s[0] " " s[1] " " s[2] " " s[3] " " ' 0 4 1 5
'SIMD INTERLEAVING (HIGH PAIR)
single s[20]={0,1,2,3,4,5,6,7}
movups xmm0,s[0]
movups xmm1,s[4]
unpckhps xmm0,xmm1
movups s[0],xmm0
print "SIMD: " s[0] " " s[1] " " s[2] " " s[3] " " ' 2 6 3 7
'SIMD SHUFFLING
single s[20]={0,1,2,3,4}
movups xmm0,s[0]
shufps xmm0,xmm0,0b00011011 'reverses order of elements 00 01 10 11
movups s[0],xmm0
print "SIMD: " s[0] " " s[1] " " s[2] " " s[3] " " ' 3 2 1 0