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>crs - Cross product</title>
9  </head>
10  <body>
11    <h1>crs - Cross product</h1>
12
13    <h2>Calling Format</h2>
14    <div class="section">
15      <pre class="definition">
16crs     dest{ .x | .y | .z | .xy | .xz | .yz | .xyz }, src0, src1
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>Requires any one of  { .x | .y | .z | .xy | .xz | .yz | .xyz } as the mask.<br>
33          </td>
34        </tr>
35        <tr>
36          <th>src0</th>
37          <td>
38            A temporary register, an input register, or a floating-point constant register.<br>Swizzling not possible.<br> Cannot specify anything other than the default mask { .xyzw }.<br>
39          </td>
40        </tr>
41        <tr>
42          <th>src1</th>
43          <td>
44            A temporary register, an input register, or a floating-point constant register.<br>Swizzling not possible.<br> Cannot specify anything other than the default mask { .xyzw }.<br>
45          </td>
46        </tr>
47      </table>
48      <p class="notice">
49        Cannot specify the same register for <SPAN class="argument">src0</SPAN> and <SPAN class="argument">dest</SPAN>.<br> Cannot specify the same register for <SPAN class="argument">src1</SPAN> and <SPAN class="argument">dest</SPAN>.<br> You cannot specify a floating-point constant register for both <SPAN class="argument">src0</SPAN> and <SPAN class="argument">src1</SPAN>.<br> You cannot specify input registers using different indices for <SPAN class="argument">src0</SPAN> and <SPAN class="argument">src1</SPAN> at the same time.<br>
50      </p>
51    </div>
52
53    <h2>Overview</h2>
54    <div class="section">
55      <p>
56        Stores the cross product of three components of <SPAN class="argument">src0</SPAN> and <SPAN class="argument">src1</SPAN> in <SPAN class="argument">dest</SPAN>.<br>
57      </p>
58    </div>
59
60    <h2>Operation</h2>
61    <div class="section">
62<pre class="definition">
63dest.x = src0.y * src1.z - src0.z * src1.y
64dest.y = src0.z * src1.x - src0.x * src1.z
65dest.z = src0.x * src1.y - src0.y * src1.x
66</pre>
67    </div>
68
69    <h2>Macro Expansion</h2>
70    <div class="section">
71<pre class="definition">
72mul     dest.xyz,  src0.yzx, src1.zxy
73mad     dest.xyz, -src1.yzx, src0.zxy, dest
74</pre>
75    </div>
76
77    <h2>Code Example</h2>
78    <div class="section">
79<pre class="definition">
80crs     r0.xyz, c1, v2
81</pre>
82    </div>
83
84    <h2>Timetable</h2>
85    <div class="section">
86      <table class="timetable">
87        <tr>
88          <th></th>
89          <th>1</th><th>2</th><th>3</th><th>4</th><th>5</th><th>6</th><th>7</th><th>8</th>
90        </tr>
91        <tr>
92          <th>mul </th>
93          <td class="read">read</td>
94          <td class="MUL">MUL</td>
95          <td class="post">post</td>
96          <td class="write">write</td>
97        </tr>
98        <tr>
99          <th>mad</th>
100          <td class="empty"></td>
101          <td class="stall" colspan="2">STALL</td>
102          <td class="read">read</td>
103          <td class="MUL">MUL</td>
104          <td class="ADD">ADD</td>
105          <td class="post">post</td>
106          <td class="write">write</td>
107          <td class="dummy"></td>
108        </tr>
109      </table>
110    </div>
111
112
113  <h2>Revision History</h2>
114  <div class="section">
115    <dl class="history">
116      <dt>2011/12/20</dt>
117      <dd>Initial version.<br />
118      </dd>
119    </dl>
120  </div>
121
122  <hr><p>CONFIDENTIAL</p></body>
123</html>