Patent ID: 7386580

Claim:
A data processing apparatus comprising: processing circuitry configured to perform a data processing operation on first and second data elements, the processing circuitry comprising: comparison circuitry configured to compare at least a part of the first and second data elements in order to determine which of the first and second data elements is a larger data element, the comparison circuitry being configured to produce a comparison result which has a first value if the first data element is the larger data element and a second value if the second data element is the larger data element; absolute difference circuitry configured to compute an absolute difference between a portion of the first data element and a portion of the second data element, the absolute difference circuitry comprising: adder circuitry configured to invert one of said portions to produce an inverted data element portion and to add the inverted data element portion to the other of said portions and to the comparison result received from the comparison circuitry in order to produce an intermediate result; and output circuitry configured to generate an inverted version of the intermediate result and to output as the absolute difference either the intermediate result or the inverted version of the intermediate result dependent on the comparison result, wherein the adder circuitry is configured to invert the portion of the second data element, and wherein comparison circuitry is configured to set the comparison result as input to the adder circuitry to a Logical 0 value if the second data element is the larger data element and to a logical 1 value otherwise.