Unpack/Pack に関して。でもこれ、対照的でないので合わせて書いていいものかどうか。。。
Unpack Low Data
punpcklbw mm0,mm1 |
|
* |
* |
* |
* |
b3 |
b2 |
b1 |
b0 |
mm0 |
|
* |
* |
* |
* |
B3 |
B2 |
B1 |
B0 |
mm1 |
↓ |
|
B3 |
b3 |
B2 |
b2 |
B1 |
b1 |
B0 |
b0 |
mm0 |
punpcklbw xmm0,xmm1 |
* |
* |
* |
* |
* |
* |
* |
* |
b7 |
b6 |
b5 |
b4 |
b3 |
b2 |
b1 |
b0 |
xmm0 |
* |
* |
* |
* |
* |
* |
* |
* |
B7 |
B6 |
B5 |
B4 |
B3 |
B2 |
B1 |
B0 |
xmm1 |
↓ |
B7 |
b7 |
B6 |
b6 |
B5 |
b5 |
B4 |
b4 |
B3 |
b3 |
B2 |
b2 |
B1 |
b1 |
B0 |
b0 |
xmm0 |
punpcklwd mm0,mm1 |
|
* |
* |
w1 |
w0 |
mm0 |
|
* |
* |
W1 |
W0 |
mm1 |
↓ |
|
W1 |
w1 |
W0 |
w0 |
mm0 |
punpcklwd xmm0,xmm1 |
* |
* |
* |
* |
w3 |
w2 |
w1 |
w0 |
xmm0 |
* |
* |
* |
* |
W3 |
W2 |
W1 |
W0 |
xmm1 |
↓ |
W3 |
w3 |
W2 |
w2 |
W1 |
w1 |
W0 |
w0 |
xmm0 |
punpckldq mm0,mm1 |
|
* |
d0 |
mm0 |
|
* |
D0 |
mm1 |
↓ |
|
D0 |
d0 |
mm0 |
punpckldq xmm0,xmm1 |
* |
* |
d1 |
d0 |
xmm0 |
* |
* |
D1 |
D0 |
xmm1 |
↓ |
D1 |
d1 |
D0 |
d0 |
xmm0 |
punpcklqdq xmm0,xmm1 |
* |
q0 |
xmm0 |
* |
Q0 |
xmm1 |
↓ |
Q0 |
q0 |
xmm0 |
Unpack High Data
punpckhbw mm0,mm1 |
|
b7 |
b6 |
b5 |
b4 |
* |
* |
* |
* |
mm0 |
|
B7 |
B6 |
B5 |
B4 |
* |
* |
* |
* |
mm1 |
↓ |
|
B7 |
b7 |
B6 |
b6 |
B5 |
b5 |
B4 |
b4 |
mm0 |
punpckhbw xmm0,xmm1 |
b15 |
b14 |
b13 |
b12 |
b11 |
b10 |
b9 |
b8 |
* |
* |
* |
* |
* |
* |
* |
* |
xmm0 |
B15 |
B14 |
B13 |
B12 |
B11 |
B10 |
B9 |
B8 |
* |
* |
* |
* |
* |
* |
* |
* |
xmm1 |
↓ |
B15 |
b15 |
B14 |
b14 |
B13 |
b13 |
B12 |
b12 |
B11 |
b11 |
B10 |
b10 |
B9 |
b9 |
B8 |
b8 |
xmm0 |
punpckhwd mm0,mm1 |
|
w3 |
w2 |
* |
* |
mm0 |
|
W3 |
W2 |
* |
* |
mm1 |
↓ |
|
W3 |
w3 |
W2 |
w2 |
mm0 |
punpckhwd xmm0,xmm1 |
w7 |
w6 |
w5 |
w4 |
* |
* |
* |
* |
xmm0 |
W7 |
W6 |
W5 |
W4 |
* |
* |
* |
* |
xmm1 |
↓ |
W7 |
w7 |
W6 |
w6 |
W5 |
w5 |
W4 |
w4 |
xmm0 |
punpckhdq mm0,mm1 |
|
d1 |
* |
mm0 |
|
D1 |
* |
mm1 |
↓ |
|
D1 |
d1 |
mm0 |
punpckhdq xmm0,xmm1 |
d3 |
d2 |
* |
* |
xmm0 |
D3 |
D2 |
* |
* |
xmm1 |
↓ |
D3 |
d3 |
D2 |
d2 |
xmm0 |
punpckhqdq xmm0,xmm1 |
q1 |
* |
xmm0 |
Q1 |
* |
xmm1 |
↓ |
Q1 |
q1 |
xmm0 |
Pack with Signed Saturation
packsswb mm0,mm1 |
|
w3 |
w2 |
w1 |
w0 |
mm0 |
|
W3 |
W2 |
W1 |
W0 |
mm1 |
↓bj = SaturateSignedWordToSignedByte( wi ) |
|
B7' |
B6' |
B5' |
B4' |
b3' |
b2' |
b1' |
b0' |
mm0 |
packsswb xmm0,xmm1 |
w7 |
w6 |
w5 |
w4 |
w3 |
w2 |
w1 |
w0 |
xmm0 |
W7 |
W6 |
W5 |
W4 |
W3 |
W2 |
W1 |
W0 |
xmm1 |
↓bj = SaturateSignedWordToSignedByte( wi ) |
B7' |
B6' |
B5' |
B4' |
B3' |
B2' |
B1' |
B0' |
b7' |
b6' |
b5' |
b4' |
b3' |
b2' |
b1' |
b0' |
xmm0 |
packssdw mm0,mm1 |
|
d1 |
d0 |
mm0 |
|
D1 |
D0 |
mm1 |
↓wj = SaturateSignedDoublewordToSignedWord( di ) |
|
W1' |
W0' |
w1' |
w0' |
mm0 |
packssdw xmm0,xmm1 |
d3 |
d2 |
d1 |
d0 |
xmm0 |
D3 |
D2 |
D1 |
D0 |
xmm1 |
↓wj = SaturateSignedDoublewordToSignedWord( di ) |
W3' |
W2' |
W1' |
W0' |
w3' |
w2' |
w1' |
w0' |
xmm0 |
Pack with Unsigned Saturation
packuswb mm0,mm1 |
packuswb xmm0,xmm1 |
これらは符合無しになるだけで飽和付き符合有りパック演算と同じですが、命令には packuswb しかありません。
|
Pack with Signed Saturation |
Pack with Unsigned Saturation |
byte |
packsswb |
packuswb |
word |
packssdw |
packusdw(存在せず?) |
|