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>nrm - Normalize</title>
9  </head>
10  <body>
11    <h1>nrm - Normalize</h1>
12
13    <h2>Calling Format</h2>
14    <div class="section">
15      <pre class="definition">
16nrm     dest, src
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>
32            A temporary register.<br>
33          </td>
34        </tr>
35        <tr>
36          <th>src</th>
37          <td>
38            A temporary register or input register.<br>
39          </td>
40        </tr>
41      </table>
42      <p class="notice">
43        You cannot specify the same register for <SPAN class="argument">src</SPAN> and <SPAN class="argument">dest</SPAN>.<br>
44      </p>
45    </div>
46
47    <h2>Overview</h2>
48    <div class="section">
49      <p>
50        Stores the normalized result of <SPAN class="argument">src</SPAN> in <SPAN class="argument">dest</SPAN>.<br>
51      </p>
52    </div>
53
54    <h2>Operation</h2>
55    <div class="section">
56<pre class="definition">
57tmp = sqrt ( src.x * src.x + src.y * src.y + src.z * src.z + src.w * src.w )
58dest.x = src.x* ( 1 / tmp )
59dest.y = src.y* ( 1 / tmp )
60dest.z = src.z* ( 1 / tmp )
61dest.w = src.w* ( 1 / tmp )
62</pre>
63    </div>
64
65    <h2>Macro Expansion</h2>
66    <div class="section">
67<pre class="definition">
68dp4     dest.x, src,    src
69rsq     dest.x, dest.x
70mul     dest,   src,    dest.x
71</pre>
72    </div>
73
74    <h2>Code Example</h2>
75    <div class="section">
76<pre class="definition">
77nrm     r0,     v0
78</pre>
79    </div>
80
81    <h2>Timetable </h2>
82    <div class="section">
83      <table class="timetable">
84        <tr>
85          <th></th>
86          <th>1</th><th>2</th><th>3</th><th>4</th><th>5</th><th>6</th><th>7</th><th>8</th><th>9</th><th>10</th>
87          <th>11</th><th>12</th><th>13</th>
88        </tr>
89        <tr>
90          <th>dp4</th>
91          <td class="read">read</td>
92          <td class="MUL">MUL</td>
93          <td class="ADD">ADD</td>
94          <td class="ADD">ADD</td>
95          <td class="post">post</td>
96          <td class="write">write</td>
97        </tr>
98        <tr>
99          <th>rsq</th>
100          <td class="empty"></td>
101          <td class="stall" colspan="4">STALL</td>
102          <td class="read">read</td>
103          <td class="RSQ" colspan="2">RCP / RSQ</td>
104          <td class="post">post</td>
105          <td class="write">write</td>
106        </tr>
107        <tr>
108          <th>mul</th>
109          <td class="empty" colspan="6"></td>
110          <td class="stall" colspan="3">STALL</td>
111          <td class="read">read</td>
112          <td class="MUL">MUL</td>
113          <td class="post">post</td>
114          <td class="write">write</td>
115          <td class="dummy"></td>
116        </tr>
117      </table>
118    </div>
119
120
121  <h2>Revision History</h2>
122  <div class="section">
123    <dl class="history">
124      <dt>2011/12/20</dt>
125      <dd>Initial version.<br />
126      </dd>
127    </dl>
128  </div>
129
130  <hr><p>CONFIDENTIAL</p></body>
131</html>