1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
3  <head>
4    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5    <meta http-equiv="Content-Style-Type" content="text/css" />
6    <link rel="stylesheet" href="../css/manpage.css" type="text/css" />
7    <link rel="stylesheet" href="../css/timetable.css" type="text/css" />
8    <title>lrp - Linear interpolation</title>
9  </head>
10  <body>
11    <h1>lrp - Linear interpolation</h1>
12
13    <h2>Calling Format</h2>
14    <div class="section">
15      <pre class="definition">
16lrp     dest, src0, src1, src2
17</pre>
18    </div>
19
20    <h2>Operands</h2>
21    <div class="section">
22      <table class="arguments">
23        <thead>
24          <tr>
25            <th>Name</th>
26            <td>Registers</td>
27          </tr>
28        </thead>
29        <tr>
30          <th>dest</th>
31          <td>A temporary register</td>
32        </tr>
33        <tr>
34          <th>src0</th>
35          <td>A temporary register, input register, or floating-point constant register.</td>
36        </tr>
37        <tr>
38          <th>src1</th>
39          <td>A temporary register, input register, or floating-point constant register.</td>
40        </tr>
41        <tr>
42          <th>src2</th>
43          <td>A temporary register, input register, or floating-point constant register.</td>
44        </tr>
45      </table>
46      <p class="notice">
47        You can specify only one floating-point constant register among the three operands, <SPAN class="argument">src0</SPAN>, <SPAN class="argument">src1</SPAN>, and <SPAN class="argument">src2</SPAN>. 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 <SPAN class="argument">src0</SPAN> and <SPAN class="argument">src1</SPAN>.<br> You cannot specify the same register for <SPAN class="argument">dest</SPAN> and <SPAN class="argument">src0</SPAN>.<br> You cannot specify the same register for <SPAN class="argument">dest</SPAN> and <SPAN class="argument">src2</SPAN>.<br> You cannot specify input registers with different indices for <SPAN class="argument">src0</SPAN>, <SPAN class="argument">src1</SPAN>, and <SPAN class="argument">src2</SPAN> at the same time.<br>
48      </p>
49    </div>
50
51    <h2>Overview</h2>
52    <div class="section">
53      <p>
54        Stores in <SPAN class="argument">dest</SPAN> the result of using <SPAN class="argument">src0</SPAN> to linearly interpolate between <SPAN class="argument">src1</SPAN> and <SPAN class="argument">src2</SPAN>.<br>
55      </p>
56    </div>
57
58    <h2>Operation</h2>
59    <div class="section">
60<pre class="definition">
61dest.x = src0.x * src1.x + (1 - src0.x )*src2.x
62dest.y = src0.y * src1.y + (1 - src0.y )*src2.y
63dest.z = src0.z * src1.z + (1 - src0.z )*src2.z
64dest.w = src0.w * src1.w + (1 - src0.w )*src2.w
65</pre>
66    </div>
67
68    <h2>Macro Expansion</h2>
69    <div class="section">
70<pre class="definition">
71add     dest, src1, -src2
72mad     dest, dest,  src0, src2
73</pre>
74    </div>
75
76    <h2>Code Example</h2>
77    <div class="section">
78<pre class="definition">
79lrp     r0, v1, c2, r3
80</pre>
81    </div>
82
83    <h2>Timetable</h2>
84    <div class="section">
85      <table class="timetable">
86        <tr>
87          <th></th>
88          <th>1</th><th>2</th><th>3</th><th>4</th><th>5</th><th>6</th><th>7</th><th>8</th>
89        </tr>
90        <tr>
91          <th>add</th>
92          <td class="read">read</td>
93          <td class="ADD">ADD</td>
94          <td class="post">post</td>
95          <td class="write">write</td>
96</tr>
97<tr>
98          <th>mad</th>
99          <td class="empty"></td>
100          <td class="stall" colspan="2">STALL</td>
101          <td class="read">read</td>
102          <td class="MUL">MUL</td>
103          <td class="ADD">ADD</td>
104          <td class="post">post</td>
105          <td class="write">write</td>
106          <td class="dummy"></td>
107        </tr>
108      </table>
109    </div>
110
111
112  <h2>Revision History</h2>
113  <div class="section">
114    <dl class="history">
115      <dt>2011/12/20</dt>
116      <dd>Initial version.<br />
117      </dd>
118    </dl>
119  </div>
120
121  <hr><p>CONFIDENTIAL</p></body>
122</html>