Patent ID: 8139061

Claim:
A method of applying a shading effect to a pixel in an image using a vector floating point execution unit, the method comprising: receiving a one minus dot product instruction defined in an instruction set supported by the processing unit, the one minus dot product instruction configured to receive a surface normal vector and a view vector, each of the surface normal and view vectors including x, y and z values; and calculating an intensity value from the surface normal vector and the view vector by executing the one minus dot product instruction in a single pass through a plurality of stages of a multi-stage pipeline of the vector floating point execution unit, wherein executing the one minus dot product instruction includes: multiplying the respective x, y and z values from the surface normal and view vectors in respective first, second and third processing lanes of the multi-stage pipeline of the vector floating point execution unit; negating each of the first, second and third processing lanes of the vector floating point execution unit; forcing a fourth processing lane of the multi-stage pipeline of the vector floating point execution unit to a 1.0 value; and summing the first, second, third and fourth processing lanes to generate the intensity value.