Itanium(R) processor topicParallel Average Instruction

pavg

Operation Font Conventions

Instruction Type A

Format

(qp) pavg1 r1 = r2, r3 normal form, one_byte_form

(qp) pavg1 raz r1 = r2, r3 raz form, one_byte_form

(qp) pavg2 r1 = r2, r3 two_byte_form

(qp) pavg2 raz r1 = r2, r3 raz form, two_byte_form


Description

The unsigned data elements of GR r2 are added to the unsigned data elements of GR r3. The results of the add are then each independently shifted to the right by one bit position. The high-order bits of each element are filled with the carry bits of the sums. To prevent cumulative round-off errors, an averaging is performed. The unsigned results are placed in GR r1.

The averaging operation works as follows. In the normal_form, the low-order bit of each result is set to 1 if at least one of the two least significant bits of the corresponding sum is 1. In the raz_form, the average rounds away from zero by adding 1 to each of the sums.

Click to see an example of the two_byte form of the parallel average instruction.

Click to see an example of the two_byte form of the parallel average instruction with round away from zero.


Related Topics:

fpabs - Floating-point Parallel Absolute Value Instruction

fpamax - Floating-point Parallel Absolute Value Maximum Instruction

fpamin - Floating-point Parallel Absolute Value Minimum Instruction

fpcmp - Floating-point Parallel Compare Instruction

fpcvt.fx - Convert Parallel Floating-point to Integer Instruction

fpma - Floating-point Parallel Multiply Add Instruction

fpmax - Floating-point Parallel Maximum Instruction

fpmerge - Floating-point Parallel Merge Instructions

fpmin - Floating-point Parallel Minimum Instruction

fpmpy - Floating-point Parallel Multiply Instruction

fpms - Floating-point Parallel Multiply Subtract Instruction

fpneg - Floating-point Parallel Negate Instruction

fpnegabs - Floating-point Parallel Negate Absolute Value Instruction

fpnma - Floating-point Parallel Negative Multiply Add Instruction

fpnmpy - Floating-point Parallel Negative Multiply Instruction

fprcpa - Floating-point Parallel Reciprocal Approximation Instruction

fprsqrta - Floating-point Parallel Reciprocal Square Root Approximation Instruction

Integer Multiply and Add (in FP Unit) Instructions

mov gr - Move General Register Instruction

mov imm - Move Immediate Instruction

padd - Parallel Add Instruction

Parallel Arithmetic Instructions

Parallel Data Arrangement Instructions

Parallel Shift Instructions

pavgsub - Parallel Average Subtract Instruction

pcmp - Parallel Compare Instruction

pmax - Parallel Maximum Instruction

pmin - Parallel Minimum Instruction

pmpy - Parallel Multiply Instruction

pmpyshr - Parallel Multiply and Shift Right Instruction

psad1 - Parallel Sum of Absolute Difference Instruction

pshl - Parallel Shift Left Instruction

pshradd - Parallel Shift Right and Add Instruction

psub - Parallel Subtract Instruction