lrp - Linear interpolation

lrp - Linear interpolation

Calling Format

lrp     dest, src0, src1, src2

Operands

Name Registers
dest A temporary register
src0 A temporary register, input register, or floating-point constant register.
src1 A temporary register, input register, or floating-point constant register.
src2 A temporary register, input register, or floating-point constant register.

You can specify only one floating-point constant register among the three operands, src0, src1, and src2. However, there is one exception: you can specify two floating-point constant registers at the same time if you specify them for the combination of src0 and src1.
You cannot specify the same register for dest and src0.
You cannot specify the same register for dest and src2.
You cannot specify input registers with different indices for src0, src1, and src2 at the same time.

Overview

Stores in dest the result of using src0 to linearly interpolate between src1 and src2.

Operation

dest.x = src0.x * src1.x + (1 - src0.x )*src2.x
dest.y = src0.y * src1.y + (1 - src0.y )*src2.y
dest.z = src0.z * src1.z + (1 - src0.z )*src2.z
dest.w = src0.w * src1.w + (1 - src0.w )*src2.w

Macro Expansion

add     dest, src1, -src2
mad     dest, dest,  src0, src2

Code Example

lrp     r0, v1, c2, r3

Timetable

12345678
add read ADD post write
mad STALL read MUL ADD post write

Revision History

2011/12/20
Initial version.

CONFIDENTIAL