3-490
INSTRUCTION SET REFERENCE
PAVGB/PAVGW—Packed Average (Continued)
Operation
IF (* instruction = PAVGB *) THEN
X[0] = DEST[7-0];
Y[0] = SRC/m64[7-0];
X[1] = DEST[15-8];
Y[1] = SRC/m64[15-8];
X[2]= DEST[23-16];
Y[2] = SRC/m64[23-16];
X[3] = DEST[31-24];
Y[3] = SRC/m64[31-24];
X[4] = DEST[39-32];
Y[4] = SRC/m64[39-32];
X[5] = DEST[47-40];
Y[5] = SRC/m64[47-40];
X[6] = DEST[55-48];
Y[6] = SRC/m64[55-48];
X[7] = DEST[63-56];
Y[7] = SRC/m64[63-56];
WHILE (I < 8)
TEMP[I] = ZERO_EXT(X[I], 8) + ZERO_EXT{Y[I], 8);
RES[I] = (TEMP[I] + 1) >> 1;
ENDWHILE
DEST[7-0] = RES[0];
DEST[15-8] = RES[1];
DEST[23-16] = RES[2];
DEST[31-24] = RES[3];
DEST[39-32] = RES[4];
DEST[47-40] = RES[5];
DEST[55-48] = RES[6];
DEST[63-56] = RES[7];
ELSE IF (* instruction PAVGW *)THEN
X[0] = DEST[15-0];
Y[0] = SRC/m64[15-0];
X[1] = DEST[31-16];
Y[1] = SRC/m64[31-16];
X[2] = DEST[47-32];
Y[2] = SRC/m64[47-32];
X[3] = DEST[63-48];
Y[3] = SRC/m64[63-48];